diff --git a/src/machinelearningservices/HISTORY.rst b/src/machinelearningservices/HISTORY.rst new file mode 100644 index 0000000000..27f152061e --- /dev/null +++ b/src/machinelearningservices/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/machinelearningservices/README.md b/src/machinelearningservices/README.md new file mode 100644 index 0000000000..91566ffe95 --- /dev/null +++ b/src/machinelearningservices/README.md @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'machinelearningservices' Extension +========================================== + +This package is for the 'machinelearningservices' extension. +i.e. 'az machinelearningservices' diff --git a/src/machinelearningservices/azext_machinelearningservices/__init__.py b/src/machinelearningservices/azext_machinelearningservices/__init__.py new file mode 100644 index 0000000000..1ad71f7ee4 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/__init__.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_machinelearningservices.generated._help import helps # pylint: disable=unused-import + + +class AzureMachineLearningWorkspacesCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_machinelearningservices.generated._client_factory import cf_machinelearningservices + machinelearningservices_custom = CliCommandType( + operations_tmpl='azext_machinelearningservices.custom#{}', + client_factory=cf_machinelearningservices) + super(AzureMachineLearningWorkspacesCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=machinelearningservices_custom) + + def load_command_table(self, args): + from azext_machinelearningservices.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_machinelearningservices.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_machinelearningservices.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_machinelearningservices.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = AzureMachineLearningWorkspacesCommandsLoader diff --git a/src/machinelearningservices/azext_machinelearningservices/action.py b/src/machinelearningservices/azext_machinelearningservices/action.py new file mode 100644 index 0000000000..a846b2766c --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/machinelearningservices/azext_machinelearningservices/azext_metadata.json b/src/machinelearningservices/azext_machinelearningservices/azext_metadata.json new file mode 100644 index 0000000000..7b56fb1e11 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} \ No newline at end of file diff --git a/src/machinelearningservices/azext_machinelearningservices/custom.py b/src/machinelearningservices/azext_machinelearningservices/custom.py new file mode 100644 index 0000000000..7f31674ce9 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/custom.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/machinelearningservices/azext_machinelearningservices/generated/__init__.py b/src/machinelearningservices/azext_machinelearningservices/generated/__init__.py new file mode 100644 index 0000000000..ee0c4f36bd --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/generated/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/machinelearningservices/azext_machinelearningservices/generated/_client_factory.py b/src/machinelearningservices/azext_machinelearningservices/generated/_client_factory.py new file mode 100644 index 0000000000..816188ebb1 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/generated/_client_factory.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +def cf_machinelearningservices(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.machinelearningservices import AzureMachineLearningWorkspaces + return get_mgmt_service_client(cli_ctx, AzureMachineLearningWorkspaces) + + +def cf_workspace(cli_ctx, *_): + return cf_machinelearningservices(cli_ctx).workspace + + +def cf_workspace_feature(cli_ctx, *_): + return cf_machinelearningservices(cli_ctx).workspace_feature + + +def cf_usage(cli_ctx, *_): + return cf_machinelearningservices(cli_ctx).usage + + +def cf_virtual_machine_size(cli_ctx, *_): + return cf_machinelearningservices(cli_ctx).virtual_machine_size + + +def cf_quota(cli_ctx, *_): + return cf_machinelearningservices(cli_ctx).quota + + +def cf_machine_learning_compute(cli_ctx, *_): + return cf_machinelearningservices(cli_ctx).machine_learning_compute + + +def cf_private_endpoint_connection(cli_ctx, *_): + return cf_machinelearningservices(cli_ctx).private_endpoint_connection + + +def cf_private_link_resource(cli_ctx, *_): + return cf_machinelearningservices(cli_ctx).private_link_resource diff --git a/src/machinelearningservices/azext_machinelearningservices/generated/_help.py b/src/machinelearningservices/azext_machinelearningservices/generated/_help.py new file mode 100644 index 0000000000..96514cbecb --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/generated/_help.py @@ -0,0 +1,587 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['machinelearningservices workspace'] = """ + type: group + short-summary: machinelearningservices workspace +""" + +helps['machinelearningservices workspace list'] = """ + type: command + short-summary: Lists all the available machine learning workspaces under the specified subscription. + examples: + - name: Get Workspaces by Resource Group + text: |- + az machinelearningservices workspace list --resource-group "workspace-1234" +""" + +helps['machinelearningservices workspace show'] = """ + type: command + short-summary: Gets the properties of the specified machine learning workspace. + examples: + - name: Get Workspace + text: |- + az machinelearningservices workspace show --resource-group "workspace-1234" --workspace-name "testworksp\ +ace" +""" + +helps['machinelearningservices workspace create'] = """ + type: command + short-summary: Creates or updates a workspace with the specified parameters. + examples: + - name: Create Workspace + text: |- + az machinelearningservices workspace create --location "eastus2euap" --description "test description" --\ +application-insights "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/micro\ +soft.insights/components/testinsights" --container-registry "/subscriptions/00000000-1111-2222-3333-444444444444/resour\ +ceGroups/workspace-1234/providers/Microsoft.ContainerRegistry/registries/testRegistry" --encryption-key-vault-propertie\ +s identity-client-id="" key-identifier="https://testkv.vault.azure.net/keys/testkey/aabbccddee112233445566778899aabb" k\ +ey-vault-arm-id="/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.\ +KeyVault/vaults/testkv" --encryption-status "Enabled" --friendly-name "HelloName" --hbi-workspace false --key-vault "/s\ +ubscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.KeyVault/vaults/tes\ +tkv" --shared-private-link-resources name="testdbresource" private-link-resource-id="/subscriptions/00000000-1111-2222-\ +3333-444444444444/resourceGroups/workspace-1234/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateL\ +inkResources/Sql" group-id="Sql" request-message="Please approve" status="Approved" --storage-account "/subscriptions/0\ +0000000-1111-2222-3333-444444444444/resourceGroups/accountcrud-1234/providers/Microsoft.Storage/storageAccounts/testSto\ +rageAccount" --sku name="Basic" tier="Basic" --resource-group "workspace-1234" --workspace-name "testworkspace" +""" + +helps['machinelearningservices workspace update'] = """ + type: command + short-summary: Updates a machine learning workspace with the specified parameters. + examples: + - name: Update Workspace + text: |- + az machinelearningservices workspace update --description "new description" --friendly-name "New friendl\ +y name" --sku name="Enterprise" tier="Enterprise" --resource-group "workspace-1234" --workspace-name "testworkspace" +""" + +helps['machinelearningservices workspace delete'] = """ + type: command + short-summary: Deletes a machine learning workspace. + examples: + - name: Delete Workspace + text: |- + az machinelearningservices workspace delete --resource-group "workspace-1234" --workspace-name "testwork\ +space" +""" + +helps['machinelearningservices workspace list-key'] = """ + type: command + short-summary: Lists all the keys associated with this workspace. This includes keys for the storage account, app i\ +nsights and password for container registry + examples: + - name: List Workspace Keys + text: |- + az machinelearningservices workspace list-key --resource-group "testrg123" --workspace-name "workspaces1\ +23" +""" + +helps['machinelearningservices workspace resync-key'] = """ + type: command + short-summary: Resync all the keys associated with this workspace. This includes keys for the storage account, app \ +insights and password for container registry + examples: + - name: Resync Workspace Keys + text: |- + az machinelearningservices workspace resync-key --resource-group "testrg123" --workspace-name "workspace\ +s123" +""" + +helps['machinelearningservices workspace-feature'] = """ + type: group + short-summary: machinelearningservices workspace-feature +""" + +helps['machinelearningservices workspace-feature list'] = """ + type: command + short-summary: Lists all enabled features for a workspace + examples: + - name: List Workspace features + text: |- + az machinelearningservices workspace-feature list --resource-group "myResourceGroup" --workspace-name "t\ +estworkspace" +""" + +helps['machinelearningservices usage'] = """ + type: group + short-summary: machinelearningservices usage +""" + +helps['machinelearningservices usage list'] = """ + type: command + short-summary: Gets the current usage information as well as limits for AML resources for given subscription and lo\ +cation. + examples: + - name: List Usages + text: |- + az machinelearningservices usage list --location "eastus" +""" + +helps['machinelearningservices virtual-machine-size'] = """ + type: group + short-summary: machinelearningservices virtual-machine-size +""" + +helps['machinelearningservices virtual-machine-size list'] = """ + type: command + short-summary: Returns supported VM Sizes in a location + examples: + - name: List VM Sizes + text: |- + az machinelearningservices virtual-machine-size list --location "eastus" +""" + +helps['machinelearningservices quota'] = """ + type: group + short-summary: machinelearningservices quota +""" + +helps['machinelearningservices quota list'] = """ + type: command + short-summary: Gets the currently assigned Workspace Quotas based on VMFamily. + examples: + - name: List workspace quotas by VMFamily + text: |- + az machinelearningservices quota list --location "eastus" +""" + +helps['machinelearningservices quota update'] = """ + type: command + short-summary: Update quota for each VM family in workspace. + examples: + - name: update quotas + text: |- + az machinelearningservices quota update --location "eastus" --value type="Microsoft.MachineLearningServi\ +ces/workspaces/dedicatedCores/quotas" id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/provide\ +rs/Microsoft.MachineLearningServices/workspaces/demo_workspace1/quotas/StandardDSv2Family" limit=100 unit="Count" --val\ +ue type="Microsoft.MachineLearningServices/workspaces/dedicatedCores/quotas" id="/subscriptions/00000000-0000-0000-0000\ +-000000000000/resourceGroups/rg/providers/Microsoft.MachineLearningServices/workspaces/demo_workspace2/quotas/StandardD\ +Sv2Family" limit=200 unit="Count" +""" + +helps['machinelearningservices machine-learning-compute'] = """ + type: group + short-summary: machinelearningservices machine-learning-compute +""" + +helps['machinelearningservices machine-learning-compute list'] = """ + type: command + short-summary: Gets computes in specified workspace. + examples: + - name: Get Computes + text: |- + az machinelearningservices machine-learning-compute list --resource-group "testrg123" --workspace-name "\ +workspaces123" +""" + +helps['machinelearningservices machine-learning-compute show'] = """ + type: command + short-summary: Gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not re\ +turned - use 'keys' nested resource to get them. + examples: + - name: Get a AKS Compute + text: |- + az machinelearningservices machine-learning-compute show --compute-name "compute123" --resource-group "t\ +estrg123" --workspace-name "workspaces123" + - name: Get a AML Compute + text: |- + az machinelearningservices machine-learning-compute show --compute-name "compute123" --resource-group "t\ +estrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute aks'] = """ + type: group + short-summary: machinelearningservices machine-learning-compute sub group aks +""" + +helps['machinelearningservices machine-learning-compute aks create'] = """ + type: command + short-summary: Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverabl\ +e operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. + examples: + - name: Create AKS Compute + text: |- + az machinelearningservices machine-learning-compute aks create --compute-name "compute123" --location "e\ +astus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a AML Compute + text: |- + az machinelearningservices machine-learning-compute aks create --compute-name "compute123" --identity-ty\ +pe "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-0000-00000\ +0000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{}}"\ + --location "eastus" --aks-properties "{\\"remoteLoginPortPublicAccess\\":\\"NotSpecified\\",\\"scaleSettings\\":{\\"ma\ +xNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"},\\"vmPriority\\":\\"Dedicated\\",\\"\ +vmSize\\":\\"STANDARD_NC6\\"}" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a DataFactory Compute + text: |- + az machinelearningservices machine-learning-compute aks create --compute-name "compute123" --location "e\ +astus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AKS Compute + text: |- + az machinelearningservices machine-learning-compute aks create --compute-name "compute123" --location "e\ +astus" --description "some compute" --aks-properties "{\\"agentCount\\":4}" --resource-id "/subscriptions/34adfa4f-cedf\ +-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-\ +c9b00420020b2" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AML Compute + text: |- + az machinelearningservices machine-learning-compute aks create --compute-name "compute123" --identity-ty\ +pe "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-0000-00000\ +0000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{}}"\ + --location "eastus" --aks-properties "{\\"scaleSettings\\":{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeB\ +eforeScaleDown\\":\\"PT5M\\"}}" --resource-group "testrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute aml-compute'] = """ + type: group + short-summary: machinelearningservices machine-learning-compute sub group aml-compute +""" + +helps['machinelearningservices machine-learning-compute aml-compute create'] = """ + type: command + short-summary: Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverabl\ +e operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. + examples: + - name: Create AKS Compute + text: |- + az machinelearningservices machine-learning-compute aml-compute create --compute-name "compute123" --loc\ +ation "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a AML Compute + text: |- + az machinelearningservices machine-learning-compute aml-compute create --compute-name "compute123" --ide\ +ntity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-00\ +00-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\ +\\":{}}" --location "eastus" --aml-compute-properties "{\\"remoteLoginPortPublicAccess\\":\\"NotSpecified\\",\\"scaleSe\ +ttings\\":{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"},\\"vmPriority\\":\\"\ +Dedicated\\",\\"vmSize\\":\\"STANDARD_NC6\\"}" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a DataFactory Compute + text: |- + az machinelearningservices machine-learning-compute aml-compute create --compute-name "compute123" --loc\ +ation "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AKS Compute + text: |- + az machinelearningservices machine-learning-compute aml-compute create --compute-name "compute123" --loc\ +ation "eastus" --description "some compute" --aml-compute-properties "{\\"agentCount\\":4}" --resource-id "/subscriptio\ +ns/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/c\ +ompute123-56826-c9b00420020b2" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AML Compute + text: |- + az machinelearningservices machine-learning-compute aml-compute create --compute-name "compute123" --ide\ +ntity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-00\ +00-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\ +\\":{}}" --location "eastus" --aml-compute-properties "{\\"scaleSettings\\":{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\ +\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"}}" --resource-group "testrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute data-factory'] = """ + type: group + short-summary: machinelearningservices machine-learning-compute sub group data-factory +""" + +helps['machinelearningservices machine-learning-compute data-factory create'] = """ + type: command + short-summary: Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverabl\ +e operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. + examples: + - name: Create AKS Compute + text: |- + az machinelearningservices machine-learning-compute data-factory create --compute-name "compute123" --lo\ +cation "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a AML Compute + text: |- + az machinelearningservices machine-learning-compute data-factory create --compute-name "compute123" --id\ +entity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-0\ +000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-nam\ +e\\":{}}" --location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a DataFactory Compute + text: |- + az machinelearningservices machine-learning-compute data-factory create --compute-name "compute123" --lo\ +cation "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AKS Compute + text: |- + az machinelearningservices machine-learning-compute data-factory create --compute-name "compute123" --lo\ +cation "eastus" --description "some compute" --resource-id "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourc\ +egroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2" --resource-group\ + "testrg123" --workspace-name "workspaces123" + - name: Update a AML Compute + text: |- + az machinelearningservices machine-learning-compute data-factory create --compute-name "compute123" --id\ +entity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-0\ +000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-nam\ +e\\":{}}" --location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute data-lake-analytics'] = """ + type: group + short-summary: machinelearningservices machine-learning-compute sub group data-lake-analytics +""" + +helps['machinelearningservices machine-learning-compute data-lake-analytics create'] = """ + type: command + short-summary: Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverabl\ +e operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. + examples: + - name: Create AKS Compute + text: |- + az machinelearningservices machine-learning-compute data-lake-analytics create --compute-name "compute12\ +3" --location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a AML Compute + text: |- + az machinelearningservices machine-learning-compute data-lake-analytics create --compute-name "compute12\ +3" --identity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000\ +-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ident\ +ity-name\\":{}}" --location "eastus" --data-lake-analytics-properties remoteLoginPortPublicAccess="NotSpecified" scaleS\ +ettings={"maxNodeCount":1,"minNodeCount":0,"nodeIdleTimeBeforeScaleDown":"PT5M"} vmPriority="Dedicated" vmSize="STANDAR\ +D_NC6" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a DataFactory Compute + text: |- + az machinelearningservices machine-learning-compute data-lake-analytics create --compute-name "compute12\ +3" --location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AKS Compute + text: |- + az machinelearningservices machine-learning-compute data-lake-analytics create --compute-name "compute12\ +3" --location "eastus" --description "some compute" --data-lake-analytics-properties agentCount=4 --resource-id "/subsc\ +riptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClus\ +ters/compute123-56826-c9b00420020b2" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AML Compute + text: |- + az machinelearningservices machine-learning-compute data-lake-analytics create --compute-name "compute12\ +3" --identity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000\ +-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ident\ +ity-name\\":{}}" --location "eastus" --data-lake-analytics-properties scaleSettings={"maxNodeCount":1,"minNodeCount":0,\ +"nodeIdleTimeBeforeScaleDown":"PT5M"} --resource-group "testrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute databricks'] = """ + type: group + short-summary: machinelearningservices machine-learning-compute sub group databricks +""" + +helps['machinelearningservices machine-learning-compute databricks create'] = """ + type: command + short-summary: Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverabl\ +e operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. + examples: + - name: Create AKS Compute + text: |- + az machinelearningservices machine-learning-compute databricks create --compute-name "compute123" --loca\ +tion "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a AML Compute + text: |- + az machinelearningservices machine-learning-compute databricks create --compute-name "compute123" --iden\ +tity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-000\ +0-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\ +\\":{}}" --location "eastus" --databricks-properties remoteLoginPortPublicAccess="NotSpecified" scaleSettings={"maxNode\ +Count":1,"minNodeCount":0,"nodeIdleTimeBeforeScaleDown":"PT5M"} vmPriority="Dedicated" vmSize="STANDARD_NC6" --resource\ +-group "testrg123" --workspace-name "workspaces123" + - name: Create a DataFactory Compute + text: |- + az machinelearningservices machine-learning-compute databricks create --compute-name "compute123" --loca\ +tion "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AKS Compute + text: |- + az machinelearningservices machine-learning-compute databricks create --compute-name "compute123" --loca\ +tion "eastus" --description "some compute" --databricks-properties agentCount=4 --resource-id "/subscriptions/34adfa4f-\ +cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56\ +826-c9b00420020b2" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AML Compute + text: |- + az machinelearningservices machine-learning-compute databricks create --compute-name "compute123" --iden\ +tity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-000\ +0-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\ +\\":{}}" --location "eastus" --databricks-properties scaleSettings={"maxNodeCount":1,"minNodeCount":0,"nodeIdleTimeBefo\ +reScaleDown":"PT5M"} --resource-group "testrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute hd-insight'] = """ + type: group + short-summary: machinelearningservices machine-learning-compute sub group hd-insight +""" + +helps['machinelearningservices machine-learning-compute hd-insight create'] = """ + type: command + short-summary: Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverabl\ +e operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. + examples: + - name: Create AKS Compute + text: |- + az machinelearningservices machine-learning-compute hd-insight create --compute-name "compute123" --loca\ +tion "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a AML Compute + text: |- + az machinelearningservices machine-learning-compute hd-insight create --compute-name "compute123" --iden\ +tity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-000\ +0-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\ +\\":{}}" --location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a DataFactory Compute + text: |- + az machinelearningservices machine-learning-compute hd-insight create --compute-name "compute123" --loca\ +tion "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AKS Compute + text: |- + az machinelearningservices machine-learning-compute hd-insight create --compute-name "compute123" --loca\ +tion "eastus" --description "some compute" --resource-id "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceg\ +roups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2" --resource-group "\ +testrg123" --workspace-name "workspaces123" + - name: Update a AML Compute + text: |- + az machinelearningservices machine-learning-compute hd-insight create --compute-name "compute123" --iden\ +tity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-000\ +0-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\ +\\":{}}" --location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute virtual-machine'] = """ + type: group + short-summary: machinelearningservices machine-learning-compute sub group virtual-machine +""" + +helps['machinelearningservices machine-learning-compute virtual-machine create'] = """ + type: command + short-summary: Creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverabl\ +e operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. + examples: + - name: Create AKS Compute + text: |- + az machinelearningservices machine-learning-compute virtual-machine create --compute-name "compute123" -\ +-location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a AML Compute + text: |- + az machinelearningservices machine-learning-compute virtual-machine create --compute-name "compute123" -\ +-identity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-000\ +0-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-\ +name\\":{}}" --location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Create a DataFactory Compute + text: |- + az machinelearningservices machine-learning-compute virtual-machine create --compute-name "compute123" -\ +-location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" + - name: Update a AKS Compute + text: |- + az machinelearningservices machine-learning-compute virtual-machine create --compute-name "compute123" -\ +-location "eastus" --description "some compute" --resource-id "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/reso\ +urcegroups/testrg123/providers/Microsoft.ContainerService/managedClusters/compute123-56826-c9b00420020b2" --resource-gr\ +oup "testrg123" --workspace-name "workspaces123" + - name: Update a AML Compute + text: |- + az machinelearningservices machine-learning-compute virtual-machine create --compute-name "compute123" -\ +-identity-type "SystemAssigned, UserAssigned" --identity-user-assigned-identities "{\\"/subscriptions/00000000-0000-000\ +0-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-\ +name\\":{}}" --location "eastus" --resource-group "testrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute update'] = """ + type: command + short-summary: Updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecov\ +erable operation. + examples: + - name: Update a AmlCompute Compute + text: |- + az machinelearningservices machine-learning-compute update --compute-name "compute123" --scale-settings \ +max-node-count=4 min-node-count=4 node-idle-time-before-scale-down="PT5M" --resource-group "testrg123" --workspace-name\ + "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute delete'] = """ + type: command + short-summary: Deletes specified Machine Learning compute. + examples: + - name: Delete Compute + text: |- + az machinelearningservices machine-learning-compute delete --compute-name "compute123" --resource-group \ +"testrg123" --underlying-resource-action "Delete" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute list-key'] = """ + type: command + short-summary: Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). + examples: + - name: List AKS Compute Keys + text: |- + az machinelearningservices machine-learning-compute list-key --compute-name "compute123" --resource-grou\ +p "testrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices machine-learning-compute list-node'] = """ + type: command + short-summary: Get the details (e.g IP address, port etc) of all the compute nodes in the compute. + examples: + - name: Get compute nodes information for a compute + text: |- + az machinelearningservices machine-learning-compute list-node --compute-name "compute123" --resource-gro\ +up "testrg123" --workspace-name "workspaces123" +""" + +helps['machinelearningservices '] = """ + type: group + short-summary: machinelearningservices +""" + +helps['machinelearningservices list-sku'] = """ + type: command + short-summary: Lists all skus with associated features + examples: + - name: List Skus + text: |- + az machinelearningservices list-sku +""" + +helps['machinelearningservices private-endpoint-connection'] = """ + type: group + short-summary: machinelearningservices private-endpoint-connection +""" + +helps['machinelearningservices private-endpoint-connection show'] = """ + type: command + short-summary: Gets the specified private endpoint connection associated with the workspace. + examples: + - name: WorkspaceGetPrivateEndpointConnection + text: |- + az machinelearningservices private-endpoint-connection show --private-endpoint-connection-name "{private\ +EndpointConnectionName}" --resource-group "rg-1234" --workspace-name "testworkspace" +""" + +helps['machinelearningservices private-endpoint-connection delete'] = """ + type: command + short-summary: Deletes the specified private endpoint connection associated with the workspace. + examples: + - name: WorkspaceDeletePrivateEndpointConnection + text: |- + az machinelearningservices private-endpoint-connection delete --private-endpoint-connection-name "{priva\ +teEndpointConnectionName}" --resource-group "rg-1234" --workspace-name "testworkspace" +""" + +helps['machinelearningservices private-endpoint-connection put'] = """ + type: command + short-summary: Update the state of specified private endpoint connection associated with the workspace. + examples: + - name: WorkspacePutPrivateEndpointConnection + text: |- + az machinelearningservices private-endpoint-connection put --private-endpoint-connection-name "{privateE\ +ndpointConnectionName}" --private-link-service-connection-state description="Auto-Approved" status="Approved" --resourc\ +e-group "rg-1234" --workspace-name "testworkspace" +""" + +helps['machinelearningservices private-link-resource'] = """ + type: group + short-summary: machinelearningservices private-link-resource +""" + +helps['machinelearningservices private-link-resource list'] = """ + type: command + short-summary: Gets the private link resources that need to be created for a workspace. + examples: + - name: WorkspaceListPrivateLinkResources + text: |- + az machinelearningservices private-link-resource list --resource-group "rg-1234" --workspace-name "testw\ +orkspace" +""" diff --git a/src/machinelearningservices/azext_machinelearningservices/generated/_params.py b/src/machinelearningservices/azext_machinelearningservices/generated/_params.py new file mode 100644 index 0000000000..5bfbcd2037 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/generated/_params.py @@ -0,0 +1,365 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.arguments import CLIArgumentType +from azure.cli.core.commands.parameters import ( + tags_type, + get_three_state_flag, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from azext_machinelearningservices.action import ( + AddSku, + AddSharedPrivateLinkResources, + AddEncryptionKeyVaultProperties, + AddValue, + AddDataLakeAnalyticsProperties, + AddDatabricksProperties, + AddAdministratorAccount, + AddScaleSettings, + AddPrivateEndpoint, + AddPrivateLinkServiceConnectionState +) + + +def load_arguments(self, _): + + with self.argument_context('machinelearningservices workspace list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('skiptoken', help='Continuation token for pagination.') + + with self.argument_context('machinelearningservices workspace show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + + with self.argument_context('machinelearningservices workspace create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssi' + 'gned', 'None']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with resource. The user identity dicti' + 'onary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resour' + 'ceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityNa' + 'me}\'. Expected value: json-string/@json-file.')) + c.argument('description', help='The description of this workspace.') + c.argument('friendly_name', help='The friendly name for this workspace. This name in mutable') + c.argument('key_vault', help='ARM id of the key vault associated with this workspace. This cannot be changed on' + 'ce the workspace has been created') + c.argument('application_insights', help='ARM id of the application insights associated with this workspace. Thi' + 's cannot be changed once the workspace has been created') + c.argument('container_registry', help='ARM id of the container registry associated with this workspace. This ca' + 'nnot be changed once the workspace has been created') + c.argument('storage_account', help='ARM id of the storage account associated with this workspace. This cannot b' + 'e changed once the workspace has been created') + c.argument('discovery_url', help='Url for the discovery service to identify regional endpoints for machine lear' + 'ning experimentation services') + c.argument('hbi_workspace', arg_type=get_three_state_flag(), help='The flag to signal HBI data in the workspace' + ' and reduce diagnostic data collected by the service') + c.argument('image_build_compute', help='The compute name for image build') + c.argument('allow_public_access_when_behind_vnet', arg_type=get_three_state_flag(), help='The flag to indicate ' + 'whether to allow public access when behind VNet.') + c.argument('shared_private_link_resources', action=AddSharedPrivateLinkResources, nargs='+', help='The list of ' + 'shared private link resources in this workspace. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , availa' + 'ble KEYs are: name, private-link-resource-id, group-id, request-message, status.') + c.argument('encryption_status', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Indicates whether or not' + ' the encryption is enabled for the workspace.') + c.argument('encryption_key_vault_properties', action=AddEncryptionKeyVaultProperties, nargs='+', help='Customer' + ' Key vault properties. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: key-vault-ar' + 'm-id, key-identifier, identity-client-id.') + + with self.argument_context('machinelearningservices workspace update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('description', help='The description of this workspace.') + c.argument('friendly_name', help='The friendly name for this workspace.') + + with self.argument_context('machinelearningservices workspace delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + + with self.argument_context('machinelearningservices workspace list-key') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + + with self.argument_context('machinelearningservices workspace resync-key') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + + with self.argument_context('machinelearningservices workspace-feature list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + + with self.argument_context('machinelearningservices usage list') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + + with self.argument_context('machinelearningservices virtual-machine-size list') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + + with self.argument_context('machinelearningservices quota list') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + + with self.argument_context('machinelearningservices quota update') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('value', action=AddValue, nargs='+', help='The list for update quota. Expect value: KEY1=VALUE1 KEY2' + '=VALUE2 ... , available KEYs are: id, type, limit.') + + with self.argument_context('machinelearningservices machine-learning-compute list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('skiptoken', help='Continuation token for pagination.') + + with self.argument_context('machinelearningservices machine-learning-compute show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + + with self.argument_context('machinelearningservices machine-learning-compute aks create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssi' + 'gned', 'None']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with resource. The user identity dicti' + 'onary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resour' + 'ceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityNa' + 'me}\'. Expected value: json-string/@json-file.')) + c.argument('compute_location', help='Location for the underlying compute') + c.argument('description', help='The description of the Machine Learning compute.') + c.argument('resource_id', help='ARM resource id of the underlying compute') + c.argument('aks_properties', arg_type=CLIArgumentType(options_list=['--aks-properties'], help='AKS properties E' + 'xpected value: json-string/@json-file.')) + + with self.argument_context('machinelearningservices machine-learning-compute aml-compute create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssi' + 'gned', 'None']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with resource. The user identity dicti' + 'onary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resour' + 'ceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityNa' + 'me}\'. Expected value: json-string/@json-file.')) + c.argument('compute_location', help='Location for the underlying compute') + c.argument('description', help='The description of the Machine Learning compute.') + c.argument('resource_id', help='ARM resource id of the underlying compute') + c.argument('aml_compute_properties', arg_type=CLIArgumentType(options_list=['--aml-compute-properties'], help= + 'AML Compute properties Expected value: json-string/@json-file.')) + + with self.argument_context('machinelearningservices machine-learning-compute data-factory create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssi' + 'gned', 'None']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with resource. The user identity dicti' + 'onary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resour' + 'ceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityNa' + 'me}\'. Expected value: json-string/@json-file.')) + c.argument('compute_location', help='Location for the underlying compute') + c.argument('description', help='The description of the Machine Learning compute.') + c.argument('resource_id', help='ARM resource id of the underlying compute') + + with self.argument_context('machinelearningservices machine-learning-compute data-lake-analytics create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssi' + 'gned', 'None']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with resource. The user identity dicti' + 'onary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resour' + 'ceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityNa' + 'me}\'. Expected value: json-string/@json-file.')) + c.argument('compute_location', help='Location for the underlying compute') + c.argument('description', help='The description of the Machine Learning compute.') + c.argument('resource_id', help='ARM resource id of the underlying compute') + c.argument('data_lake_analytics_properties', action=AddDataLakeAnalyticsProperties, nargs='+', help=' Expect va' + 'lue: data-lake-store-account-name=xx.') + + with self.argument_context('machinelearningservices machine-learning-compute databricks create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssi' + 'gned', 'None']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with resource. The user identity dicti' + 'onary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resour' + 'ceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityNa' + 'me}\'. Expected value: json-string/@json-file.')) + c.argument('compute_location', help='Location for the underlying compute') + c.argument('description', help='The description of the Machine Learning compute.') + c.argument('resource_id', help='ARM resource id of the underlying compute') + c.argument('databricks_properties', action=AddDatabricksProperties, nargs='+', help=' Expect value: databricks-' + 'access-token=xx.') + + with self.argument_context('machinelearningservices machine-learning-compute hd-insight create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssi' + 'gned', 'None']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with resource. The user identity dicti' + 'onary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resour' + 'ceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityNa' + 'me}\'. Expected value: json-string/@json-file.')) + c.argument('compute_location', help='Location for the underlying compute') + c.argument('description', help='The description of the Machine Learning compute.') + c.argument('resource_id', help='ARM resource id of the underlying compute') + c.argument('ssh_port', help='Port open for ssh connections on the master node of the cluster.') + c.argument('address', help='Public IP address of the master node of the cluster.') + c.argument('administrator_account', action=AddAdministratorAccount, nargs='+', help='Admin credentials for mast' + 'er node of the cluster Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: username, pa' + 'ssword, public-key-data, private-key-data.') + + with self.argument_context('machinelearningservices machine-learning-compute virtual-machine create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssi' + 'gned', 'None']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with resource. The user identity dicti' + 'onary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resour' + 'ceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityNa' + 'me}\'. Expected value: json-string/@json-file.')) + c.argument('compute_location', help='Location for the underlying compute') + c.argument('description', help='The description of the Machine Learning compute.') + c.argument('resource_id', help='ARM resource id of the underlying compute') + c.argument('virtual_machine_size', help='Virtual Machine size') + c.argument('ssh_port', help='Port open for ssh connections.') + c.argument('address', help='Public IP address of the virtual machine.') + c.argument('administrator_account', action=AddAdministratorAccount, nargs='+', help='Admin credentials for virt' + 'ual machine Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: username, password, pub' + 'lic-key-data, private-key-data.') + + with self.argument_context('machinelearningservices machine-learning-compute update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + c.argument('scale_settings', action=AddScaleSettings, nargs='+', help='Desired scale settings for the amlComput' + 'e. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: max-node-count, min-node-count, ' + 'node-idle-time-before-scale-down.') + + with self.argument_context('machinelearningservices machine-learning-compute delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + c.argument('underlying_resource_action', arg_type=get_enum_type(['Delete', 'Detach']), help='Delete the underly' + 'ing compute if \'Delete\', or detach the underlying compute from workspace if \'Detach\'.') + + with self.argument_context('machinelearningservices machine-learning-compute list-key') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + + with self.argument_context('machinelearningservices machine-learning-compute list-node') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('compute_name', help='Name of the Azure Machine Learning compute.') + + with self.argument_context('machinelearningservices list-sku') as c: + pass + + with self.argument_context('machinelearningservices private-endpoint-connection show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('private_endpoint_connection_name', help='The name of the private endpoint connection associated wit' + 'h the workspace') + + with self.argument_context('machinelearningservices private-endpoint-connection delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('private_endpoint_connection_name', help='The name of the private endpoint connection associated wit' + 'h the workspace') + + with self.argument_context('machinelearningservices private-endpoint-connection put') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') + c.argument('private_endpoint_connection_name', help='The name of the private endpoint connection associated wit' + 'h the workspace') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('sku', action=AddSku, nargs='+', help='The sku of the workspace. Expect value: KEY1=VALUE1 KEY2=VALU' + 'E2 ... , available KEYs are: name, tier.') + c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssi' + 'gned', 'None']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigne' + 'd-identities'], help='The list of user identities associated with resource. The user identity dicti' + 'onary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resour' + 'ceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityNa' + 'me}\'. Expected value: json-string/@json-file.')) + c.argument('private_endpoint', action=AddPrivateEndpoint, nargs='+', help='The resource of private end point. E' + 'xpect value: KEY1=VALUE1 KEY2=VALUE2 ...') + c.argument('private_link_service_connection_state', action=AddPrivateLinkServiceConnectionState, nargs='+', + help='A collection of information about the state of the connection between service consumer and pro' + 'vider. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: status, description, actions' + '-required.') + + with self.argument_context('machinelearningservices private-link-resource list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('workspace_name', help='Name of Azure Machine Learning workspace.') diff --git a/src/machinelearningservices/azext_machinelearningservices/generated/_validators.py b/src/machinelearningservices/azext_machinelearningservices/generated/_validators.py new file mode 100644 index 0000000000..7536d0531e --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/generated/_validators.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +def example_name_or_id_validator(cmd, namespace): + from azure.cli.core.commands.client_factory import get_subscription_id + from msrestazure.tools import is_valid_resource_id, resource_id + if namespace.storage_account: + if not is_valid_resource_id(namespace.RESOURCE): + namespace.storage_account = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Storage', + type='storageAccounts', + name=namespace.storage_account + ) diff --git a/src/machinelearningservices/azext_machinelearningservices/generated/action.py b/src/machinelearningservices/azext_machinelearningservices/generated/action.py new file mode 100644 index 0000000000..84baf05b5b --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/generated/action.py @@ -0,0 +1,274 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from knack.util import CLIError +from collections import defaultdict + + +class AddSku(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sku = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + elif kl == 'tier': + d['tier'] = v[0] + return d + + +class AddSharedPrivateLinkResources(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddSharedPrivateLinkResources, self).__call__(parser, namespace, action, option_string) + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + elif kl == 'private-link-resource-id': + d['private_link_resource_id'] = v[0] + elif kl == 'group-id': + d['group_id'] = v[0] + elif kl == 'request-message': + d['request_message'] = v[0] + elif kl == 'status': + d['status'] = v[0] + return d + + +class AddEncryptionKeyVaultProperties(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.encryption_key_vault_properties = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'key-vault-arm-id': + d['key_vault_arm_id'] = v[0] + elif kl == 'key-identifier': + d['key_identifier'] = v[0] + elif kl == 'identity-client-id': + d['identity_client_id'] = v[0] + return d + + +class AddValue(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddValue, self).__call__(parser, namespace, action, option_string) + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'id': + d['id'] = v[0] + elif kl == 'type': + d['type'] = v[0] + elif kl == 'limit': + d['limit'] = v[0] + return d + + +class AddDataLakeAnalyticsProperties(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.data_lake_analytics_properties = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'data-lake-store-account-name': + d['data_lake_store_account_name'] = v[0] + return d + + +class AddDatabricksProperties(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.databricks_properties = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'databricks-access-token': + d['databricks_access_token'] = v[0] + return d + + +class AddAdministratorAccount(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.administrator_account = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'username': + d['username'] = v[0] + elif kl == 'password': + d['password'] = v[0] + elif kl == 'public-key-data': + d['public_key_data'] = v[0] + elif kl == 'private-key-data': + d['private_key_data'] = v[0] + return d + + +class AddScaleSettings(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.scale_settings = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'max-node-count': + d['max_node_count'] = v[0] + elif kl == 'min-node-count': + d['min_node_count'] = v[0] + elif kl == 'node-idle-time-before-scale-down': + d['node_idle_time_before_scale_down'] = v[0] + return d + + +class AddPrivateEndpoint(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.private_endpoint = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + return d + + +class AddPrivateLinkServiceConnectionState(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.private_link_service_connection_state = action + + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'status': + d['status'] = v[0] + elif kl == 'description': + d['description'] = v[0] + elif kl == 'actions-required': + d['actions_required'] = v[0] + return d diff --git a/src/machinelearningservices/azext_machinelearningservices/generated/commands.py b/src/machinelearningservices/azext_machinelearningservices/generated/commands.py new file mode 100644 index 0000000000..f58f20c85c --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/generated/commands.py @@ -0,0 +1,129 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_machinelearningservices.generated._client_factory import cf_workspace + machinelearningservices_workspace = CliCommandType( + operations_tmpl='azext_machinelearningservices.vendored_sdks.machinelearningservices.operations._workspace_oper' + 'ations#WorkspaceOperations.{}', + client_factory=cf_workspace) + with self.command_group('machinelearningservices workspace', machinelearningservices_workspace, + client_factory=cf_workspace, is_experimental=True) as g: + g.custom_command('list', 'machinelearningservices_workspace_list') + g.custom_show_command('show', 'machinelearningservices_workspace_show') + g.custom_command('create', 'machinelearningservices_workspace_create', supports_no_wait=True) + g.custom_command('update', 'machinelearningservices_workspace_update') + g.custom_command('delete', 'machinelearningservices_workspace_delete') + g.custom_command('list-key', 'machinelearningservices_workspace_list_key') + g.custom_command('resync-key', 'machinelearningservices_workspace_resync_key') + g.wait_command('wait') + + from azext_machinelearningservices.generated._client_factory import cf_workspace_feature + machinelearningservices_workspace_feature = CliCommandType( + operations_tmpl='azext_machinelearningservices.vendored_sdks.machinelearningservices.operations._workspace_feat' + 'ure_operations#WorkspaceFeatureOperations.{}', + client_factory=cf_workspace_feature) + with self.command_group('machinelearningservices workspace-feature', machinelearningservices_workspace_feature, + client_factory=cf_workspace_feature, is_experimental=True) as g: + g.custom_command('list', 'machinelearningservices_workspace_feature_list') + + from azext_machinelearningservices.generated._client_factory import cf_usage + machinelearningservices_usage = CliCommandType( + operations_tmpl='azext_machinelearningservices.vendored_sdks.machinelearningservices.operations._usage_operatio' + 'ns#UsageOperations.{}', + client_factory=cf_usage) + with self.command_group('machinelearningservices usage', machinelearningservices_usage, client_factory=cf_usage, + is_experimental=True) as g: + g.custom_command('list', 'machinelearningservices_usage_list') + + from azext_machinelearningservices.generated._client_factory import cf_virtual_machine_size + machinelearningservices_virtual_machine_size = CliCommandType( + operations_tmpl='azext_machinelearningservices.vendored_sdks.machinelearningservices.operations._virtual_machin' + 'e_size_operations#VirtualMachineSizeOperations.{}', + client_factory=cf_virtual_machine_size) + with self.command_group('machinelearningservices virtual-machine-size', + machinelearningservices_virtual_machine_size, client_factory=cf_virtual_machine_size, + is_experimental=True) as g: + g.custom_command('list', 'machinelearningservices_virtual_machine_size_list') + + from azext_machinelearningservices.generated._client_factory import cf_quota + machinelearningservices_quota = CliCommandType( + operations_tmpl='azext_machinelearningservices.vendored_sdks.machinelearningservices.operations._quota_operatio' + 'ns#QuotaOperations.{}', + client_factory=cf_quota) + with self.command_group('machinelearningservices quota', machinelearningservices_quota, client_factory=cf_quota, + is_experimental=True) as g: + g.custom_command('list', 'machinelearningservices_quota_list') + g.custom_command('update', 'machinelearningservices_quota_update') + + from azext_machinelearningservices.generated._client_factory import cf_machine_learning_compute + machinelearningservices_machine_learning_compute = CliCommandType( + operations_tmpl='azext_machinelearningservices.vendored_sdks.machinelearningservices.operations._machine_learni' + 'ng_compute_operations#MachineLearningComputeOperations.{}', + client_factory=cf_machine_learning_compute) + with self.command_group('machinelearningservices machine-learning-compute', + machinelearningservices_machine_learning_compute, + client_factory=cf_machine_learning_compute, is_experimental=True) as g: + g.custom_command('list', 'machinelearningservices_machine_learning_compute_list') + g.custom_show_command('show', 'machinelearningservices_machine_learning_compute_show') + g.custom_command('aks create', 'machinelearningservices_machine_learning_compute_aks_create', + supports_no_wait=True) + g.custom_command('aml-compute create', 'machinelearningservices_machine_learning_compute_aml_compute_create', + supports_no_wait=True) + g.custom_command('data-factory create', 'machinelearningservices_machine_learning_compute_data_factory_create', + supports_no_wait=True) + g.custom_command('data-lake-analytics create', 'machinelearningservices_machine_learning_compute_data_lake_anal' + 'ytics_create', supports_no_wait=True) + g.custom_command('databricks create', 'machinelearningservices_machine_learning_compute_databricks_create', + supports_no_wait=True) + g.custom_command('hd-insight create', 'machinelearningservices_machine_learning_compute_hd_insight_create', + supports_no_wait=True) + g.custom_command('virtual-machine create', 'machinelearningservices_machine_learning_compute_virtual_machine_cr' + 'eate', supports_no_wait=True) + g.custom_command('update', 'machinelearningservices_machine_learning_compute_update', supports_no_wait=True) + g.custom_command('delete', 'machinelearningservices_machine_learning_compute_delete', supports_no_wait=True) + g.custom_command('list-key', 'machinelearningservices_machine_learning_compute_list_key') + g.custom_command('list-node', 'machinelearningservices_machine_learning_compute_list_node') + g.wait_command('wait') + + from azext_machinelearningservices.generated._client_factory import cf_machinelearningservices + machinelearningservices_ = CliCommandType( + operations_tmpl='azext_machinelearningservices.vendored_sdks.machinelearningservices.operations._model_operatio' + 'ns#ModelOperations.{}', + client_factory=cf_machinelearningservices) + with self.command_group('machinelearningservices ', machinelearningservices_, + client_factory=cf_machinelearningservices, is_experimental=True) as g: + g.custom_command('list-sku', 'machinelearningservices__list_sku') + + from azext_machinelearningservices.generated._client_factory import cf_private_endpoint_connection + machinelearningservices_private_endpoint_connection = CliCommandType( + operations_tmpl='azext_machinelearningservices.vendored_sdks.machinelearningservices.operations._private_endpoi' + 'nt_connection_operations#PrivateEndpointConnectionOperations.{}', + client_factory=cf_private_endpoint_connection) + with self.command_group('machinelearningservices private-endpoint-connection', + machinelearningservices_private_endpoint_connection, + client_factory=cf_private_endpoint_connection, is_experimental=True) as g: + g.custom_show_command('show', 'machinelearningservices_private_endpoint_connection_show') + g.custom_command('delete', 'machinelearningservices_private_endpoint_connection_delete') + g.custom_command('put', 'machinelearningservices_private_endpoint_connection_put') + + from azext_machinelearningservices.generated._client_factory import cf_private_link_resource + machinelearningservices_private_link_resource = CliCommandType( + operations_tmpl='azext_machinelearningservices.vendored_sdks.machinelearningservices.operations._private_link_r' + 'esource_operations#PrivateLinkResourceOperations.{}', + client_factory=cf_private_link_resource) + with self.command_group('machinelearningservices private-link-resource', + machinelearningservices_private_link_resource, client_factory=cf_private_link_resource, + is_experimental=True) as g: + g.custom_command('list', 'machinelearningservices_private_link_resource_list') diff --git a/src/machinelearningservices/azext_machinelearningservices/generated/custom.py b/src/machinelearningservices/azext_machinelearningservices/generated/custom.py new file mode 100644 index 0000000000..f2dd874628 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/generated/custom.py @@ -0,0 +1,486 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +import json + + +def machinelearningservices_workspace_list(cmd, client, + resource_group_name=None, + skiptoken=None): + if resource_group_name is not None: + return client.list_by_resource_group(resource_group_name=resource_group_name, + skiptoken=skiptoken) + return client.list_by_subscription(skiptoken=skiptoken) + + +def machinelearningservices_workspace_show(cmd, client, + resource_group_name, + workspace_name): + return client.get(resource_group_name=resource_group_name, + workspace_name=workspace_name) + + +def machinelearningservices_workspace_create(cmd, client, + resource_group_name, + workspace_name, + location=None, + tags=None, + sku=None, + identity_type=None, + identity_user_assigned_identities=None, + description=None, + friendly_name=None, + key_vault=None, + application_insights=None, + container_registry=None, + storage_account=None, + discovery_url=None, + hbi_workspace=None, + image_build_compute=None, + allow_public_access_when_behind_vnet=None, + shared_private_link_resources=None, + encryption_status=None, + encryption_key_vault_properties=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + return client.begin_create_or_update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + location=location, + tags=tags, + sku=sku, + type=identity_type, + user_assigned_identities=identity_user_assigned_identities, + description=description, + friendly_name=friendly_name, + key_vault=key_vault, + application_insights=application_insights, + container_registry=container_registry, + storage_account=storage_account, + discovery_url=discovery_url, + hbi_workspace=hbi_workspace, + image_build_compute=image_build_compute, + allow_public_access_when_behind_vnet=allow_public_access_when_behind_vnet, + shared_private_link_resources=shared_private_link_resources, + status=encryption_status, + key_vault_properties=encryption_key_vault_properties) + + +def machinelearningservices_workspace_update(cmd, client, + resource_group_name, + workspace_name, + tags=None, + sku=None, + description=None, + friendly_name=None): + return client.update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + tags=tags, + sku=sku, + description=description, + friendly_name=friendly_name) + + +def machinelearningservices_workspace_delete(cmd, client, + resource_group_name, + workspace_name): + return client.delete(resource_group_name=resource_group_name, + workspace_name=workspace_name) + + +def machinelearningservices_workspace_list_key(cmd, client, + resource_group_name, + workspace_name): + return client.list_key(resource_group_name=resource_group_name, + workspace_name=workspace_name) + + +def machinelearningservices_workspace_resync_key(cmd, client, + resource_group_name, + workspace_name): + return client.resync_key(resource_group_name=resource_group_name, + workspace_name=workspace_name) + + +def machinelearningservices_workspace_feature_list(cmd, client, + resource_group_name, + workspace_name): + return client.list(resource_group_name=resource_group_name, + workspace_name=workspace_name) + + +def machinelearningservices_usage_list(cmd, client, + location): + return client.list(location=location) + + +def machinelearningservices_virtual_machine_size_list(cmd, client, + location): + return client.list(location=location) + + +def machinelearningservices_quota_list(cmd, client, + location): + return client.list(location=location) + + +def machinelearningservices_quota_update(cmd, client, + location, + value=None): + return client.update(location=location, + value=value) + + +def machinelearningservices_machine_learning_compute_list(cmd, client, + resource_group_name, + workspace_name, + skiptoken=None): + return client.list_by_workspace(resource_group_name=resource_group_name, + workspace_name=workspace_name, + skiptoken=skiptoken) + + +def machinelearningservices_machine_learning_compute_show(cmd, client, + resource_group_name, + workspace_name, + compute_name): + return client.get(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name) + + +def machinelearningservices_machine_learning_compute_aks_create(cmd, client, + resource_group_name, + workspace_name, + compute_name, + location=None, + tags=None, + sku=None, + identity_type=None, + identity_user_assigned_identities=None, + compute_location=None, + description=None, + resource_id=None, + aks_properties=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + if isinstance(aks_properties, str): + aks_properties = json.loads(aks_properties) + properties = {} + properties['compute_type'] = 'Aks' + properties['compute_location'] = compute_location + properties['description'] = description + properties['resource_id'] = resource_id + properties['properties'] = aks_properties + return client.begin_create_or_update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + location=location, + tags=tags, + sku=sku, + type=type_identity_type, + user_assigned_identities=user_assigned_identities, + properties=properties) + + +def machinelearningservices_machine_learning_compute_aml_compute_create(cmd, client, + resource_group_name, + workspace_name, + compute_name, + location=None, + tags=None, + sku=None, + identity_type=None, + identity_user_assigned_identities=None, + compute_location=None, + description=None, + resource_id=None, + aml_compute_properties=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + if isinstance(aml_compute_properties, str): + aml_compute_properties = json.loads(aml_compute_properties) + properties = {} + properties['compute_type'] = 'AmlCompute' + properties['compute_location'] = compute_location + properties['description'] = description + properties['resource_id'] = resource_id + properties['properties'] = aml_compute_properties + return client.begin_create_or_update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + location=location, + tags=tags, + sku=sku, + type=type_identity_type, + user_assigned_identities=user_assigned_identities, + properties=properties) + + +def machinelearningservices_machine_learning_compute_data_factory_create(cmd, client, + resource_group_name, + workspace_name, + compute_name, + location=None, + tags=None, + sku=None, + identity_type=None, + identity_user_assigned_identities=None, + compute_location=None, + description=None, + resource_id=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + properties = {} + properties['compute_type'] = 'DataFactory' + properties['compute_location'] = compute_location + properties['description'] = description + properties['resource_id'] = resource_id + return client.begin_create_or_update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + location=location, + tags=tags, + sku=sku, + type=type_identity_type, + user_assigned_identities=user_assigned_identities, + properties=properties) + + +def machinelearningservices_machine_learning_compute_data_lake_analytics_create(cmd, client, + resource_group_name, + workspace_name, + compute_name, + location=None, + tags=None, + sku=None, + identity_type=None, + identity_user_assigned_identities=None, + compute_location=None, + description=None, + resource_id=None, + data_lake_analytics_properties=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + properties = {} + properties['compute_type'] = 'DataLakeAnalytics' + properties['compute_location'] = compute_location + properties['description'] = description + properties['resource_id'] = resource_id + properties['properties'] = data_lake_analytics_properties + return client.begin_create_or_update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + location=location, + tags=tags, + sku=sku, + type=type_identity_type, + user_assigned_identities=user_assigned_identities, + properties=properties) + + +def machinelearningservices_machine_learning_compute_databricks_create(cmd, client, + resource_group_name, + workspace_name, + compute_name, + location=None, + tags=None, + sku=None, + identity_type=None, + identity_user_assigned_identities=None, + compute_location=None, + description=None, + resource_id=None, + databricks_properties=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + properties = {} + properties['compute_type'] = 'Databricks' + properties['compute_location'] = compute_location + properties['description'] = description + properties['resource_id'] = resource_id + properties['properties'] = databricks_properties + return client.begin_create_or_update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + location=location, + tags=tags, + sku=sku, + type=type_identity_type, + user_assigned_identities=user_assigned_identities, + properties=properties) + + +def machinelearningservices_machine_learning_compute_hd_insight_create(cmd, client, + resource_group_name, + workspace_name, + compute_name, + location=None, + tags=None, + sku=None, + identity_type=None, + identity_user_assigned_identities=None, + compute_location=None, + description=None, + resource_id=None, + ssh_port=None, + address=None, + administrator_account=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + properties = {} + properties['compute_type'] = 'HdInsight' + properties['compute_location'] = compute_location + properties['description'] = description + properties['resource_id'] = resource_id + properties['ssh_port'] = ssh_port + properties['address'] = address + properties['administrator_account'] = administrator_account + return client.begin_create_or_update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + location=location, + tags=tags, + sku=sku, + type=type_identity_type, + user_assigned_identities=user_assigned_identities, + properties=properties) + + +def machinelearningservices_machine_learning_compute_virtual_machine_create(cmd, client, + resource_group_name, + workspace_name, + compute_name, + location=None, + tags=None, + sku=None, + identity_type=None, + identity_user_assigned_identities=None, + compute_location=None, + description=None, + resource_id=None, + virtual_machine_size=None, + ssh_port=None, + address=None, + administrator_account=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + properties = {} + properties['compute_type'] = 'VirtualMachine' + properties['compute_location'] = compute_location + properties['description'] = description + properties['resource_id'] = resource_id + properties['virtual_machine_size'] = virtual_machine_size + properties['ssh_port'] = ssh_port + properties['address'] = address + properties['administrator_account'] = administrator_account + return client.begin_create_or_update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + location=location, + tags=tags, + sku=sku, + type=type_identity_type, + user_assigned_identities=user_assigned_identities, + properties=properties) + + +def machinelearningservices_machine_learning_compute_update(cmd, client, + resource_group_name, + workspace_name, + compute_name, + scale_settings=None): + return client.begin_update(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + scale_settings=scale_settings) + + +def machinelearningservices_machine_learning_compute_delete(cmd, client, + resource_group_name, + workspace_name, + compute_name, + underlying_resource_action): + return client.begin_delete(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + underlying_resource_action=underlying_resource_action) + + +def machinelearningservices_machine_learning_compute_list_key(cmd, client, + resource_group_name, + workspace_name, + compute_name): + return client.list_key(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name) + + +def machinelearningservices_machine_learning_compute_list_node(cmd, client, + resource_group_name, + workspace_name, + compute_name): + return client.list_node(resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name) + + +def machinelearningservices__list_sku(cmd, client): + return client.list_sku() + + +def machinelearningservices_private_endpoint_connection_show(cmd, client, + resource_group_name, + workspace_name, + private_endpoint_connection_name): + return client.get(resource_group_name=resource_group_name, + workspace_name=workspace_name, + private_endpoint_connection_name=private_endpoint_connection_name) + + +def machinelearningservices_private_endpoint_connection_delete(cmd, client, + resource_group_name, + workspace_name, + private_endpoint_connection_name): + return client.delete(resource_group_name=resource_group_name, + workspace_name=workspace_name, + private_endpoint_connection_name=private_endpoint_connection_name) + + +def machinelearningservices_private_endpoint_connection_put(cmd, client, + resource_group_name, + workspace_name, + private_endpoint_connection_name, + location=None, + tags=None, + sku=None, + identity_type=None, + identity_user_assigned_identities=None, + private_endpoint=None, + private_link_service_connection_state=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + return client.put(resource_group_name=resource_group_name, + workspace_name=workspace_name, + private_endpoint_connection_name=private_endpoint_connection_name, + location=location, + tags=tags, + sku=sku, + type=identity_type, + user_assigned_identities=identity_user_assigned_identities, + private_endpoint=private_endpoint, + private_link_service_connection_state=private_link_service_connection_state) + + +def machinelearningservices_private_link_resource_list(cmd, client, + resource_group_name, + workspace_name): + return client.list_by_workspace(resource_group_name=resource_group_name, + workspace_name=workspace_name) diff --git a/src/machinelearningservices/azext_machinelearningservices/manual/__init__.py b/src/machinelearningservices/azext_machinelearningservices/manual/__init__.py new file mode 100644 index 0000000000..ee0c4f36bd --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/manual/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/machinelearningservices/azext_machinelearningservices/tests/__init__.py b/src/machinelearningservices/azext_machinelearningservices/tests/__init__.py new file mode 100644 index 0000000000..fe1bd438b4 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/tests/__init__.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +import inspect +import os + + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + print("running {}()...".format(func.__name__)) + return func_to_call(*args, **kwargs) + + if inspect.isclass(func): + return get_func_to_call() + else: + return wrapper diff --git a/src/machinelearningservices/azext_machinelearningservices/tests/latest/__init__.py b/src/machinelearningservices/azext_machinelearningservices/tests/latest/__init__.py new file mode 100644 index 0000000000..ee0c4f36bd --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/machinelearningservices/azext_machinelearningservices/tests/latest/preparers.py b/src/machinelearningservices/azext_machinelearningservices/tests/latest/preparers.py new file mode 100644 index 0000000000..3d6672de64 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/tests/latest/preparers.py @@ -0,0 +1,116 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +from datetime import datetime +from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer +from azure_devtools.scenario_tests import SingleValueReplacer +from azure.cli.testsdk.exceptions import CliTestError +from azure.cli.testsdk.reverse_dependency import get_dummy_cli + + +KEY_RESOURCE_GROUP = 'rg' +KEY_VIRTUAL_NETWORK = 'vnet' +KEY_VNET_SUBNET = 'subnet' + + +class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='virtual_network', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + dev_setting_name='AZURE_CLI_TEST_DEV_VIRTUAL_NETWORK_NAME', + random_name_length=24, key=KEY_VIRTUAL_NETWORK): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VirtualNetworkPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + + tags = {'product': 'azurecli', 'cause': 'automation', + 'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')} + if 'ENV_JOB_NAME' in os.environ: + tags['job'] = os.environ['ENV_JOB_NAME'] + tags = ' '.join(['{}={}'.format(key, value) + for key, value in tags.items()]) + template = 'az network vnet create --resource-group {} --name {} --tag ' + tags + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group_name, name)) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + # delete vnet if test is being recorded and if the vnet is not a dev rg + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, 'az network vnet delete --name {} --resource-group {}'.format(name, self.resource_group_name)) + + +class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='subnet', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + vnet_name=None, + vnet_key=KEY_VIRTUAL_NETWORK, + address_prefixes="11.0.0.0/24", + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_SUBNET_NAME', + random_name_length=24, key=KEY_VNET_SUBNET): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VnetSubnetPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.vnet_name = vnet_name + self.vnet_key = vnet_key + self.address_prefixes = address_prefixes + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + if not self.vnet_name: + self.vnet_name = self.test_class_instance.kwargs.get(self.vnet_key) + if not self.vnet_name: + raise CliTestError("Error: No vnet configured!") + + self.test_class_instance.kwargs[self.key] = 'default' + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + pass diff --git a/src/machinelearningservices/azext_machinelearningservices/tests/latest/test_machinelearningservices_scenario.py b/src/machinelearningservices/azext_machinelearningservices/tests/latest/test_machinelearningservices_scenario.py new file mode 100644 index 0000000000..5993e70cb2 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/tests/latest/test_machinelearningservices_scenario.py @@ -0,0 +1,891 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import ScenarioTest +from .. import try_manual +from azure.cli.testsdk import ResourceGroupPreparer +from azure.cli.testsdk import StorageAccountPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@try_manual +def setup(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + pass + + +# EXAMPLE: /Workspaces/put/Create Workspace +@try_manual +def step__workspaces_put_create_workspace(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices workspace create ' + '--location "eastus2euap" ' + '--description "test description" ' + '--application-insights "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/microsoft.insights' + '/components/testinsights" ' + '--container-registry "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.ContainerR' + 'egistry/registries/testRegistry" ' + '--encryption-key-vault-properties identity-client-id="" key-identifier="https://testkv.vault.azure.net/ke' + 'ys/testkey/aabbccddee112233445566778899aabb" key-vault-arm-id="/subscriptions/{subscription_id}/resourceG' + 'roups/{rg}/providers/Microsoft.KeyVault/vaults/testkv" ' + '--encryption-status "Enabled" ' + '--friendly-name "HelloName" ' + '--hbi-workspace false ' + '--key-vault "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/tes' + 'tkv" ' + '--shared-private-link-resources name="testdbresource" private-link-resource-id="/subscriptions/{subscript' + 'ion_id}/resourceGroups/{rg}/providers/Microsoft.DocumentDB/databaseAccounts/testdbresource/privateLinkRes' + 'ources/{Sql}" group-id="Sql" request-message="Please approve" status="Approved" ' + '--storage-account "/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Storage/sto' + 'rageAccounts/{sa}" ' + '--sku name="Basic" tier="Basic" ' + '--resource-group "{rg}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + test.cmd('az machinelearningservices workspace wait --created ' + '--resource-group "{rg}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + + +# EXAMPLE: /Workspaces/get/Get Workspace +@try_manual +def step__workspaces_get_get_workspace(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices workspace show ' + '--resource-group "{rg}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + + +# EXAMPLE: /Workspaces/get/Get Workspaces by Resource Group +@try_manual +def step__workspaces_get_get_workspaces_by_resource_group(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices workspace list ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: /Workspaces/get/Get Workspaces by subscription +@try_manual +def step__workspaces_get_get_workspaces_by_subscription(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices workspace list', + checks=[]) + + +# EXAMPLE: /Workspaces/post/List Workspace Keys +@try_manual +def step__workspaces_post_list_workspace_keys(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices workspace list-key ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /Workspaces/post/Resync Workspace Keys +@try_manual +def step__workspaces_post_resync_workspace_keys(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices workspace resync-key ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /Workspaces/patch/Update Workspace +@try_manual +def step__workspaces_patch_update_workspace(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices workspace update ' + '--description "new description" ' + '--friendly-name "New friendly name" ' + '--sku name="Enterprise" tier="Enterprise" ' + '--resource-group "{rg}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create AKS Compute +@try_manual +def step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create AKS Compute +@try_manual +def step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create AKS Compute +@try_manual +def step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create AKS Compute +@try_manual +def step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create AKS Compute +@try_manual +def step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create AKS Compute +@try_manual +def step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create AKS Compute +@try_manual +def step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a AML Compute +@try_manual +def step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"remoteLoginPortPublicAccess\\":\\"NotSpecified\\",\\"scaleSettings\\":{{\\"maxNode' + 'Count\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"}},\\"vmPriority\\":\\"Dedica' + 'ted\\",\\"vmSize\\":\\"STANDARD_NC6\\"}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a AML Compute +@try_manual +def step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"remoteLoginPortPublicAccess\\":\\"NotSpecified\\",\\"scaleSettings\\":{{\\"maxNode' + 'Count\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"}},\\"vmPriority\\":\\"Dedica' + 'ted\\",\\"vmSize\\":\\"STANDARD_NC6\\"}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a AML Compute +@try_manual +def step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"remoteLoginPortPublicAccess\\":\\"NotSpecified\\",\\"scaleSettings\\":{{\\"maxNode' + 'Count\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"}},\\"vmPriority\\":\\"Dedica' + 'ted\\",\\"vmSize\\":\\"STANDARD_NC6\\"}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a AML Compute +@try_manual +def step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"remoteLoginPortPublicAccess\\":\\"NotSpecified\\",\\"scaleSettings\\":{{\\"maxNode' + 'Count\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"}},\\"vmPriority\\":\\"Dedica' + 'ted\\",\\"vmSize\\":\\"STANDARD_NC6\\"}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a AML Compute +@try_manual +def step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"remoteLoginPortPublicAccess\\":\\"NotSpecified\\",\\"scaleSettings\\":{{\\"maxNode' + 'Count\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"}},\\"vmPriority\\":\\"Dedica' + 'ted\\",\\"vmSize\\":\\"STANDARD_NC6\\"}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a AML Compute +@try_manual +def step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"remoteLoginPortPublicAccess\\":\\"NotSpecified\\",\\"scaleSettings\\":{{\\"maxNode' + 'Count\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"}},\\"vmPriority\\":\\"Dedica' + 'ted\\",\\"vmSize\\":\\"STANDARD_NC6\\"}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a AML Compute +@try_manual +def step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"remoteLoginPortPublicAccess\\":\\"NotSpecified\\",\\"scaleSettings\\":{{\\"maxNode' + 'Count\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBeforeScaleDown\\":\\"PT5M\\"}},\\"vmPriority\\":\\"Dedica' + 'ted\\",\\"vmSize\\":\\"STANDARD_NC6\\"}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a DataFactory Compute +@try_manual +def step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a DataFactory Compute +@try_manual +def step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a DataFactory Compute +@try_manual +def step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a DataFactory Compute +@try_manual +def step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a DataFactory Compute +@try_manual +def step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a DataFactory Compute +@try_manual +def step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Create a DataFactory Compute +@try_manual +def step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AKS Compute +@try_manual +def step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--description "some compute" ' + '--aks-properties "{{\\"agentCount\\":4}}" ' + '--resource-id "/subscriptions/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.ContainerServic' + 'e/managedClusters/compute123-56826-c9b00420020b2" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AKS Compute +@try_manual +def step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--description "some compute" ' + '--aks-properties "{{\\"agentCount\\":4}}" ' + '--resource-id "/subscriptions/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.ContainerServic' + 'e/managedClusters/compute123-56826-c9b00420020b2" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AKS Compute +@try_manual +def step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--description "some compute" ' + '--aks-properties "{{\\"agentCount\\":4}}" ' + '--resource-id "/subscriptions/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.ContainerServic' + 'e/managedClusters/compute123-56826-c9b00420020b2" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AKS Compute +@try_manual +def step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--description "some compute" ' + '--aks-properties "{{\\"agentCount\\":4}}" ' + '--resource-id "/subscriptions/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.ContainerServic' + 'e/managedClusters/compute123-56826-c9b00420020b2" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AKS Compute +@try_manual +def step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--description "some compute" ' + '--aks-properties "{{\\"agentCount\\":4}}" ' + '--resource-id "/subscriptions/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.ContainerServic' + 'e/managedClusters/compute123-56826-c9b00420020b2" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AKS Compute +@try_manual +def step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--description "some compute" ' + '--aks-properties "{{\\"agentCount\\":4}}" ' + '--resource-id "/subscriptions/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.ContainerServic' + 'e/managedClusters/compute123-56826-c9b00420020b2" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AKS Compute +@try_manual +def step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--location "eastus" ' + '--description "some compute" ' + '--aks-properties "{{\\"agentCount\\":4}}" ' + '--resource-id "/subscriptions/{subscription_id}/resourcegroups/{rg_4}/providers/Microsoft.ContainerServic' + 'e/managedClusters/compute123-56826-c9b00420020b2" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AML Compute +@try_manual +def step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"scaleSettings\\":{{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBefore' + 'ScaleDown\\":\\"PT5M\\"}}}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AML Compute +@try_manual +def step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"scaleSettings\\":{{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBefore' + 'ScaleDown\\":\\"PT5M\\"}}}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AML Compute +@try_manual +def step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"scaleSettings\\":{{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBefore' + 'ScaleDown\\":\\"PT5M\\"}}}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AML Compute +@try_manual +def step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"scaleSettings\\":{{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBefore' + 'ScaleDown\\":\\"PT5M\\"}}}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AML Compute +@try_manual +def step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"scaleSettings\\":{{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBefore' + 'ScaleDown\\":\\"PT5M\\"}}}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AML Compute +@try_manual +def step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"scaleSettings\\":{{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBefore' + 'ScaleDown\\":\\"PT5M\\"}}}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/put/Update a AML Compute +@try_manual +def step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute aks create ' + '--compute-name "compute123" ' + '--identity-type "SystemAssigned, UserAssigned" ' + '--identity-user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGro' + 'ups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name\\":{{}}}}" ' + '--location "eastus" ' + '--aks-properties "{{\\"scaleSettings\\":{{\\"maxNodeCount\\":1,\\"minNodeCount\\":0,\\"nodeIdleTimeBefore' + 'ScaleDown\\":\\"PT5M\\"}}}}" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/get/Get Computes +@try_manual +def step__machinelearningcompute_get_get_computes(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute list ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/get/Get a AKS Compute +@try_manual +def step__machinelearningcompute_get_get_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute show ' + '--compute-name "compute123" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/get/Get a AML Compute +@try_manual +def step__machinelearningcompute_get_get_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute show ' + '--compute-name "compute123" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/post/Get compute nodes information for a compute +@try_manual +def step__machinelearningcompute_post_get_compute_nodes_information_for_a_compute(test, rg, rg_2, rg_3, rg_4, rg_5, + rg_6): + test.cmd('az machinelearningservices machine-learning-compute list-node ' + '--compute-name "compute123" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/post/List AKS Compute Keys +@try_manual +def step__machinelearningcompute_post_list_aks_compute_keys(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute list-key ' + '--compute-name "compute123" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/patch/Update a AmlCompute Compute +@try_manual +def step__machinelearningcompute_patch_update_a_amlcompute_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute update ' + '--compute-name "compute123" ' + '--scale-settings max-node-count=4 min-node-count=4 node-idle-time-before-scale-down="PT5M" ' + '--resource-group "{rg_4}" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /PrivateEndpointConnections/put/WorkspacePutPrivateEndpointConnection +@try_manual +def step__privateendpointconnections_put_workspaceputprivateendpointconnection(test, rg, rg_2, rg_3, rg_4, rg_5, + rg_6): + test.cmd('az machinelearningservices private-endpoint-connection put ' + '--private-endpoint-connection-name "{{privateEndpointConnectionName}}" ' + '--private-link-service-connection-state description="Auto-Approved" status="Approved" ' + '--resource-group "{rg_5}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + + +# EXAMPLE: /PrivateEndpointConnections/get/WorkspaceGetPrivateEndpointConnection +@try_manual +def step__privateendpointconnections_get_workspacegetprivateendpointconnection(test, rg, rg_2, rg_3, rg_4, rg_5, + rg_6): + test.cmd('az machinelearningservices private-endpoint-connection show ' + '--private-endpoint-connection-name "{{privateEndpointConnectionName}}" ' + '--resource-group "{rg_5}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + + +# EXAMPLE: /Quotas/get/List workspace quotas by VMFamily +@try_manual +def step__quotas_get_list_workspace_quotas_by_vmfamily(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices quota list ' + '--location "eastus"', + checks=[]) + + +# EXAMPLE: /PrivateLinkResources/get/WorkspaceListPrivateLinkResources +@try_manual +def step__privatelinkresources_get_workspacelistprivatelinkresources(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices private-link-resource list ' + '--resource-group "{rg_5}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + + +# EXAMPLE: /Quotas/post/update quotas +@try_manual +def step__quotas_post_update_quotas(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices quota update ' + '--location "eastus" ' + '--value type="Microsoft.MachineLearningServices/workspaces/dedicatedCores/quotas" id="/subscriptions/{sub' + 'scription_id}/resourceGroups/{rg_3}/providers/Microsoft.MachineLearningServices/workspaces/{demo_workspac' + 'e1}/quotas/{StandardDSv2Family}" limit=100 unit="Count" ' + '--value type="Microsoft.MachineLearningServices/workspaces/dedicatedCores/quotas" id="/subscriptions/{sub' + 'scription_id}/resourceGroups/{rg_3}/providers/Microsoft.MachineLearningServices/workspaces/{Workspaces_2}' + '/quotas/{StandardDSv2Family}" limit=200 unit="Count"', + checks=[]) + + +# EXAMPLE: /WorkspaceFeatures/get/List Workspace features +@try_manual +def step__workspacefeatures_get_list_workspace_features(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices workspace-feature list ' + '--resource-group "{rg_6}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + + +# EXAMPLE: /Usages/get/List Usages +@try_manual +def step__usages_get_list_usages(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices usage list ' + '--location "eastus"', + checks=[]) + + +# EXAMPLE: /VirtualMachineSizes/get/List VM Sizes +@try_manual +def step__virtualmachinesizes_get_list_vm_sizes(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices virtual-machine-size list ' + '--location "eastus"', + checks=[]) + + +# EXAMPLE: /MachineLearningCompute/delete/Delete Compute +@try_manual +def step__machinelearningcompute_delete_delete_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices machine-learning-compute delete ' + '--compute-name "compute123" ' + '--resource-group "{rg_4}" ' + '--underlying-resource-action "Delete" ' + '--workspace-name "{Workspaces_4}"', + checks=[]) + + +# EXAMPLE: /machinelearningservices /get/List Skus +@try_manual +def step__machinelearningservices__get_list_skus(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices list-sku', + checks=[]) + + +# EXAMPLE: /PrivateEndpointConnections/delete/WorkspaceDeletePrivateEndpointConnection +@try_manual +def step__privateendpointconnections_delete_workspacedeleteprivateendpointconnection(test, rg, rg_2, rg_3, rg_4, rg_5, + rg_6): + test.cmd('az machinelearningservices private-endpoint-connection delete ' + '--private-endpoint-connection-name "{{privateEndpointConnectionName}}" ' + '--resource-group "{rg_5}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + + +# EXAMPLE: /Workspaces/delete/Delete Workspace +@try_manual +def step__workspaces_delete_delete_workspace(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + test.cmd('az machinelearningservices workspace delete ' + '--resource-group "{rg}" ' + '--workspace-name "{Workspaces_3}"', + checks=[]) + + +@try_manual +def cleanup(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + pass + + +@try_manual +def call_scenario(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + setup(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__workspaces_put_create_workspace(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__workspaces_get_get_workspace(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__workspaces_get_get_workspaces_by_resource_group(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__workspaces_get_get_workspaces_by_subscription(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__workspaces_post_list_workspace_keys(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__workspaces_post_resync_workspace_keys(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__workspaces_patch_update_workspace(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_create_a_datafactory_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_put_update_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_get_get_computes(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_get_get_a_aks_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_get_get_a_aml_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_post_get_compute_nodes_information_for_a_compute(test, rg, rg_2, rg_3, rg_4, rg_5, + rg_6) + step__machinelearningcompute_post_list_aks_compute_keys(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_patch_update_a_amlcompute_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__privateendpointconnections_put_workspaceputprivateendpointconnection(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__privateendpointconnections_get_workspacegetprivateendpointconnection(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__quotas_get_list_workspace_quotas_by_vmfamily(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__privatelinkresources_get_workspacelistprivatelinkresources(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__quotas_post_update_quotas(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__workspacefeatures_get_list_workspace_features(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__usages_get_list_usages(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__virtualmachinesizes_get_list_vm_sizes(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningcompute_delete_delete_compute(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__machinelearningservices__get_list_skus(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + step__privateendpointconnections_delete_workspacedeleteprivateendpointconnection(test, rg, rg_2, rg_3, rg_4, rg_5, + rg_6) + step__workspaces_delete_delete_workspace(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + cleanup(test, rg, rg_2, rg_3, rg_4, rg_5, rg_6) + + +@try_manual +class AzureMachineLearningWorkspacesScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestmachinelearningservices_workspace-1234'[:7], key='rg', parameter_name='r' + 'g') + @ResourceGroupPreparer(name_prefix='clitestmachinelearningservices_accountcrud-1234'[:7], key='rg_2', + parameter_name='rg_2') + @ResourceGroupPreparer(name_prefix='clitestmachinelearningservices_rg'[:7], key='rg_3', parameter_name='rg_3') + @ResourceGroupPreparer(name_prefix='clitestmachinelearningservices_testrg123'[:7], key='rg_4', parameter_name='rg_4' + '') + @ResourceGroupPreparer(name_prefix='clitestmachinelearningservices_rg-1234'[:7], key='rg_5', + parameter_name='rg_5') + @ResourceGroupPreparer(name_prefix='clitestmachinelearningservices_myResourceGroup'[:7], key='rg_6', + parameter_name='rg_6') + @StorageAccountPreparer(name_prefix='clitestmachinelearningservices_testStorageAccount'[:7], key='sa', + resource_group_parameter_name='rg_2') + def test_machinelearningservices(self, rg, rg_2, rg_3, rg_4, rg_5, rg_6): + + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'Workspaces_5': 'Workspaces_5', + 'PrivateLinkResources_2': 'PrivateLinkResources_2', + 'demo_workspace1': 'demo_workspace1', + 'Workspaces_2': 'Workspaces_2', + 'Workspaces_3': 'Workspaces_3', + 'Workspaces_4': 'Workspaces_4', + 'StandardDSv2Family': 'StandardDSv2Family', + '{privateEndpointConnectionName}': '{privateEndpointConnectionName}', + 'Sql': 'Sql', + }) + + call_scenario(self, rg, rg_2, rg_3, rg_4, rg_5, rg_6) diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/__init__.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/__init__.py new file mode 100644 index 0000000000..ee0c4f36bd --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/__init__.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/__init__.py new file mode 100644 index 0000000000..6fc5b093b3 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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'] + +try: + from .patch import patch_sdk + patch_sdk() +except ImportError: + pass diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/_azure_machine_learning_workspaces.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/_azure_machine_learning_workspaces.py new file mode 100644 index 0000000000..8f401d262e --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/_azure_machine_learning_workspaces.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + +from ._configuration import AzureMachineLearningWorkspacesConfiguration +from .operations import OperationOperations +from .operations import WorkspaceOperations +from .operations import WorkspaceFeatureOperations +from .operations import UsageOperations +from .operations import VirtualMachineSizeOperations +from .operations import QuotaOperations +from .operations import MachineLearningComputeOperations +from .operations import AzureMachineLearningWorkspacesOperationsMixin +from .operations import PrivateEndpointConnectionOperations +from .operations import PrivateLinkResourceOperations +from . import models + + +class AzureMachineLearningWorkspaces(AzureMachineLearningWorkspacesOperationsMixin): + """These APIs allow end users to operate on Azure Machine Learning Workspace resources. + + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.machinelearningservices.operations.OperationOperations + :ivar workspace: WorkspaceOperations operations + :vartype workspace: azure.mgmt.machinelearningservices.operations.WorkspaceOperations + :ivar workspace_feature: WorkspaceFeatureOperations operations + :vartype workspace_feature: azure.mgmt.machinelearningservices.operations.WorkspaceFeatureOperations + :ivar usage: UsageOperations operations + :vartype usage: azure.mgmt.machinelearningservices.operations.UsageOperations + :ivar virtual_machine_size: VirtualMachineSizeOperations operations + :vartype virtual_machine_size: azure.mgmt.machinelearningservices.operations.VirtualMachineSizeOperations + :ivar quota: QuotaOperations operations + :vartype quota: azure.mgmt.machinelearningservices.operations.QuotaOperations + :ivar machine_learning_compute: MachineLearningComputeOperations operations + :vartype machine_learning_compute: azure.mgmt.machinelearningservices.operations.MachineLearningComputeOperations + :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations + :vartype private_endpoint_connection: azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionOperations + :ivar private_link_resource: PrivateLinkResourceOperations operations + :vartype private_link_resource: azure.mgmt.machinelearningservices.operations.PrivateLinkResourceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Azure subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureMachineLearningWorkspacesConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workspace = WorkspaceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workspace_feature = WorkspaceFeatureOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_size = VirtualMachineSizeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.quota = QuotaOperations( + self._client, self._config, self._serialize, self._deserialize) + self.machine_learning_compute = MachineLearningComputeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connection = PrivateEndpointConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resource = PrivateLinkResourceOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/_configuration.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/_configuration.py new file mode 100644 index 0000000000..ccafbc2a66 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/_configuration.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code 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 ._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): + """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: Azure subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-04-01" + self.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.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/_version.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/_version.py new file mode 100644 index 0000000000..eae7c95b6f --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/__init__.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/__init__.py new file mode 100644 index 0000000000..0250bddb2c --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_machine_learning_workspaces_async import AzureMachineLearningWorkspaces +__all__ = ['AzureMachineLearningWorkspaces'] diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/_azure_machine_learning_workspaces_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/_azure_machine_learning_workspaces_async.py new file mode 100644 index 0000000000..c44ae9917a --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/_azure_machine_learning_workspaces_async.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import AzureMachineLearningWorkspacesConfiguration +from .operations_async import OperationOperations +from .operations_async import WorkspaceOperations +from .operations_async import WorkspaceFeatureOperations +from .operations_async import UsageOperations +from .operations_async import VirtualMachineSizeOperations +from .operations_async import QuotaOperations +from .operations_async import MachineLearningComputeOperations +from .operations_async import AzureMachineLearningWorkspacesOperationsMixin +from .operations_async import PrivateEndpointConnectionOperations +from .operations_async import PrivateLinkResourceOperations +from .. import models + + +class AzureMachineLearningWorkspaces(AzureMachineLearningWorkspacesOperationsMixin): + """These APIs allow end users to operate on Azure Machine Learning Workspace resources. + + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.machinelearningservices.aio.operations_async.OperationOperations + :ivar workspace: WorkspaceOperations operations + :vartype workspace: azure.mgmt.machinelearningservices.aio.operations_async.WorkspaceOperations + :ivar workspace_feature: WorkspaceFeatureOperations operations + :vartype workspace_feature: azure.mgmt.machinelearningservices.aio.operations_async.WorkspaceFeatureOperations + :ivar usage: UsageOperations operations + :vartype usage: azure.mgmt.machinelearningservices.aio.operations_async.UsageOperations + :ivar virtual_machine_size: VirtualMachineSizeOperations operations + :vartype virtual_machine_size: azure.mgmt.machinelearningservices.aio.operations_async.VirtualMachineSizeOperations + :ivar quota: QuotaOperations operations + :vartype quota: azure.mgmt.machinelearningservices.aio.operations_async.QuotaOperations + :ivar machine_learning_compute: MachineLearningComputeOperations operations + :vartype machine_learning_compute: azure.mgmt.machinelearningservices.aio.operations_async.MachineLearningComputeOperations + :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations + :vartype private_endpoint_connection: azure.mgmt.machinelearningservices.aio.operations_async.PrivateEndpointConnectionOperations + :ivar private_link_resource: PrivateLinkResourceOperations operations + :vartype private_link_resource: azure.mgmt.machinelearningservices.aio.operations_async.PrivateLinkResourceOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Azure subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureMachineLearningWorkspacesConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workspace = WorkspaceOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workspace_feature = WorkspaceFeatureOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_size = VirtualMachineSizeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.quota = QuotaOperations( + self._client, self._config, self._serialize, self._deserialize) + self.machine_learning_compute = MachineLearningComputeOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connection = PrivateEndpointConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resource = PrivateLinkResourceOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/_configuration_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/_configuration_async.py new file mode 100644 index 0000000000..b318c9fa08 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/_configuration_async.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code 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 .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class AzureMachineLearningWorkspacesConfiguration(Configuration): + """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: Azure subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-04-01" + self.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.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/__init__.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/__init__.py new file mode 100644 index 0000000000..cb577480bf --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/__init__.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operation_operations_async import OperationOperations +from ._workspace_operations_async import WorkspaceOperations +from ._workspace_feature_operations_async import WorkspaceFeatureOperations +from ._usage_operations_async import UsageOperations +from ._virtual_machine_size_operations_async import VirtualMachineSizeOperations +from ._quota_operations_async import QuotaOperations +from ._machine_learning_compute_operations_async import MachineLearningComputeOperations +from ._azure_machine_learning_workspaces_operations_async import AzureMachineLearningWorkspacesOperationsMixin +from ._private_endpoint_connection_operations_async import PrivateEndpointConnectionOperations +from ._private_link_resource_operations_async import PrivateLinkResourceOperations + +__all__ = [ + 'OperationOperations', + 'WorkspaceOperations', + 'WorkspaceFeatureOperations', + 'UsageOperations', + 'VirtualMachineSizeOperations', + 'QuotaOperations', + 'MachineLearningComputeOperations', + 'AzureMachineLearningWorkspacesOperationsMixin', + 'PrivateEndpointConnectionOperations', + 'PrivateLinkResourceOperations', +] diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_azure_machine_learning_workspaces_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_azure_machine_learning_workspaces_operations_async.py new file mode 100644 index 0000000000..26fcc4c5b8 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_azure_machine_learning_workspaces_operations_async.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AzureMachineLearningWorkspacesOperationsMixin: + + def list_sku( + self, + **kwargs + ) -> "models.SkuListResult": + """Lists all skus with associated features. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuListResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.SkuListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SkuListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_sku.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_sku.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_machine_learning_compute_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_machine_learning_compute_operations_async.py new file mode 100644 index 0000000000..b2a617b7fc --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_machine_learning_compute_operations_async.py @@ -0,0 +1,662 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MachineLearningComputeOperations: + """MachineLearningComputeOperations 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 + + def list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + skiptoken: Optional[str] = None, + **kwargs + ) -> "models.PaginatedComputeResourcesList": + """Gets computes in specified workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: PaginatedComputeResourcesList or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PaginatedComputeResourcesList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_workspace.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} + + async def get( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs + ) -> "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: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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}'} + + async def _create_or_update_initial( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + type: Optional[Union[str, "models.ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + properties: Optional["models.Compute"] = None, + **kwargs + ) -> "models.ComputeResource": + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeResource"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ComputeResource(location=location, tags=tags, sku=sku, type_identity_type=type, user_assigned_identities=user_assigned_identities, properties=properties) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ComputeResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + deserialized = None + 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}'} + + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + type: Optional[Union[str, "models.ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + properties: Optional["models.Compute"] = None, + **kwargs + ) -> "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: Name of the resource group in which workspace is located. + :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 location: Specifies the location of the resource. + :type location: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param type: The identity type. + :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param properties: Compute properties. + :type properties: ~azure.mgmt.machinelearningservices.models.Compute + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns ComputeResource + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeResource"] + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + location=location, + tags=tags, + sku=sku, + type=type, + user_assigned_identities=user_assigned_identities, + properties=properties, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} + + async def _update_initial( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + scale_settings: Optional["models.ScaleSettings"] = None, + **kwargs + ) -> "models.ComputeResource": + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeResource"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ClusterUpdateParameters(scale_settings=scale_settings) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ClusterUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} + + async def update( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + scale_settings: Optional["models.ScaleSettings"] = None, + **kwargs + ) -> "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: Name of the resource group in which workspace is located. + :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 scale_settings: Desired scale settings for the amlCompute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns ComputeResource + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeResource"] + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + scale_settings=scale_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ComputeResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} + + async def _delete_initial( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + underlying_resource_action: Union[str, "models.UnderlyingResourceAction"], + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['underlyingResourceAction'] = self._serialize.query("underlying_resource_action", underlying_resource_action, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, 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}'} + + async def delete( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + underlying_resource_action: Union[str, "models.UnderlyingResourceAction"], + **kwargs + ) -> None: + """Deletes specified Machine Learning compute. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} + + async def list_node( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs + ) -> "models.AmlComputeNodesInformation": + """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: AmlComputeNodesInformation or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AmlComputeNodesInformation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list_node.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AmlComputeNodesInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} + + async def list_key( + self, + resource_group_name: str, + workspace_name: str, + compute_name: str, + **kwargs + ) -> "models.ComputeSecrets": + """Gets secrets related to Machine Learning compute (storage keys, service credentials, etc). + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_operation_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_operation_operations_async.py new file mode 100644 index 0000000000..9a9f72a625 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_operation_operations_async.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> "models.OperationListResult": + """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: OperationListResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.OperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_private_endpoint_connection_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_private_endpoint_connection_operations_async.py new file mode 100644 index 0000000000..b5562eb549 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_private_endpoint_connection_operations_async.py @@ -0,0 +1,252 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionOperations: + """PrivateEndpointConnectionOperations 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 get( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Gets the specified private endpoint connection associated with the workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + async def put( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + type: Optional[Union[str, "models.ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + private_endpoint: Optional["models.PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["models.PrivateLinkServiceConnectionState"] = None, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Update the state of specified private endpoint connection associated with the workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 location: Specifies the location of the resource. + :type location: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param type: The identity type. + :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _properties = models.PrivateEndpointConnection(location=location, tags=tags, sku=sku, type_identity_type=type, user_assigned_identities=user_assigned_identities, private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + async def delete( + self, + resource_group_name: str, + workspace_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> None: + """Deletes the specified private endpoint connection associated with the workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_private_link_resource_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_private_link_resource_operations_async.py new file mode 100644 index 0000000000..adc29b52f0 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_private_link_resource_operations_async.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourceOperations: + """PrivateLinkResourceOperations 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 list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> "models.PrivateLinkResourceListResult": + """Gets the private link resources that need to be created for a workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list_by_workspace.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_quota_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_quota_operations_async.py new file mode 100644 index 0000000000..38a5d7d9f5 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_quota_operations_async.py @@ -0,0 +1,171 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class QuotaOperations: + """QuotaOperations 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 update( + self, + location: str, + value: Optional[List["QuotaBaseProperties"]] = None, + **kwargs + ) -> "models.UpdateWorkspaceQuotasResult": + """Update quota for each VM family in workspace. + + :param location: The location for update quota is queried. + :type location: str + :param value: The list for update quota. + :type value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.QuotaUpdateParameters(value=value) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'QuotaUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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'} + + def list( + self, + location: str, + **kwargs + ) -> "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: ListWorkspaceQuotas or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListWorkspaceQuotas"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_usage_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_usage_operations_async.py new file mode 100644 index 0000000000..9201d91ac5 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_usage_operations_async.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsageOperations: + """UsageOperations 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 + + def list( + self, + location: str, + **kwargs + ) -> "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: ListUsagesResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.ListUsagesResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_virtual_machine_size_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_virtual_machine_size_operations_async.py new file mode 100644 index 0000000000..ee2f4a30ab --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_virtual_machine_size_operations_async.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineSizeOperations: + """VirtualMachineSizeOperations 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 list( + self, + location: str, + **kwargs + ) -> "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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_workspace_feature_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_workspace_feature_operations_async.py new file mode 100644 index 0000000000..0f61135a00 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_workspace_feature_operations_async.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkspaceFeatureOperations: + """WorkspaceFeatureOperations 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 + + def list( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> "models.ListAmlUserFeatureResult": + """Lists all enabled features for a workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: ListAmlUserFeatureResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListAmlUserFeatureResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_workspace_operations_async.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_workspace_operations_async.py new file mode 100644 index 0000000000..df17601541 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/aio/operations_async/_workspace_operations_async.py @@ -0,0 +1,681 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkspaceOperations: + """WorkspaceOperations 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 get( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> "models.Workspace": + """Gets the properties of the specified machine learning workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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}'} + + async def _create_or_update_initial( + self, + resource_group_name: str, + workspace_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + type: Optional[Union[str, "models.ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = 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, + hbi_workspace: Optional[bool] = False, + image_build_compute: Optional[str] = None, + allow_public_access_when_behind_vnet: Optional[bool] = False, + shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, + status: Optional[Union[str, "models.EncryptionStatus"]] = None, + key_vault_properties: Optional["models.KeyVaultProperties"] = None, + **kwargs + ) -> "models.Workspace": + cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.Workspace(location=location, tags=tags, sku=sku, type_identity_type=type, user_assigned_identities=user_assigned_identities, description=description, friendly_name=friendly_name, key_vault=key_vault, application_insights=application_insights, container_registry=container_registry, storage_account=storage_account, discovery_url=discovery_url, hbi_workspace=hbi_workspace, image_build_compute=image_build_compute, allow_public_access_when_behind_vnet=allow_public_access_when_behind_vnet, shared_private_link_resources=shared_private_link_resources, status=status, key_vault_properties=key_vault_properties) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'Workspace') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workspace', pipeline_response) + + if response.status_code == 201: + 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}'} + + async def create_or_update( + self, + resource_group_name: str, + workspace_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + type: Optional[Union[str, "models.ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = 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, + hbi_workspace: Optional[bool] = False, + image_build_compute: Optional[str] = None, + allow_public_access_when_behind_vnet: Optional[bool] = False, + shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, + status: Optional[Union[str, "models.EncryptionStatus"]] = None, + key_vault_properties: Optional["models.KeyVaultProperties"] = None, + **kwargs + ) -> "models.Workspace": + """Creates or updates a workspace with the specified parameters. + + :param resource_group_name: Name of the resource group in which workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param location: Specifies the location of the resource. + :type location: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param type: The identity type. + :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param description: The description of this workspace. + :type description: str + :param friendly_name: The friendly name for this workspace. This name in mutable. + :type friendly_name: str + :param key_vault: ARM id of the key vault associated with this workspace. This cannot be + changed once the workspace has been created. + :type key_vault: str + :param application_insights: ARM id of the application insights associated with this workspace. + This cannot be changed once the workspace has been created. + :type application_insights: str + :param container_registry: ARM id of the container registry associated with this workspace. + This cannot be changed once the workspace has been created. + :type container_registry: str + :param storage_account: ARM id of the storage account associated with this workspace. This + cannot be changed once the workspace has been created. + :type storage_account: str + :param discovery_url: Url for the discovery service to identify regional endpoints for machine + learning experimentation services. + :type discovery_url: str + :param hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data + collected by the service. + :type hbi_workspace: bool + :param image_build_compute: The compute name for image build. + :type image_build_compute: str + :param allow_public_access_when_behind_vnet: The flag to indicate whether to allow public + access when behind VNet. + :type allow_public_access_when_behind_vnet: bool + :param shared_private_link_resources: The list of shared private link resources in this + workspace. + :type shared_private_link_resources: list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] + :param status: Indicates whether or not the encryption is enabled for the workspace. + :type status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus + :param key_vault_properties: Customer Key vault properties. + :type key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns Workspace + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + location=location, + tags=tags, + sku=sku, + type=type, + user_assigned_identities=user_assigned_identities, + description=description, + friendly_name=friendly_name, + key_vault=key_vault, + application_insights=application_insights, + container_registry=container_registry, + storage_account=storage_account, + discovery_url=discovery_url, + hbi_workspace=hbi_workspace, + image_build_compute=image_build_compute, + allow_public_access_when_behind_vnet=allow_public_access_when_behind_vnet, + shared_private_link_resources=shared_private_link_resources, + status=status, + key_vault_properties=key_vault_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Workspace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} + + async def delete( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> None: + """Deletes a machine learning workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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}'} + + async def update( + self, + resource_group_name: str, + workspace_name: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.Sku"] = None, + description: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ) -> "models.Workspace": + """Updates a machine learning workspace with the specified parameters. + + :param resource_group_name: Name of the resource group in which workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param tags: The resource tags for the machine learning workspace. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param description: The description of this workspace. + :type description: str + :param friendly_name: The friendly name for this workspace. + :type friendly_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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.WorkspaceUpdateParameters(tags=tags, sku=sku, description=description, friendly_name=friendly_name) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'WorkspaceUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} + + def list_by_resource_group( + self, + resource_group_name: str, + skiptoken: Optional[str] = None, + **kwargs + ) -> "models.WorkspaceListResult": + """Lists all the available machine learning workspaces under the specified resource group. + + :param resource_group_name: Name of the resource group in which workspace is located. + :type resource_group_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: WorkspaceListResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} + + async def list_key( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> "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: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} + + async def resync_key( + self, + resource_group_name: str, + workspace_name: str, + **kwargs + ) -> 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: Name of the resource group in which workspace is located. + :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: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.resync_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resync_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} + + def list_by_subscription( + self, + skiptoken: Optional[str] = None, + **kwargs + ) -> "models.WorkspaceListResult": + """Lists all the available machine learning workspaces under the specified subscription. + + :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: WorkspaceListResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/__init__.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/__init__.py new file mode 100644 index 0000000000..7e4c8671c0 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/__init__.py @@ -0,0 +1,263 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 AksComputeSecrets + from ._models_py3 import AksNetworkingConfiguration + from ._models_py3 import AksProperties + from ._models_py3 import AmlCompute + from ._models_py3 import AmlComputeNodeInformation + from ._models_py3 import AmlComputeNodesInformation + from ._models_py3 import AmlComputeProperties + from ._models_py3 import AmlUserFeature + from ._models_py3 import ClusterUpdateParameters + from ._models_py3 import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties + from ._models_py3 import Compute + from ._models_py3 import ComputeNodesInformation + from ._models_py3 import ComputeResource + from ._models_py3 import ComputeSecrets + from ._models_py3 import DataFactory + from ._models_py3 import DataLakeAnalytics + from ._models_py3 import DataLakeAnalyticsProperties + from ._models_py3 import Databricks + from ._models_py3 import DatabricksComputeSecrets + from ._models_py3 import DatabricksProperties + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import HdInsight + from ._models_py3 import KeyVaultProperties + from ._models_py3 import ListAmlUserFeatureResult + from ._models_py3 import ListUsagesResult + from ._models_py3 import ListWorkspaceKeysResult + from ._models_py3 import ListWorkspaceQuotas + from ._models_py3 import MachineLearningServiceError + from ._models_py3 import NodeStateCounts + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import PaginatedComputeResourcesList + from ._models_py3 import Password + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import QuotaBaseProperties + from ._models_py3 import QuotaUpdateParameters + from ._models_py3 import RegistryListCredentialsResult + from ._models_py3 import Resource + from ._models_py3 import ResourceId + from ._models_py3 import ResourceName + from ._models_py3 import ResourceQuota + from ._models_py3 import ResourceSkuLocationInfo + from ._models_py3 import ResourceSkuZoneDetails + from ._models_py3 import Restriction + from ._models_py3 import ScaleSettings + from ._models_py3 import ServicePrincipalCredentials + from ._models_py3 import SharedPrivateLinkResource + from ._models_py3 import Sku + from ._models_py3 import SkuCapability + from ._models_py3 import SkuListResult + from ._models_py3 import SslConfiguration + from ._models_py3 import SystemService + from ._models_py3 import UpdateWorkspaceQuotas + from ._models_py3 import UpdateWorkspaceQuotasResult + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import UserAccountCredentials + from ._models_py3 import VirtualMachine + from ._models_py3 import VirtualMachineSecrets + from ._models_py3 import VirtualMachineSize + from ._models_py3 import VirtualMachineSizeListResult + from ._models_py3 import VirtualMachineSshCredentials + from ._models_py3 import Workspace + from ._models_py3 import WorkspaceListResult + from ._models_py3 import WorkspaceSku + from ._models_py3 import WorkspaceUpdateParameters +except (SyntaxError, ImportError): + from ._models import Aks # type: ignore + from ._models import AksComputeSecrets # type: ignore + from ._models import AksNetworkingConfiguration # type: ignore + from ._models import AksProperties # 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 AmlUserFeature # type: ignore + from ._models import ClusterUpdateParameters # type: ignore + from ._models import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore + from ._models import Compute # type: ignore + from ._models import ComputeNodesInformation # type: ignore + from ._models import ComputeResource # type: ignore + from ._models import ComputeSecrets # type: ignore + from ._models import DataFactory # type: ignore + from ._models import DataLakeAnalytics # type: ignore + from ._models import DataLakeAnalyticsProperties # type: ignore + from ._models import Databricks # type: ignore + from ._models import DatabricksComputeSecrets # type: ignore + from ._models import DatabricksProperties # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import HdInsight # type: ignore + from ._models import KeyVaultProperties # type: ignore + from ._models import ListAmlUserFeatureResult # type: ignore + from ._models import ListUsagesResult # type: ignore + from ._models import ListWorkspaceKeysResult # type: ignore + from ._models import ListWorkspaceQuotas # type: ignore + from ._models import MachineLearningServiceError # type: ignore + from ._models import NodeStateCounts # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import PaginatedComputeResourcesList # type: ignore + from ._models import Password # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import QuotaBaseProperties # type: ignore + from ._models import QuotaUpdateParameters # type: ignore + from ._models import RegistryListCredentialsResult # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceId # type: ignore + from ._models import ResourceName # type: ignore + from ._models import ResourceQuota # type: ignore + from ._models import ResourceSkuLocationInfo # type: ignore + from ._models import ResourceSkuZoneDetails # type: ignore + from ._models import Restriction # type: ignore + from ._models import ScaleSettings # type: ignore + from ._models import ServicePrincipalCredentials # type: ignore + from ._models import SharedPrivateLinkResource # type: ignore + from ._models import Sku # type: ignore + from ._models import SkuCapability # type: ignore + from ._models import SkuListResult # type: ignore + from ._models import SslConfiguration # type: ignore + from ._models import SystemService # type: ignore + from ._models import UpdateWorkspaceQuotas # type: ignore + from ._models import UpdateWorkspaceQuotasResult # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageName # type: ignore + from ._models import UserAccountCredentials # type: ignore + from ._models import VirtualMachine # type: ignore + from ._models import VirtualMachineSecrets # type: ignore + from ._models import VirtualMachineSize # type: ignore + from ._models import VirtualMachineSizeListResult # type: ignore + from ._models import VirtualMachineSshCredentials # type: ignore + from ._models import Workspace # type: ignore + from ._models import WorkspaceListResult # type: ignore + from ._models import WorkspaceSku # type: ignore + from ._models import WorkspaceUpdateParameters # type: ignore + +from ._azure_machine_learning_workspaces_enums import ( + AllocationState, + ComputeType, + EncryptionStatus, + NodeState, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + ReasonCode, + RemoteLoginPortPublicAccess, + ResourceIdentityType, + SslConfigurationStatus, + Status, + UnderlyingResourceAction, + VmPriority, +) + +__all__ = [ + 'Aks', + 'AksComputeSecrets', + 'AksNetworkingConfiguration', + 'AksProperties', + 'AmlCompute', + 'AmlComputeNodeInformation', + 'AmlComputeNodesInformation', + 'AmlComputeProperties', + 'AmlUserFeature', + 'ClusterUpdateParameters', + 'ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties', + 'Compute', + 'ComputeNodesInformation', + 'ComputeResource', + 'ComputeSecrets', + 'DataFactory', + 'DataLakeAnalytics', + 'DataLakeAnalyticsProperties', + 'Databricks', + 'DatabricksComputeSecrets', + 'DatabricksProperties', + 'ErrorDetail', + 'ErrorResponse', + 'HdInsight', + 'KeyVaultProperties', + 'ListAmlUserFeatureResult', + 'ListUsagesResult', + 'ListWorkspaceKeysResult', + 'ListWorkspaceQuotas', + 'MachineLearningServiceError', + 'NodeStateCounts', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'PaginatedComputeResourcesList', + 'Password', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'QuotaBaseProperties', + 'QuotaUpdateParameters', + 'RegistryListCredentialsResult', + 'Resource', + 'ResourceId', + 'ResourceName', + 'ResourceQuota', + 'ResourceSkuLocationInfo', + 'ResourceSkuZoneDetails', + 'Restriction', + 'ScaleSettings', + 'ServicePrincipalCredentials', + 'SharedPrivateLinkResource', + 'Sku', + 'SkuCapability', + 'SkuListResult', + 'SslConfiguration', + 'SystemService', + 'UpdateWorkspaceQuotas', + 'UpdateWorkspaceQuotasResult', + 'Usage', + 'UsageName', + 'UserAccountCredentials', + 'VirtualMachine', + 'VirtualMachineSecrets', + 'VirtualMachineSize', + 'VirtualMachineSizeListResult', + 'VirtualMachineSshCredentials', + 'Workspace', + 'WorkspaceListResult', + 'WorkspaceSku', + 'WorkspaceUpdateParameters', + 'AllocationState', + 'ComputeType', + 'EncryptionStatus', + 'NodeState', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'ProvisioningState', + 'ReasonCode', + 'RemoteLoginPortPublicAccess', + 'ResourceIdentityType', + 'SslConfigurationStatus', + 'Status', + 'UnderlyingResourceAction', + 'VmPriority', +] diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py new file mode 100644 index 0000000000..a76e03ea14 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py @@ -0,0 +1,145 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 + +class AllocationState(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 ComputeType(str, Enum): + """The type of compute + """ + + aks = "AKS" + aml_compute = "AmlCompute" + data_factory = "DataFactory" + virtual_machine = "VirtualMachine" + hd_insight = "HDInsight" + databricks = "Databricks" + data_lake_analytics = "DataLakeAnalytics" + +class EncryptionStatus(str, Enum): + """Indicates whether or not the encryption is enabled for the workspace. + """ + + enabled = "Enabled" + disabled = "Disabled" + +class NodeState(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 PrivateEndpointConnectionProvisioningState(str, Enum): + """The current provisioning state. + """ + + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + failed = "Failed" + +class PrivateEndpointServiceConnectionStatus(str, Enum): + """The private endpoint connection status. + """ + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + timeout = "Timeout" + +class ProvisioningState(str, Enum): + """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" + +class ReasonCode(str, Enum): + """The reason for the restriction. + """ + + not_specified = "NotSpecified" + not_available_for_region = "NotAvailableForRegion" + not_available_for_subscription = "NotAvailableForSubscription" + +class RemoteLoginPortPublicAccess(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 ResourceIdentityType(str, Enum): + """The identity type. + """ + + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned, UserAssigned" + none = "None" + +class SslConfigurationStatus(str, Enum): + """Enable or disable ssl for scoring + """ + + disabled = "Disabled" + enabled = "Enabled" + +class Status(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 UnderlyingResourceAction(str, Enum): + + delete = "Delete" + detach = "Detach" + +class VmPriority(str, Enum): + """Virtual Machine priority + """ + + dedicated = "Dedicated" + low_priority = "LowPriority" diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/_models.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/_models.py new file mode 100644 index 0000000000..fe5abead06 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/_models.py @@ -0,0 +1,3050 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 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, DataFactory, DataLakeAnalytics, Databricks, HdInsight, 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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + } + + _subtype_map = { + 'compute_type': {'AKS': 'Aks', 'AmlCompute': 'AmlCompute', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HdInsight', 'VirtualMachine': 'VirtualMachine'} + } + + def __init__( + self, + **kwargs + ): + super(Compute, self).__init__(**kwargs) + self.compute_type = None + 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 + + +class Aks(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: AKS properties. + :type properties: ~azure.mgmt.machinelearningservices.models.AksProperties + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'AksProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(Aks, self).__init__(**kwargs) + self.compute_type = 'AKS' + self.properties = kwargs.get('properties', 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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type 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 + + +class AksComputeSecrets(ComputeSecrets): + """Secrets related to a Machine Learning compute based on AKS. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param user_kube_config: Content of kubeconfig file that can be used to connect to the + Kubernetes cluster. + :type user_kube_config: str + :param admin_kube_config: Content of kubeconfig file that can be used to connect to the + Kubernetes cluster. + :type admin_kube_config: str + :param image_pull_secret_name: Image registry pull secret. + :type image_pull_secret_name: str + """ + + _validation = { + 'compute_type': {'required': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + '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 + ): + super(AksComputeSecrets, self).__init__(**kwargs) + self.compute_type = 'AKS' + 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 AksNetworkingConfiguration(msrest.serialization.Model): + """Advance configuration for AKS networking. + + :param subnet_id: Virtual network subnet resource ID the compute nodes belong to. + :type subnet_id: str + :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. + :type service_cidr: str + :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :type dns_service_ip: str + :param 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. + :type 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 + ): + 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 AksProperties(msrest.serialization.Model): + """AKS properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param cluster_fqdn: Cluster full qualified domain name. + :type cluster_fqdn: str + :ivar system_services: System services. + :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] + :param agent_count: Number of agents. + :type agent_count: int + :param agent_vm_size: Agent virtual machine size. + :type agent_vm_size: str + :param ssl_configuration: SSL configuration. + :type ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration + :param aks_networking_configuration: AKS networking configuration for vnet. + :type aks_networking_configuration: + ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration + """ + + _validation = { + 'system_services': {'readonly': True}, + 'agent_count': {'minimum': 1}, + } + + _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'}, + 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, + 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(AksProperties, 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.ssl_configuration = kwargs.get('ssl_configuration', None) + self.aks_networking_configuration = kwargs.get('aks_networking_configuration', None) + + +class AmlCompute(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: AML Compute properties. + :type properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AmlCompute, self).__init__(**kwargs) + self.compute_type = 'AmlCompute' + self.properties = kwargs.get('properties', 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 ComputeNodesInformation(msrest.serialization.Model): + """Compute nodes information 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: AmlComputeNodesInformation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :ivar next_link: The continuation token. + :vartype next_link: str + """ + + _validation = { + 'compute_type': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + _subtype_map = { + 'compute_type': {'AmlCompute': 'AmlComputeNodesInformation'} + } + + def __init__( + self, + **kwargs + ): + super(ComputeNodesInformation, self).__init__(**kwargs) + self.compute_type = None + self.next_link = None + + +class AmlComputeNodesInformation(ComputeNodesInformation): + """Compute node information related to a AmlCompute. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :ivar next_link: The continuation token. + :vartype next_link: str + :ivar nodes: The collection of returned AmlCompute nodes details. + :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] + """ + + _validation = { + 'compute_type': {'required': True}, + 'next_link': {'readonly': True}, + 'nodes': {'readonly': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(AmlComputeNodesInformation, self).__init__(**kwargs) + self.compute_type = 'AmlCompute' + self.nodes = None + + +class AmlComputeProperties(msrest.serialization.Model): + """AML Compute properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param vm_size: Virtual Machine Size. + :type vm_size: str + :param vm_priority: Virtual Machine priority. Possible values include: "Dedicated", + "LowPriority". + :type vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority + :param scale_settings: Scale settings for AML Compute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + :param user_account_credentials: Credentials for an administrator user account that will be + created on each compute node. + :type user_account_credentials: + ~azure.mgmt.machinelearningservices.models.UserAccountCredentials + :param subnet: Virtual network subnet resource ID the compute nodes belong to. + :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param 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". + :type 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.MachineLearningServiceError] + :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 + """ + + _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 = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, + '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': '[MachineLearningServiceError]'}, + 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, + 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, + 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, + } + + def __init__( + self, + **kwargs + ): + super(AmlComputeProperties, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) + self.vm_priority = kwargs.get('vm_priority', 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 + + +class AmlUserFeature(msrest.serialization.Model): + """Features enabled for a workspace. + + :param id: Specifies the feature ID. + :type id: str + :param display_name: Specifies the feature name. + :type display_name: str + :param description: Describes the feature for user experience. + :type description: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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 ClusterUpdateParameters(msrest.serialization.Model): + """AmlCompute update parameters. + + :param scale_settings: Desired scale settings for the amlCompute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + """ + + _attribute_map = { + 'scale_settings': {'key': 'properties.scaleSettings', 'type': 'ScaleSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterUpdateParameters, self).__init__(**kwargs) + self.scale_settings = kwargs.get('scale_settings', None) + + +class ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user 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(ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class Resource(msrest.serialization.Model): + """Azure Resource Manager resource envelope. + + 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 name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.location = kwargs.get('location', None) + self.type = None + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.principal_id = None + self.tenant_id = None + self.type_identity_type = kwargs.get('type_identity_type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ComputeResource(Resource): + """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 id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param properties: Compute properties. + :type properties: ~azure.mgmt.machinelearningservices.models.Compute + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'properties': {'key': 'properties', 'type': 'Compute'}, + } + + def __init__( + self, + **kwargs + ): + super(ComputeResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class Databricks(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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: + :type properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(Databricks, self).__init__(**kwargs) + self.compute_type = 'Databricks' + self.properties = kwargs.get('properties', None) + + +class DatabricksComputeSecrets(ComputeSecrets): + """Secrets related to a Machine Learning compute based on Databricks. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param databricks_access_token: access token for databricks account. + :type databricks_access_token: str + """ + + _validation = { + 'compute_type': {'required': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabricksComputeSecrets, self).__init__(**kwargs) + self.compute_type = 'Databricks' + self.databricks_access_token = kwargs.get('databricks_access_token', None) + + +class DatabricksProperties(msrest.serialization.Model): + """DatabricksProperties. + + :param databricks_access_token: Databricks access token. + :type databricks_access_token: str + """ + + _attribute_map = { + 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabricksProperties, self).__init__(**kwargs) + self.databricks_access_token = kwargs.get('databricks_access_token', None) + + +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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DataFactory, self).__init__(**kwargs) + self.compute_type = 'DataFactory' + + +class DataLakeAnalytics(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: + :type properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(DataLakeAnalytics, self).__init__(**kwargs) + self.compute_type = 'DataLakeAnalytics' + self.properties = kwargs.get('properties', None) + + +class DataLakeAnalyticsProperties(msrest.serialization.Model): + """DataLakeAnalyticsProperties. + + :param data_lake_store_account_name: DataLake Store Account Name. + :type data_lake_store_account_name: str + """ + + _attribute_map = { + 'data_lake_store_account_name': {'key': 'dataLakeStoreAccountName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataLakeAnalyticsProperties, self).__init__(**kwargs) + self.data_lake_store_account_name = kwargs.get('data_lake_store_account_name', None) + + +class ErrorDetail(msrest.serialization.Model): + """Error detail information. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. + :type code: str + :param message: Required. Error message. + :type 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 + ): + 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 HdInsight(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param ssh_port: Port open for ssh connections on the master node of the cluster. + :type ssh_port: int + :param address: Public IP address of the master node of the cluster. + :type address: str + :param administrator_account: Admin credentials for master node of the cluster. + :type administrator_account: + ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'ssh_port': {'key': 'properties.sshPort', 'type': 'int'}, + 'address': {'key': 'properties.address', 'type': 'str'}, + 'administrator_account': {'key': 'properties.administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + } + + def __init__( + self, + **kwargs + ): + super(HdInsight, self).__init__(**kwargs) + self.compute_type = 'HDInsight' + self.ssh_port = kwargs.get('ssh_port', None) + self.address = kwargs.get('address', None) + self.administrator_account = kwargs.get('administrator_account', None) + + +class KeyVaultProperties(msrest.serialization.Model): + """KeyVaultProperties. + + All required parameters must be populated in order to send to Azure. + + :param key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned + encryption key is present. + :type key_vault_arm_id: str + :param key_identifier: Required. Key vault uri to access the encryption key. + :type key_identifier: str + :param identity_client_id: For future use - The client id of the identity which will be used to + access key vault. + :type 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 + ): + super(KeyVaultProperties, 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 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 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 + """ + + _validation = { + 'user_storage_key': {'readonly': True}, + 'user_storage_resource_id': {'readonly': True}, + 'app_insights_instrumentation_key': {'readonly': True}, + 'container_registry_credentials': {'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'}, + } + + 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 + + +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 MachineLearningServiceError(msrest.serialization.Model): + """Wrapper for error response to follow ARM guidelines. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: The error response. + :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorResponse + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineLearningServiceError, self).__init__(**kwargs) + self.error = 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 Operation(msrest.serialization.Model): + """Azure Machine Learning workspace REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: Display name of operation. + :type display: ~azure.mgmt.machinelearningservices.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """Display name of operation. + + :param provider: The resource provider name: Microsoft.MachineLearningExperimentation. + :type provider: str + :param resource: The resource on which the operation is performed. + :type resource: str + :param operation: The operation that users can perform. + :type operation: str + :param description: The description for the operation. + :type 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 + ): + super(OperationDisplay, 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 OperationListResult(msrest.serialization.Model): + """An array of operations supported by the resource provider. + + :param value: List of AML workspace operations supported by the AML workspace resource + provider. + :type value: list[~azure.mgmt.machinelearningservices.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PaginatedComputeResourcesList(msrest.serialization.Model): + """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. + + :param value: An array of Machine Learning compute objects wrapped in ARM resource envelope. + :type value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] + :param next_link: A continuation link (absolute URI) to the next page of results in the list. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ComputeResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PaginatedComputeResourcesList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', 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 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: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type 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}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + '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 + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateLinkResource(Resource): + """A private link 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 name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :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] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + '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 + ): + super(PrivateLinkResource, self).__init__(**kwargs) + 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. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + 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. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", + "Timeout". + :type status: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type 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 + ): + 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 QuotaBaseProperties(msrest.serialization.Model): + """The properties for Quota update or retrieval. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Specifies the resource ID. + :type id: str + :param type: Specifies the resource type. + :type type: str + :param limit: The maximum permitted quota of the resource. + :type limit: long + :ivar unit: An enum describing the unit of quota measurement. Default value: "Count". + :vartype unit: str + """ + + _validation = { + 'unit': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + unit = "Count" + + def __init__( + self, + **kwargs + ): + super(QuotaBaseProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.limit = kwargs.get('limit', None) + + +class QuotaUpdateParameters(msrest.serialization.Model): + """Quota update parameters. + + :param value: The list for update quota. + :type value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(QuotaUpdateParameters, self).__init__(**kwargs) + self.value = kwargs.get('value', 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 + :param passwords: + :type 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 + ): + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.location = None + self.username = None + self.passwords = kwargs.get('passwords', 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. + + :param id: Required. The ID of the resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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 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. Default value: "Count". + :vartype unit: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True, 'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + unit = "Count" + + def __init__( + self, + **kwargs + ): + super(ResourceQuota, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.limit = None + self.unit = None + + +class ResourceSkuLocationInfo(msrest.serialization.Model): + """ResourceSkuLocationInfo. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the SKU. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~azure.mgmt.machinelearningservices.models.ResourceSkuZoneDetails] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ResourceSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~azure.mgmt.machinelearningservices.models.SkuCapability] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + +class Restriction(msrest.serialization.Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. As of now only possible value for this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. Possible values include: "NotSpecified", + "NotAvailableForRegion", "NotAvailableForSubscription". + :type reason_code: str or ~azure.mgmt.machinelearningservices.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class ScaleSettings(msrest.serialization.Model): + """scale settings for AML Compute. + + All required parameters must be populated in order to send to Azure. + + :param max_node_count: Required. Max number of nodes to use. + :type max_node_count: int + :param min_node_count: Min number of nodes to use. + :type min_node_count: int + :param node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. + :type 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 + ): + 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 ServicePrincipalCredentials(msrest.serialization.Model): + """Service principal credentials. + + All required parameters must be populated in order to send to Azure. + + :param client_id: Required. Client Id. + :type client_id: str + :param client_secret: Required. Client secret. + :type client_secret: str + """ + + _validation = { + 'client_id': {'required': True}, + 'client_secret': {'required': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServicePrincipalCredentials, self).__init__(**kwargs) + self.client_id = kwargs['client_id'] + self.client_secret = kwargs['client_secret'] + + +class SharedPrivateLinkResource(msrest.serialization.Model): + """SharedPrivateLinkResource. + + :param name: Unique name of the private link. + :type name: str + :param private_link_resource_id: The resource id that private link links to. + :type private_link_resource_id: str + :param group_id: The private link resource group id. + :type group_id: str + :param request_message: Request message. + :type request_message: str + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", + "Timeout". + :type 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 + ): + 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): + """Sku of the resource. + + :param name: Name of the sku. + :type name: str + :param tier: Tier of the sku like Basic or Enterprise. + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class SkuCapability(msrest.serialization.Model): + """Features/user capabilities associated with the sku. + + :param name: Capability/Feature ID. + :type name: str + :param value: Details about the feature/capability. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCapability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class SkuListResult(msrest.serialization.Model): + """List of skus with features. + + :param value: + :type value: list[~azure.mgmt.machinelearningservices.models.WorkspaceSku] + :param next_link: The URI to fetch the next page of Workspace Skus. Call ListNext() with this + URI to fetch the next page of Workspace Skus. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkspaceSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class SslConfiguration(msrest.serialization.Model): + """The ssl configuration for scoring. + + :param status: Enable or disable ssl for scoring. Possible values include: "Disabled", + "Enabled". + :type status: str or ~azure.mgmt.machinelearningservices.models.SslConfigurationStatus + :param cert: Cert data. + :type cert: str + :param key: Key data. + :type key: str + :param cname: CNAME of the cert. + :type cname: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'cert': {'key': 'cert', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + 'cname': {'key': 'cname', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + 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) + + +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 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 + :param limit: The maximum permitted quota of the resource. + :type limit: long + :ivar unit: An enum describing the unit of quota measurement. Default value: "Count". + :vartype unit: str + :param status: Status of update workspace quota. Possible values include: "Undefined", + "Success", "Failure", "InvalidQuotaBelowClusterMinimum", + "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", + "OperationNotEnabledForRegion". + :type status: str or ~azure.mgmt.machinelearningservices.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True, 'constant': 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'}, + } + + unit = "Count" + + def __init__( + self, + **kwargs + ): + 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 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 type: Specifies the resource type. + :vartype type: str + :ivar unit: An enum describing the unit of usage measurement. Default value: "Count". + :vartype unit: str + :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}, + 'type': {'readonly': True}, + 'unit': {'readonly': True, 'constant': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', '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'}, + } + + unit = "Count" + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = 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. + + :param admin_user_name: Required. Name of the administrator user account which can be used to + SSH to nodes. + :type admin_user_name: str + :param admin_user_ssh_public_key: SSH public key of the administrator user account. + :type admin_user_ssh_public_key: str + :param admin_user_password: Password of the administrator user account. + :type 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 + ): + 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 VirtualMachine(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param virtual_machine_size: Virtual Machine size. + :type virtual_machine_size: str + :param ssh_port: Port open for ssh connections. + :type ssh_port: int + :param address: Public IP address of the virtual machine. + :type address: str + :param administrator_account: Admin credentials for virtual machine. + :type administrator_account: + ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'virtual_machine_size': {'key': 'properties.virtualMachineSize', 'type': 'str'}, + 'ssh_port': {'key': 'properties.sshPort', 'type': 'int'}, + 'address': {'key': 'properties.address', 'type': 'str'}, + 'administrator_account': {'key': 'properties.administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachine, self).__init__(**kwargs) + self.compute_type = 'VirtualMachine' + self.virtual_machine_size = kwargs.get('virtual_machine_size', None) + self.ssh_port = kwargs.get('ssh_port', None) + self.address = kwargs.get('address', None) + self.administrator_account = kwargs.get('administrator_account', None) + + +class VirtualMachineSecrets(ComputeSecrets): + """Secrets related to a Machine Learning compute based on AKS. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param administrator_account: Admin credentials for virtual machine. + :type administrator_account: + ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials + """ + + _validation = { + 'compute_type': {'required': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineSecrets, self).__init__(**kwargs) + self.compute_type = 'VirtualMachine' + self.administrator_account = kwargs.get('administrator_account', None) + + +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 + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + 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 + + +class VirtualMachineSizeListResult(msrest.serialization.Model): + """The List Virtual Machine size operation response. + + :param aml_compute: The list of virtual machine sizes supported by AmlCompute. + :type aml_compute: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] + """ + + _attribute_map = { + 'aml_compute': {'key': 'amlCompute', 'type': '[VirtualMachineSize]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineSizeListResult, self).__init__(**kwargs) + self.aml_compute = kwargs.get('aml_compute', None) + + +class VirtualMachineSshCredentials(msrest.serialization.Model): + """Admin credentials for virtual machine. + + :param username: Username of admin account. + :type username: str + :param password: Password of admin account. + :type password: str + :param public_key_data: Public key data. + :type public_key_data: str + :param private_key_data: Private key data. + :type 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 + ): + 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 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: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :ivar workspace_id: The immutable id associated with this workspace. + :vartype workspace_id: str + :param description: The description of this workspace. + :type description: str + :param friendly_name: The friendly name for this workspace. This name in mutable. + :type friendly_name: str + :ivar creation_time: The creation time of the machine learning workspace in ISO8601 format. + :vartype creation_time: ~datetime.datetime + :param key_vault: ARM id of the key vault associated with this workspace. This cannot be + changed once the workspace has been created. + :type key_vault: str + :param application_insights: ARM id of the application insights associated with this workspace. + This cannot be changed once the workspace has been created. + :type application_insights: str + :param container_registry: ARM id of the container registry associated with this workspace. + This cannot be changed once the workspace has been created. + :type container_registry: str + :param storage_account: ARM id of the storage account associated with this workspace. This + cannot be changed once the workspace has been created. + :type storage_account: str + :param discovery_url: Url for the discovery service to identify regional endpoints for machine + learning experimentation services. + :type 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". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.ProvisioningState + :param hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data + collected by the service. + :type 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 + :param image_build_compute: The compute name for image build. + :type image_build_compute: str + :param allow_public_access_when_behind_vnet: The flag to indicate whether to allow public + access when behind VNet. + :type allow_public_access_when_behind_vnet: bool + :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. + :vartype private_endpoint_connections: + list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] + :param shared_private_link_resources: The list of shared private link resources in this + workspace. + :type shared_private_link_resources: + list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] + :param status: Indicates whether or not the encryption is enabled for the workspace. Possible + values include: "Enabled", "Disabled". + :type status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus + :param key_vault_properties: Customer Key vault properties. + :type key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'workspace_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'service_provisioned_resource_group': {'readonly': True}, + 'private_link_count': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + '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'}, + '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'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, + 'status': {'key': 'properties.encryption.status', 'type': 'str'}, + 'key_vault_properties': {'key': 'properties.encryption.keyVaultProperties', 'type': 'KeyVaultProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(Workspace, self).__init__(**kwargs) + self.workspace_id = None + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.creation_time = 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.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.private_endpoint_connections = None + self.shared_private_link_resources = kwargs.get('shared_private_link_resources', None) + self.status = kwargs.get('status', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class WorkspaceListResult(msrest.serialization.Model): + """The result of a request to list machine learning workspaces. + + :param 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. + :type value: list[~azure.mgmt.machinelearningservices.models.Workspace] + :param next_link: The URI that can be used to request the next list of machine learning + workspaces. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Workspace]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkspaceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WorkspaceSku(msrest.serialization.Model): + """Describes Workspace Sku details and features. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: The set of locations that the SKU is available. This will be supported and + registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those locations where the + SKU is available. + :vartype location_info: + list[~azure.mgmt.machinelearningservices.models.ResourceSkuLocationInfo] + :ivar tier: Sku Tier like Basic or Enterprise. + :vartype tier: str + :ivar resource_type: + :vartype resource_type: str + :ivar name: + :vartype name: str + :ivar capabilities: List of features/user capabilities associated with the sku. + :vartype capabilities: list[~azure.mgmt.machinelearningservices.models.SkuCapability] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :type restrictions: list[~azure.mgmt.machinelearningservices.models.Restriction] + """ + + _validation = { + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkspaceSku, self).__init__(**kwargs) + self.locations = None + self.location_info = None + self.tier = None + self.resource_type = None + self.name = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class WorkspaceUpdateParameters(msrest.serialization.Model): + """The parameters for updating a machine learning workspace. + + :param tags: A set of tags. The resource tags for the machine learning workspace. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param description: The description of this workspace. + :type description: str + :param friendly_name: The friendly name for this workspace. + :type friendly_name: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkspaceUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/_models_py3.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/_models_py3.py new file mode 100644 index 0000000000..61cb7f5c34 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/models/_models_py3.py @@ -0,0 +1,3268 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 + + +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, DataFactory, DataLakeAnalytics, Databricks, HdInsight, 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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + } + + _subtype_map = { + 'compute_type': {'AKS': 'Aks', 'AmlCompute': 'AmlCompute', 'DataFactory': 'DataFactory', 'DataLakeAnalytics': 'DataLakeAnalytics', 'Databricks': 'Databricks', 'HDInsight': 'HdInsight', 'VirtualMachine': 'VirtualMachine'} + } + + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + **kwargs + ): + super(Compute, self).__init__(**kwargs) + self.compute_type = None + 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 + + +class Aks(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: AKS properties. + :type properties: ~azure.mgmt.machinelearningservices.models.AksProperties + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'AksProperties'}, + } + + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["AksProperties"] = None, + **kwargs + ): + super(Aks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'AKS' + self.properties = properties + + +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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type 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 + + +class AksComputeSecrets(ComputeSecrets): + """Secrets related to a Machine Learning compute based on AKS. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param user_kube_config: Content of kubeconfig file that can be used to connect to the + Kubernetes cluster. + :type user_kube_config: str + :param admin_kube_config: Content of kubeconfig file that can be used to connect to the + Kubernetes cluster. + :type admin_kube_config: str + :param image_pull_secret_name: Image registry pull secret. + :type image_pull_secret_name: str + """ + + _validation = { + 'compute_type': {'required': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + '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 + ): + super(AksComputeSecrets, self).__init__(**kwargs) + self.compute_type = 'AKS' + self.user_kube_config = user_kube_config + self.admin_kube_config = admin_kube_config + self.image_pull_secret_name = image_pull_secret_name + + +class AksNetworkingConfiguration(msrest.serialization.Model): + """Advance configuration for AKS networking. + + :param subnet_id: Virtual network subnet resource ID the compute nodes belong to. + :type subnet_id: str + :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. + :type service_cidr: str + :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :type dns_service_ip: str + :param 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. + :type 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 + ): + 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 AksProperties(msrest.serialization.Model): + """AKS properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param cluster_fqdn: Cluster full qualified domain name. + :type cluster_fqdn: str + :ivar system_services: System services. + :vartype system_services: list[~azure.mgmt.machinelearningservices.models.SystemService] + :param agent_count: Number of agents. + :type agent_count: int + :param agent_vm_size: Agent virtual machine size. + :type agent_vm_size: str + :param ssl_configuration: SSL configuration. + :type ssl_configuration: ~azure.mgmt.machinelearningservices.models.SslConfiguration + :param aks_networking_configuration: AKS networking configuration for vnet. + :type aks_networking_configuration: + ~azure.mgmt.machinelearningservices.models.AksNetworkingConfiguration + """ + + _validation = { + 'system_services': {'readonly': True}, + 'agent_count': {'minimum': 1}, + } + + _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'}, + 'ssl_configuration': {'key': 'sslConfiguration', 'type': 'SslConfiguration'}, + 'aks_networking_configuration': {'key': 'aksNetworkingConfiguration', 'type': 'AksNetworkingConfiguration'}, + } + + def __init__( + self, + *, + cluster_fqdn: Optional[str] = None, + agent_count: Optional[int] = None, + agent_vm_size: Optional[str] = None, + ssl_configuration: Optional["SslConfiguration"] = None, + aks_networking_configuration: Optional["AksNetworkingConfiguration"] = None, + **kwargs + ): + super(AksProperties, 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.ssl_configuration = ssl_configuration + self.aks_networking_configuration = aks_networking_configuration + + +class AmlCompute(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: AML Compute properties. + :type properties: ~azure.mgmt.machinelearningservices.models.AmlComputeProperties + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'AmlComputeProperties'}, + } + + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["AmlComputeProperties"] = None, + **kwargs + ): + super(AmlCompute, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'AmlCompute' + self.properties = properties + + +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 ComputeNodesInformation(msrest.serialization.Model): + """Compute nodes information 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: AmlComputeNodesInformation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :ivar next_link: The continuation token. + :vartype next_link: str + """ + + _validation = { + 'compute_type': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + _subtype_map = { + 'compute_type': {'AmlCompute': 'AmlComputeNodesInformation'} + } + + def __init__( + self, + **kwargs + ): + super(ComputeNodesInformation, self).__init__(**kwargs) + self.compute_type = None + self.next_link = None + + +class AmlComputeNodesInformation(ComputeNodesInformation): + """Compute node information related to a AmlCompute. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :ivar next_link: The continuation token. + :vartype next_link: str + :ivar nodes: The collection of returned AmlCompute nodes details. + :vartype nodes: list[~azure.mgmt.machinelearningservices.models.AmlComputeNodeInformation] + """ + + _validation = { + 'compute_type': {'required': True}, + 'next_link': {'readonly': True}, + 'nodes': {'readonly': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'nodes': {'key': 'nodes', 'type': '[AmlComputeNodeInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(AmlComputeNodesInformation, self).__init__(**kwargs) + self.compute_type = 'AmlCompute' + self.nodes = None + + +class AmlComputeProperties(msrest.serialization.Model): + """AML Compute properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param vm_size: Virtual Machine Size. + :type vm_size: str + :param vm_priority: Virtual Machine priority. Possible values include: "Dedicated", + "LowPriority". + :type vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority + :param scale_settings: Scale settings for AML Compute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + :param user_account_credentials: Credentials for an administrator user account that will be + created on each compute node. + :type user_account_credentials: + ~azure.mgmt.machinelearningservices.models.UserAccountCredentials + :param subnet: Virtual network subnet resource ID the compute nodes belong to. + :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param 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". + :type 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.MachineLearningServiceError] + :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 + """ + + _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 = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, + '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': '[MachineLearningServiceError]'}, + 'current_node_count': {'key': 'currentNodeCount', 'type': 'int'}, + 'target_node_count': {'key': 'targetNodeCount', 'type': 'int'}, + 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, + } + + def __init__( + self, + *, + vm_size: Optional[str] = None, + vm_priority: Optional[Union[str, "VmPriority"]] = 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", + **kwargs + ): + super(AmlComputeProperties, self).__init__(**kwargs) + self.vm_size = vm_size + self.vm_priority = vm_priority + 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 + + +class AmlUserFeature(msrest.serialization.Model): + """Features enabled for a workspace. + + :param id: Specifies the feature ID. + :type id: str + :param display_name: Specifies the feature name. + :type display_name: str + :param description: Describes the feature for user experience. + :type 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 + ): + super(AmlUserFeature, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.description = description + + +class ClusterUpdateParameters(msrest.serialization.Model): + """AmlCompute update parameters. + + :param scale_settings: Desired scale settings for the amlCompute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + """ + + _attribute_map = { + 'scale_settings': {'key': 'properties.scaleSettings', 'type': 'ScaleSettings'}, + } + + def __init__( + self, + *, + scale_settings: Optional["ScaleSettings"] = None, + **kwargs + ): + super(ClusterUpdateParameters, self).__init__(**kwargs) + self.scale_settings = scale_settings + + +class ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user 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(ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class Resource(msrest.serialization.Model): + """Azure Resource Manager resource envelope. + + 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 name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + type_identity_type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.location = location + self.type = None + self.tags = tags + self.sku = sku + self.principal_id = None + self.tenant_id = None + self.type_identity_type = type_identity_type + self.user_assigned_identities = user_assigned_identities + + +class ComputeResource(Resource): + """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 id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param properties: Compute properties. + :type properties: ~azure.mgmt.machinelearningservices.models.Compute + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'properties': {'key': 'properties', 'type': 'Compute'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + type_identity_type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + properties: Optional["Compute"] = None, + **kwargs + ): + super(ComputeResource, self).__init__(location=location, tags=tags, sku=sku, type_identity_type=type_identity_type, user_assigned_identities=user_assigned_identities, **kwargs) + self.properties = properties + + +class Databricks(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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: + :type properties: ~azure.mgmt.machinelearningservices.models.DatabricksProperties + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'DatabricksProperties'}, + } + + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["DatabricksProperties"] = None, + **kwargs + ): + super(Databricks, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'Databricks' + self.properties = properties + + +class DatabricksComputeSecrets(ComputeSecrets): + """Secrets related to a Machine Learning compute based on Databricks. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param databricks_access_token: access token for databricks account. + :type databricks_access_token: str + """ + + _validation = { + 'compute_type': {'required': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + } + + def __init__( + self, + *, + databricks_access_token: Optional[str] = None, + **kwargs + ): + super(DatabricksComputeSecrets, self).__init__(**kwargs) + self.compute_type = 'Databricks' + self.databricks_access_token = databricks_access_token + + +class DatabricksProperties(msrest.serialization.Model): + """DatabricksProperties. + + :param databricks_access_token: Databricks access token. + :type databricks_access_token: str + """ + + _attribute_map = { + 'databricks_access_token': {'key': 'databricksAccessToken', 'type': 'str'}, + } + + def __init__( + self, + *, + databricks_access_token: Optional[str] = None, + **kwargs + ): + super(DatabricksProperties, self).__init__(**kwargs) + self.databricks_access_token = databricks_access_token + + +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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + } + + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + **kwargs + ): + super(DataFactory, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'DataFactory' + + +class DataLakeAnalytics(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param properties: + :type properties: ~azure.mgmt.machinelearningservices.models.DataLakeAnalyticsProperties + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': 'DataLakeAnalyticsProperties'}, + } + + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + properties: Optional["DataLakeAnalyticsProperties"] = None, + **kwargs + ): + super(DataLakeAnalytics, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'DataLakeAnalytics' + self.properties = properties + + +class DataLakeAnalyticsProperties(msrest.serialization.Model): + """DataLakeAnalyticsProperties. + + :param data_lake_store_account_name: DataLake Store Account Name. + :type 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 + ): + super(DataLakeAnalyticsProperties, self).__init__(**kwargs) + self.data_lake_store_account_name = data_lake_store_account_name + + +class ErrorDetail(msrest.serialization.Model): + """Error detail information. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code. + :type code: str + :param message: Required. Error message. + :type 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 + ): + 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 HdInsight(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param ssh_port: Port open for ssh connections on the master node of the cluster. + :type ssh_port: int + :param address: Public IP address of the master node of the cluster. + :type address: str + :param administrator_account: Admin credentials for master node of the cluster. + :type administrator_account: + ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'ssh_port': {'key': 'properties.sshPort', 'type': 'int'}, + 'address': {'key': 'properties.address', 'type': 'str'}, + 'administrator_account': {'key': 'properties.administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + } + + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + ssh_port: Optional[int] = None, + address: Optional[str] = None, + administrator_account: Optional["VirtualMachineSshCredentials"] = None, + **kwargs + ): + super(HdInsight, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'HDInsight' + self.ssh_port = ssh_port + self.address = address + self.administrator_account = administrator_account + + +class KeyVaultProperties(msrest.serialization.Model): + """KeyVaultProperties. + + All required parameters must be populated in order to send to Azure. + + :param key_vault_arm_id: Required. The ArmId of the keyVault where the customer owned + encryption key is present. + :type key_vault_arm_id: str + :param key_identifier: Required. Key vault uri to access the encryption key. + :type key_identifier: str + :param identity_client_id: For future use - The client id of the identity which will be used to + access key vault. + :type 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 + ): + super(KeyVaultProperties, 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 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 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 + """ + + _validation = { + 'user_storage_key': {'readonly': True}, + 'user_storage_resource_id': {'readonly': True}, + 'app_insights_instrumentation_key': {'readonly': True}, + 'container_registry_credentials': {'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'}, + } + + 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 + + +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 MachineLearningServiceError(msrest.serialization.Model): + """Wrapper for error response to follow ARM guidelines. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: The error response. + :vartype error: ~azure.mgmt.machinelearningservices.models.ErrorResponse + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineLearningServiceError, self).__init__(**kwargs) + self.error = 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 Operation(msrest.serialization.Model): + """Azure Machine Learning workspace REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: Display name of operation. + :type display: ~azure.mgmt.machinelearningservices.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDisplay(msrest.serialization.Model): + """Display name of operation. + + :param provider: The resource provider name: Microsoft.MachineLearningExperimentation. + :type provider: str + :param resource: The resource on which the operation is performed. + :type resource: str + :param operation: The operation that users can perform. + :type operation: str + :param description: The description for the operation. + :type 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 + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationListResult(msrest.serialization.Model): + """An array of operations supported by the resource provider. + + :param value: List of AML workspace operations supported by the AML workspace resource + provider. + :type value: list[~azure.mgmt.machinelearningservices.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + + +class PaginatedComputeResourcesList(msrest.serialization.Model): + """Paginated list of Machine Learning compute objects wrapped in ARM resource envelope. + + :param value: An array of Machine Learning compute objects wrapped in ARM resource envelope. + :type value: list[~azure.mgmt.machinelearningservices.models.ComputeResource] + :param next_link: A continuation link (absolute URI) to the next page of results in the list. + :type 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 + ): + super(PaginatedComputeResourcesList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +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 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: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type 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}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + '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, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + type_identity_type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(location=location, tags=tags, sku=sku, type_identity_type=type_identity_type, user_assigned_identities=user_assigned_identities, **kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = 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: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :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] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + '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, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + type_identity_type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(location=location, tags=tags, sku=sku, type_identity_type=type_identity_type, user_assigned_identities=user_assigned_identities, **kwargs) + 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. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.machinelearningservices.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + 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. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", + "Timeout". + :type status: str or + ~azure.mgmt.machinelearningservices.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type 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 + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class QuotaBaseProperties(msrest.serialization.Model): + """The properties for Quota update or retrieval. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Specifies the resource ID. + :type id: str + :param type: Specifies the resource type. + :type type: str + :param limit: The maximum permitted quota of the resource. + :type limit: long + :ivar unit: An enum describing the unit of quota measurement. Default value: "Count". + :vartype unit: str + """ + + _validation = { + 'unit': {'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + unit = "Count" + + def __init__( + self, + *, + id: Optional[str] = None, + type: Optional[str] = None, + limit: Optional[int] = None, + **kwargs + ): + super(QuotaBaseProperties, self).__init__(**kwargs) + self.id = id + self.type = type + self.limit = limit + + +class QuotaUpdateParameters(msrest.serialization.Model): + """Quota update parameters. + + :param value: The list for update quota. + :type value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, + } + + def __init__( + self, + *, + value: Optional[List["QuotaBaseProperties"]] = None, + **kwargs + ): + super(QuotaUpdateParameters, self).__init__(**kwargs) + self.value = value + + +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 + :param passwords: + :type 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 + ): + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.location = None + self.username = None + self.passwords = passwords + + +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. + + :param id: Required. The ID of the resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + **kwargs + ): + 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 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. Default value: "Count". + :vartype unit: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True, 'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + unit = "Count" + + def __init__( + self, + **kwargs + ): + super(ResourceQuota, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.limit = None + self.unit = None + + +class ResourceSkuLocationInfo(msrest.serialization.Model): + """ResourceSkuLocationInfo. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the SKU. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~azure.mgmt.machinelearningservices.models.ResourceSkuZoneDetails] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ResourceSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~azure.mgmt.machinelearningservices.models.SkuCapability] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + +class Restriction(msrest.serialization.Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. As of now only possible value for this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. Possible values include: "NotSpecified", + "NotAvailableForRegion", "NotAvailableForSubscription". + :type reason_code: str or ~azure.mgmt.machinelearningservices.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + *, + reason_code: Optional[Union[str, "ReasonCode"]] = None, + **kwargs + ): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class ScaleSettings(msrest.serialization.Model): + """scale settings for AML Compute. + + All required parameters must be populated in order to send to Azure. + + :param max_node_count: Required. Max number of nodes to use. + :type max_node_count: int + :param min_node_count: Min number of nodes to use. + :type min_node_count: int + :param node_idle_time_before_scale_down: Node Idle Time before scaling down amlCompute. + :type 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 + ): + 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 ServicePrincipalCredentials(msrest.serialization.Model): + """Service principal credentials. + + All required parameters must be populated in order to send to Azure. + + :param client_id: Required. Client Id. + :type client_id: str + :param client_secret: Required. Client secret. + :type client_secret: str + """ + + _validation = { + 'client_id': {'required': True}, + 'client_secret': {'required': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + } + + def __init__( + self, + *, + client_id: str, + client_secret: str, + **kwargs + ): + super(ServicePrincipalCredentials, self).__init__(**kwargs) + self.client_id = client_id + self.client_secret = client_secret + + +class SharedPrivateLinkResource(msrest.serialization.Model): + """SharedPrivateLinkResource. + + :param name: Unique name of the private link. + :type name: str + :param private_link_resource_id: The resource id that private link links to. + :type private_link_resource_id: str + :param group_id: The private link resource group id. + :type group_id: str + :param request_message: Request message. + :type request_message: str + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected", "Disconnected", + "Timeout". + :type 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 + ): + 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): + """Sku of the resource. + + :param name: Name of the sku. + :type name: str + :param tier: Tier of the sku like Basic or Enterprise. + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[str] = None, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class SkuCapability(msrest.serialization.Model): + """Features/user capabilities associated with the sku. + + :param name: Capability/Feature ID. + :type name: str + :param value: Details about the feature/capability. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(SkuCapability, self).__init__(**kwargs) + self.name = name + self.value = value + + +class SkuListResult(msrest.serialization.Model): + """List of skus with features. + + :param value: + :type value: list[~azure.mgmt.machinelearningservices.models.WorkspaceSku] + :param next_link: The URI to fetch the next page of Workspace Skus. Call ListNext() with this + URI to fetch the next page of Workspace Skus. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkspaceSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["WorkspaceSku"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(SkuListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SslConfiguration(msrest.serialization.Model): + """The ssl configuration for scoring. + + :param status: Enable or disable ssl for scoring. Possible values include: "Disabled", + "Enabled". + :type status: str or ~azure.mgmt.machinelearningservices.models.SslConfigurationStatus + :param cert: Cert data. + :type cert: str + :param key: Key data. + :type key: str + :param cname: CNAME of the cert. + :type cname: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'cert': {'key': 'cert', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + 'cname': {'key': 'cname', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "SslConfigurationStatus"]] = None, + cert: Optional[str] = None, + key: Optional[str] = None, + cname: Optional[str] = None, + **kwargs + ): + super(SslConfiguration, self).__init__(**kwargs) + self.status = status + self.cert = cert + self.key = key + self.cname = cname + + +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 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 + :param limit: The maximum permitted quota of the resource. + :type limit: long + :ivar unit: An enum describing the unit of quota measurement. Default value: "Count". + :vartype unit: str + :param status: Status of update workspace quota. Possible values include: "Undefined", + "Success", "Failure", "InvalidQuotaBelowClusterMinimum", + "InvalidQuotaExceedsSubscriptionLimit", "InvalidVMFamilyName", "OperationNotSupportedForSku", + "OperationNotEnabledForRegion". + :type status: str or ~azure.mgmt.machinelearningservices.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True, 'constant': 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'}, + } + + unit = "Count" + + def __init__( + self, + *, + limit: Optional[int] = None, + status: Optional[Union[str, "Status"]] = None, + **kwargs + ): + 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 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 type: Specifies the resource type. + :vartype type: str + :ivar unit: An enum describing the unit of usage measurement. Default value: "Count". + :vartype unit: str + :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}, + 'type': {'readonly': True}, + 'unit': {'readonly': True, 'constant': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', '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'}, + } + + unit = "Count" + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.id = 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. + + :param admin_user_name: Required. Name of the administrator user account which can be used to + SSH to nodes. + :type admin_user_name: str + :param admin_user_ssh_public_key: SSH public key of the administrator user account. + :type admin_user_ssh_public_key: str + :param admin_user_password: Password of the administrator user account. + :type 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 + ): + 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 VirtualMachine(Compute): + """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. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param compute_location: Location for the underlying compute. + :type 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 + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: ~datetime.datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: ~datetime.datetime + :param resource_id: ARM resource id of the underlying compute. + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning. + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :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 + :param virtual_machine_size: Virtual Machine size. + :type virtual_machine_size: str + :param ssh_port: Port open for ssh connections. + :type ssh_port: int + :param address: Public IP address of the virtual machine. + :type address: str + :param administrator_account: Admin credentials for virtual machine. + :type administrator_account: + ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials + """ + + _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': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'virtual_machine_size': {'key': 'properties.virtualMachineSize', 'type': 'str'}, + 'ssh_port': {'key': 'properties.sshPort', 'type': 'int'}, + 'address': {'key': 'properties.address', 'type': 'str'}, + 'administrator_account': {'key': 'properties.administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + } + + def __init__( + self, + *, + compute_location: Optional[str] = None, + description: Optional[str] = None, + resource_id: Optional[str] = None, + virtual_machine_size: Optional[str] = None, + ssh_port: Optional[int] = None, + address: Optional[str] = None, + administrator_account: Optional["VirtualMachineSshCredentials"] = None, + **kwargs + ): + super(VirtualMachine, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.compute_type = 'VirtualMachine' + self.virtual_machine_size = virtual_machine_size + self.ssh_port = ssh_port + self.address = address + self.administrator_account = administrator_account + + +class VirtualMachineSecrets(ComputeSecrets): + """Secrets related to a Machine Learning compute based on AKS. + + All required parameters must be populated in order to send to Azure. + + :param compute_type: Required. The type of compute.Constant filled by server. Possible values + include: "AKS", "AmlCompute", "DataFactory", "VirtualMachine", "HDInsight", "Databricks", + "DataLakeAnalytics". + :type compute_type: str or ~azure.mgmt.machinelearningservices.models.ComputeType + :param administrator_account: Admin credentials for virtual machine. + :type administrator_account: + ~azure.mgmt.machinelearningservices.models.VirtualMachineSshCredentials + """ + + _validation = { + 'compute_type': {'required': True}, + } + + _attribute_map = { + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'administrator_account': {'key': 'administratorAccount', 'type': 'VirtualMachineSshCredentials'}, + } + + def __init__( + self, + *, + administrator_account: Optional["VirtualMachineSshCredentials"] = None, + **kwargs + ): + super(VirtualMachineSecrets, self).__init__(**kwargs) + self.compute_type = 'VirtualMachine' + self.administrator_account = administrator_account + + +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 + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + 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 + + +class VirtualMachineSizeListResult(msrest.serialization.Model): + """The List Virtual Machine size operation response. + + :param aml_compute: The list of virtual machine sizes supported by AmlCompute. + :type aml_compute: list[~azure.mgmt.machinelearningservices.models.VirtualMachineSize] + """ + + _attribute_map = { + 'aml_compute': {'key': 'amlCompute', 'type': '[VirtualMachineSize]'}, + } + + def __init__( + self, + *, + aml_compute: Optional[List["VirtualMachineSize"]] = None, + **kwargs + ): + super(VirtualMachineSizeListResult, self).__init__(**kwargs) + self.aml_compute = aml_compute + + +class VirtualMachineSshCredentials(msrest.serialization.Model): + """Admin credentials for virtual machine. + + :param username: Username of admin account. + :type username: str + :param password: Password of admin account. + :type password: str + :param public_key_data: Public key data. + :type public_key_data: str + :param private_key_data: Private key data. + :type 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 + ): + 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 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: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: A set of tags. Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type_identity_type: str or + ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :ivar workspace_id: The immutable id associated with this workspace. + :vartype workspace_id: str + :param description: The description of this workspace. + :type description: str + :param friendly_name: The friendly name for this workspace. This name in mutable. + :type friendly_name: str + :ivar creation_time: The creation time of the machine learning workspace in ISO8601 format. + :vartype creation_time: ~datetime.datetime + :param key_vault: ARM id of the key vault associated with this workspace. This cannot be + changed once the workspace has been created. + :type key_vault: str + :param application_insights: ARM id of the application insights associated with this workspace. + This cannot be changed once the workspace has been created. + :type application_insights: str + :param container_registry: ARM id of the container registry associated with this workspace. + This cannot be changed once the workspace has been created. + :type container_registry: str + :param storage_account: ARM id of the storage account associated with this workspace. This + cannot be changed once the workspace has been created. + :type storage_account: str + :param discovery_url: Url for the discovery service to identify regional endpoints for machine + learning experimentation services. + :type 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". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.ProvisioningState + :param hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data + collected by the service. + :type 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 + :param image_build_compute: The compute name for image build. + :type image_build_compute: str + :param allow_public_access_when_behind_vnet: The flag to indicate whether to allow public + access when behind VNet. + :type allow_public_access_when_behind_vnet: bool + :ivar private_endpoint_connections: The list of private endpoint connections in the workspace. + :vartype private_endpoint_connections: + list[~azure.mgmt.machinelearningservices.models.PrivateEndpointConnection] + :param shared_private_link_resources: The list of shared private link resources in this + workspace. + :type shared_private_link_resources: + list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] + :param status: Indicates whether or not the encryption is enabled for the workspace. Possible + values include: "Enabled", "Disabled". + :type status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus + :param key_vault_properties: Customer Key vault properties. + :type key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'workspace_id': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'service_provisioned_resource_group': {'readonly': True}, + 'private_link_count': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + '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'}, + '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'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, + 'status': {'key': 'properties.encryption.status', 'type': 'str'}, + 'key_vault_properties': {'key': 'properties.encryption.keyVaultProperties', 'type': 'KeyVaultProperties'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + type_identity_type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = 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, + hbi_workspace: Optional[bool] = False, + image_build_compute: Optional[str] = None, + allow_public_access_when_behind_vnet: Optional[bool] = False, + shared_private_link_resources: Optional[List["SharedPrivateLinkResource"]] = None, + status: Optional[Union[str, "EncryptionStatus"]] = None, + key_vault_properties: Optional["KeyVaultProperties"] = None, + **kwargs + ): + super(Workspace, self).__init__(location=location, tags=tags, sku=sku, type_identity_type=type_identity_type, user_assigned_identities=user_assigned_identities, **kwargs) + self.workspace_id = None + self.description = description + self.friendly_name = friendly_name + self.creation_time = None + 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.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.private_endpoint_connections = None + self.shared_private_link_resources = shared_private_link_resources + self.status = status + self.key_vault_properties = key_vault_properties + + +class WorkspaceListResult(msrest.serialization.Model): + """The result of a request to list machine learning workspaces. + + :param 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. + :type value: list[~azure.mgmt.machinelearningservices.models.Workspace] + :param next_link: The URI that can be used to request the next list of machine learning + workspaces. + :type 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 + ): + super(WorkspaceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WorkspaceSku(msrest.serialization.Model): + """Describes Workspace Sku details and features. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: The set of locations that the SKU is available. This will be supported and + registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those locations where the + SKU is available. + :vartype location_info: + list[~azure.mgmt.machinelearningservices.models.ResourceSkuLocationInfo] + :ivar tier: Sku Tier like Basic or Enterprise. + :vartype tier: str + :ivar resource_type: + :vartype resource_type: str + :ivar name: + :vartype name: str + :ivar capabilities: List of features/user capabilities associated with the sku. + :vartype capabilities: list[~azure.mgmt.machinelearningservices.models.SkuCapability] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :type restrictions: list[~azure.mgmt.machinelearningservices.models.Restriction] + """ + + _validation = { + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': '[SkuCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__( + self, + *, + restrictions: Optional[List["Restriction"]] = None, + **kwargs + ): + super(WorkspaceSku, self).__init__(**kwargs) + self.locations = None + self.location_info = None + self.tier = None + self.resource_type = None + self.name = None + self.capabilities = None + self.restrictions = restrictions + + +class WorkspaceUpdateParameters(msrest.serialization.Model): + """The parameters for updating a machine learning workspace. + + :param tags: A set of tags. The resource tags for the machine learning workspace. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param description: The description of this workspace. + :type description: str + :param friendly_name: The friendly name for this workspace. + :type friendly_name: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + description: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ): + super(WorkspaceUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.sku = sku + self.description = description + self.friendly_name = friendly_name diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/__init__.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/__init__.py new file mode 100644 index 0000000000..2978b00726 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/__init__.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operation_operations import OperationOperations +from ._workspace_operations import WorkspaceOperations +from ._workspace_feature_operations import WorkspaceFeatureOperations +from ._usage_operations import UsageOperations +from ._virtual_machine_size_operations import VirtualMachineSizeOperations +from ._quota_operations import QuotaOperations +from ._machine_learning_compute_operations import MachineLearningComputeOperations +from ._azure_machine_learning_workspaces_operations import AzureMachineLearningWorkspacesOperationsMixin +from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations +from ._private_link_resource_operations import PrivateLinkResourceOperations + +__all__ = [ + 'OperationOperations', + 'WorkspaceOperations', + 'WorkspaceFeatureOperations', + 'UsageOperations', + 'VirtualMachineSizeOperations', + 'QuotaOperations', + 'MachineLearningComputeOperations', + 'AzureMachineLearningWorkspacesOperationsMixin', + 'PrivateEndpointConnectionOperations', + 'PrivateLinkResourceOperations', +] diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py new file mode 100644 index 0000000000..0fe54ef2f5 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_azure_machine_learning_workspaces_operations.py @@ -0,0 +1,90 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AzureMachineLearningWorkspacesOperationsMixin(object): + + def list_sku( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.SkuListResult" + """Lists all skus with associated features. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuListResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.SkuListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SkuListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_sku.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_sku.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_machine_learning_compute_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_machine_learning_compute_operations.py new file mode 100644 index 0000000000..d8ddd00f58 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_machine_learning_compute_operations.py @@ -0,0 +1,676 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MachineLearningComputeOperations(object): + """MachineLearningComputeOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_workspace( + self, + resource_group_name, # type: str + workspace_name, # type: str + skiptoken=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.PaginatedComputeResourcesList" + """Gets computes in specified workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: PaginatedComputeResourcesList or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.PaginatedComputeResourcesList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.PaginatedComputeResourcesList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_workspace.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes'} + + 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: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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}'} + + def _create_or_update_initial( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + type=None, # type: Optional[Union[str, "models.ResourceIdentityType"]] + user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + properties=None, # type: Optional["models.Compute"] + **kwargs # type: Any + ): + # type: (...) -> "models.ComputeResource" + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeResource"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ComputeResource(location=location, tags=tags, sku=sku, type_identity_type=type, user_assigned_identities=user_assigned_identities, properties=properties) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ComputeResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + deserialized = None + 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}'} + + def begin_create_or_update( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + type=None, # type: Optional[Union[str, "models.ResourceIdentityType"]] + user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + properties=None, # type: Optional["models.Compute"] + **kwargs # type: Any + ): + # type: (...) -> "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: Name of the resource group in which workspace is located. + :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 location: Specifies the location of the resource. + :type location: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param type: The identity type. + :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param properties: Compute properties. + :type properties: ~azure.mgmt.machinelearningservices.models.Compute + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns ComputeResource + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeResource"] + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + location=location, + tags=tags, + sku=sku, + type=type, + user_assigned_identities=user_assigned_identities, + properties=properties, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + 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}'} + + def _update_initial( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + scale_settings=None, # type: Optional["models.ScaleSettings"] + **kwargs # type: Any + ): + # type: (...) -> "models.ComputeResource" + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeResource"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ClusterUpdateParameters(scale_settings=scale_settings) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ClusterUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}'} + + def begin_update( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + scale_settings=None, # type: Optional["models.ScaleSettings"] + **kwargs # type: Any + ): + # type: (...) -> "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: Name of the resource group in which workspace is located. + :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 scale_settings: Desired scale settings for the amlCompute. + :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns ComputeResource + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeResource"] + raw_result = self._update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + compute_name=compute_name, + scale_settings=scale_settings, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ComputeResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + 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}'} + + def _delete_initial( + 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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['underlyingResourceAction'] = self._serialize.query("underlying_resource_action", underlying_resource_action, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, 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}'} + + def begin_delete( + 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 + """Deletes specified Machine Learning compute. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + 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}'} + + def list_node( + self, + resource_group_name, # type: str + workspace_name, # type: str + compute_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AmlComputeNodesInformation" + """Get the details (e.g IP address, port etc) of all the compute nodes in the compute. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: AmlComputeNodesInformation or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.AmlComputeNodesInformation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AmlComputeNodesInformation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list_node.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AmlComputeNodesInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_node.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes'} + + def list_key( + 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: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_operation_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_operation_operations.py new file mode 100644 index 0000000000..dd5eb6262e --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_operation_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.OperationListResult" + """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: OperationListResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.OperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.MachineLearningServices/operations'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_private_endpoint_connection_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_private_endpoint_connection_operations.py new file mode 100644 index 0000000000..1d0d3d80d5 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_private_endpoint_connection_operations.py @@ -0,0 +1,259 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionOperations(object): + """PrivateEndpointConnectionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + 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: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def put( + self, + resource_group_name, # type: str + workspace_name, # type: str + private_endpoint_connection_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + type=None, # type: Optional[Union[str, "models.ResourceIdentityType"]] + user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + private_endpoint=None, # type: Optional["models.PrivateEndpoint"] + private_link_service_connection_state=None, # type: Optional["models.PrivateLinkServiceConnectionState"] + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Update the state of specified private endpoint connection associated with the workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 location: Specifies the location of the resource. + :type location: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param type: The identity type. + :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.machinelearningservices.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: ~azure.mgmt.machinelearningservices.models.PrivateLinkServiceConnectionState + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _properties = models.PrivateEndpointConnection(location=location, tags=tags, sku=sku, type_identity_type=type, user_assigned_identities=user_assigned_identities, private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def delete( + 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: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_private_link_resource_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_private_link_resource_operations.py new file mode 100644 index 0000000000..24bc31503b --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_private_link_resource_operations.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourceOperations(object): + """PrivateLinkResourceOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_workspace( + 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: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list_by_workspace.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_quota_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_quota_operations.py new file mode 100644 index 0000000000..bbc9adf2d2 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_quota_operations.py @@ -0,0 +1,177 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class QuotaOperations(object): + """QuotaOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration 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 update( + self, + location, # type: str + value=None, # type: Optional[List["QuotaBaseProperties"]] + **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 value: The list for update quota. + :type value: list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.QuotaUpdateParameters(value=value) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'QuotaUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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'} + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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: ListWorkspaceQuotas or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.ListWorkspaceQuotas + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListWorkspaceQuotas"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_usage_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_usage_operations.py new file mode 100644 index 0000000000..5b91d91b83 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_usage_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsageOperations(object): + """UsageOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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: ListUsagesResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.ListUsagesResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_virtual_machine_size_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_virtual_machine_size_operations.py new file mode 100644 index 0000000000..de5f4f0368 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_virtual_machine_size_operations.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineSizeOperations(object): + """VirtualMachineSizeOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + 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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineSizeListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_workspace_feature_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_workspace_feature_operations.py new file mode 100644 index 0000000000..febbdb8ac5 --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_workspace_feature_operations.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkspaceFeatureOperations(object): + """WorkspaceFeatureOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workspace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ListAmlUserFeatureResult" + """Lists all enabled features for a workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: ListAmlUserFeatureResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.ListAmlUserFeatureResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListAmlUserFeatureResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_workspace_operations.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_workspace_operations.py new file mode 100644 index 0000000000..55e6695f3e --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/operations/_workspace_operations.py @@ -0,0 +1,694 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkspaceOperations(object): + """WorkspaceOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.machinelearningservices.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + workspace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Workspace" + """Gets the properties of the specified machine learning workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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}'} + + def _create_or_update_initial( + self, + resource_group_name, # type: str + workspace_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + type=None, # type: Optional[Union[str, "models.ResourceIdentityType"]] + user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + description=None, # type: Optional[str] + friendly_name=None, # type: Optional[str] + key_vault=None, # type: Optional[str] + application_insights=None, # type: Optional[str] + container_registry=None, # type: Optional[str] + storage_account=None, # type: Optional[str] + discovery_url=None, # type: Optional[str] + hbi_workspace=False, # type: Optional[bool] + image_build_compute=None, # type: Optional[str] + allow_public_access_when_behind_vnet=False, # type: Optional[bool] + shared_private_link_resources=None, # type: Optional[List["SharedPrivateLinkResource"]] + status=None, # type: Optional[Union[str, "models.EncryptionStatus"]] + key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] + **kwargs # type: Any + ): + # type: (...) -> "models.Workspace" + cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.Workspace(location=location, tags=tags, sku=sku, type_identity_type=type, user_assigned_identities=user_assigned_identities, description=description, friendly_name=friendly_name, key_vault=key_vault, application_insights=application_insights, container_registry=container_registry, storage_account=storage_account, discovery_url=discovery_url, hbi_workspace=hbi_workspace, image_build_compute=image_build_compute, allow_public_access_when_behind_vnet=allow_public_access_when_behind_vnet, shared_private_link_resources=shared_private_link_resources, status=status, key_vault_properties=key_vault_properties) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'Workspace') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workspace', pipeline_response) + + if response.status_code == 201: + 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}'} + + def begin_create_or_update( + self, + resource_group_name, # type: str + workspace_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + type=None, # type: Optional[Union[str, "models.ResourceIdentityType"]] + user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + description=None, # type: Optional[str] + friendly_name=None, # type: Optional[str] + key_vault=None, # type: Optional[str] + application_insights=None, # type: Optional[str] + container_registry=None, # type: Optional[str] + storage_account=None, # type: Optional[str] + discovery_url=None, # type: Optional[str] + hbi_workspace=False, # type: Optional[bool] + image_build_compute=None, # type: Optional[str] + allow_public_access_when_behind_vnet=False, # type: Optional[bool] + shared_private_link_resources=None, # type: Optional[List["SharedPrivateLinkResource"]] + status=None, # type: Optional[Union[str, "models.EncryptionStatus"]] + key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] + **kwargs # type: Any + ): + # type: (...) -> "models.Workspace" + """Creates or updates a workspace with the specified parameters. + + :param resource_group_name: Name of the resource group in which workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param location: Specifies the location of the resource. + :type location: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param type: The identity type. + :type type: str or ~azure.mgmt.machinelearningservices.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with resource. The user + identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.machinelearningservices.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :param description: The description of this workspace. + :type description: str + :param friendly_name: The friendly name for this workspace. This name in mutable. + :type friendly_name: str + :param key_vault: ARM id of the key vault associated with this workspace. This cannot be + changed once the workspace has been created. + :type key_vault: str + :param application_insights: ARM id of the application insights associated with this workspace. + This cannot be changed once the workspace has been created. + :type application_insights: str + :param container_registry: ARM id of the container registry associated with this workspace. + This cannot be changed once the workspace has been created. + :type container_registry: str + :param storage_account: ARM id of the storage account associated with this workspace. This + cannot be changed once the workspace has been created. + :type storage_account: str + :param discovery_url: Url for the discovery service to identify regional endpoints for machine + learning experimentation services. + :type discovery_url: str + :param hbi_workspace: The flag to signal HBI data in the workspace and reduce diagnostic data + collected by the service. + :type hbi_workspace: bool + :param image_build_compute: The compute name for image build. + :type image_build_compute: str + :param allow_public_access_when_behind_vnet: The flag to indicate whether to allow public + access when behind VNet. + :type allow_public_access_when_behind_vnet: bool + :param shared_private_link_resources: The list of shared private link resources in this + workspace. + :type shared_private_link_resources: list[~azure.mgmt.machinelearningservices.models.SharedPrivateLinkResource] + :param status: Indicates whether or not the encryption is enabled for the workspace. + :type status: str or ~azure.mgmt.machinelearningservices.models.EncryptionStatus + :param key_vault_properties: Customer Key vault properties. + :type key_vault_properties: ~azure.mgmt.machinelearningservices.models.KeyVaultProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns Workspace + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.Workspace] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Workspace"] + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + location=location, + tags=tags, + sku=sku, + type=type, + user_assigned_identities=user_assigned_identities, + description=description, + friendly_name=friendly_name, + key_vault=key_vault, + application_insights=application_insights, + container_registry=container_registry, + storage_account=storage_account, + discovery_url=discovery_url, + hbi_workspace=hbi_workspace, + image_build_compute=image_build_compute, + allow_public_access_when_behind_vnet=allow_public_access_when_behind_vnet, + shared_private_link_resources=shared_private_link_resources, + status=status, + key_vault_properties=key_vault_properties, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Workspace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + 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}'} + + def delete( + self, + resource_group_name, # type: str + workspace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a machine learning workspace. + + :param resource_group_name: Name of the resource group in which workspace is located. + :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: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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}'} + + def update( + self, + resource_group_name, # type: str + workspace_name, # type: str + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.Sku"] + description=None, # type: Optional[str] + friendly_name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Workspace" + """Updates a machine learning workspace with the specified parameters. + + :param resource_group_name: Name of the resource group in which workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param tags: The resource tags for the machine learning workspace. + :type tags: dict[str, str] + :param sku: The sku of the workspace. + :type sku: ~azure.mgmt.machinelearningservices.models.Sku + :param description: The description of this workspace. + :type description: str + :param friendly_name: The friendly name for this workspace. + :type friendly_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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.WorkspaceUpdateParameters(tags=tags, sku=sku, description=description, friendly_name=friendly_name) + api_version = "2020-04-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'WorkspaceUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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 + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + skiptoken=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkspaceListResult" + """Lists all the available machine learning workspaces under the specified resource group. + + :param resource_group_name: Name of the resource group in which workspace is located. + :type resource_group_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: WorkspaceListResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces'} + + def list_key( + 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: Name of the resource group in which workspace is located. + :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 = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.list_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, 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_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys'} + + def resync_key( + self, + resource_group_name, # type: str + workspace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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: Name of the resource group in which workspace is located. + :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: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + # Construct URL + url = self.resync_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.MachineLearningServiceError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resync_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys'} + + def list_by_subscription( + self, + skiptoken=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkspaceListResult" + """Lists all the available machine learning workspaces under the specified subscription. + + :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: WorkspaceListResult or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.WorkspaceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkspaceListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-04-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + 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(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.MachineLearningServiceError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces'} diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/py.typed b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/py.typed new file mode 100644 index 0000000000..e5aff4f83a --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/setup.py b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/setup.py new file mode 100644 index 0000000000..f03d43734a --- /dev/null +++ b/src/machinelearningservices/azext_machinelearningservices/vendored_sdks/machinelearningservices/setup.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# coding: utf-8 + +from setuptools import setup, find_packages + +NAME = "azuremachinelearningworkspaces" +VERSION = "0.1.0" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["msrest>=0.6.0", "azure-core<2.0.0,>=1.2.0"] + +setup( + name=NAME, + version=VERSION, + description="AzureMachineLearningWorkspaces", + author_email="", + url="", + keywords=["Swagger", "AzureMachineLearningWorkspaces"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + These APIs allow end users to operate on Azure Machine Learning Workspace resources. + """ +) diff --git a/src/machinelearningservices/report.md b/src/machinelearningservices/report.md new file mode 100644 index 0000000000..4a8deb0345 --- /dev/null +++ b/src/machinelearningservices/report.md @@ -0,0 +1,351 @@ +# Azure CLI Module Creation Report + +### machinelearningservices list-sku + +list-sku a machinelearningservices . + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +### machinelearningservices machine-learning-compute aks create + +aks create a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +|**--location**|string|Specifies the location of the resource.|location| +|**--tags**|dictionary|Contains resource tags defined as key/value pairs.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| +|**--compute-location**|string|Location for the underlying compute|aks_compute_location| +|**--description**|string|The description of the Machine Learning compute.|aks_description| +|**--resource-id**|string|ARM resource id of the underlying compute|aks_resource_id| +|**--aks-properties**|object|AKS properties|aks_properties| +### machinelearningservices machine-learning-compute aml-compute create + +aml-compute create a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +|**--location**|string|Specifies the location of the resource.|location| +|**--tags**|dictionary|Contains resource tags defined as key/value pairs.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| +|**--compute-location**|string|Location for the underlying compute|aml_compute_compute_location| +|**--description**|string|The description of the Machine Learning compute.|aml_compute_description| +|**--resource-id**|string|ARM resource id of the underlying compute|aml_compute_resource_id| +|**--aml-compute-properties**|object|AML Compute properties|aml_compute_properties| +### machinelearningservices machine-learning-compute data-factory create + +data-factory create a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +|**--location**|string|Specifies the location of the resource.|location| +|**--tags**|dictionary|Contains resource tags defined as key/value pairs.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| +|**--compute-location**|string|Location for the underlying compute|data_factory_compute_location| +|**--description**|string|The description of the Machine Learning compute.|data_factory_description| +|**--resource-id**|string|ARM resource id of the underlying compute|data_factory_resource_id| +### machinelearningservices machine-learning-compute data-lake-analytics create + +data-lake-analytics create a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +|**--location**|string|Specifies the location of the resource.|location| +|**--tags**|dictionary|Contains resource tags defined as key/value pairs.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| +|**--compute-location**|string|Location for the underlying compute|data_lake_analytics_compute_location| +|**--description**|string|The description of the Machine Learning compute.|data_lake_analytics_description| +|**--resource-id**|string|ARM resource id of the underlying compute|data_lake_analytics_resource_id| +|**--data-lake-analytics-properties**|object||data_lake_analytics_properties| +### machinelearningservices machine-learning-compute databricks create + +databricks create a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +|**--location**|string|Specifies the location of the resource.|location| +|**--tags**|dictionary|Contains resource tags defined as key/value pairs.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| +|**--compute-location**|string|Location for the underlying compute|databricks_compute_location| +|**--description**|string|The description of the Machine Learning compute.|databricks_description| +|**--resource-id**|string|ARM resource id of the underlying compute|databricks_resource_id| +|**--databricks-properties**|object||databricks_properties| +### machinelearningservices machine-learning-compute delete + +delete a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +|**--underlying-resource-action**|choice|Delete the underlying compute if 'Delete', or detach the underlying compute from workspace if 'Detach'.|underlying_resource_action| +### machinelearningservices machine-learning-compute hd-insight create + +hd-insight create a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +|**--location**|string|Specifies the location of the resource.|location| +|**--tags**|dictionary|Contains resource tags defined as key/value pairs.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| +|**--compute-location**|string|Location for the underlying compute|hd_insight_compute_location| +|**--description**|string|The description of the Machine Learning compute.|hd_insight_description| +|**--resource-id**|string|ARM resource id of the underlying compute|hd_insight_resource_id| +|**--ssh-port**|integer|Port open for ssh connections on the master node of the cluster.|hd_insight_ssh_port| +|**--address**|string|Public IP address of the master node of the cluster.|hd_insight_address| +|**--administrator-account**|object|Admin credentials for master node of the cluster|hd_insight_administrator_account| +### machinelearningservices machine-learning-compute list + +list a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--skiptoken**|string|Continuation token for pagination.|skiptoken| +### machinelearningservices machine-learning-compute list-key + +list-key a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +### machinelearningservices machine-learning-compute list-node + +list-node a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +### machinelearningservices machine-learning-compute show + +show a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +### machinelearningservices machine-learning-compute update + +update a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +|**--scale-settings**|object|Desired scale settings for the amlCompute.|scale_settings| +### machinelearningservices machine-learning-compute virtual-machine create + +virtual-machine create a machinelearningservices machine-learning-compute. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--compute-name**|string|Name of the Azure Machine Learning compute.|compute_name| +|**--location**|string|Specifies the location of the resource.|location| +|**--tags**|dictionary|Contains resource tags defined as key/value pairs.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| +|**--compute-location**|string|Location for the underlying compute|virtual_machine_compute_location| +|**--description**|string|The description of the Machine Learning compute.|virtual_machine_description| +|**--resource-id**|string|ARM resource id of the underlying compute|virtual_machine_resource_id| +|**--virtual-machine-size**|string|Virtual Machine size|virtual_machine_virtual_machine_size| +|**--ssh-port**|integer|Port open for ssh connections.|virtual_machine_ssh_port| +|**--address**|string|Public IP address of the virtual machine.|virtual_machine_address| +|**--administrator-account**|object|Admin credentials for virtual machine|virtual_machine_administrator_account| +### machinelearningservices private-endpoint-connection delete + +delete a machinelearningservices private-endpoint-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--private-endpoint-connection-name**|string|The name of the private endpoint connection associated with the workspace|private_endpoint_connection_name| +### machinelearningservices private-endpoint-connection put + +put a machinelearningservices private-endpoint-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--private-endpoint-connection-name**|string|The name of the private endpoint connection associated with the workspace|private_endpoint_connection_name| +|**--location**|string|Specifies the location of the resource.|location| +|**--tags**|dictionary|Contains resource tags defined as key/value pairs.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| +|**--private-endpoint**|object|The resource of private end point.|private_endpoint| +|**--private-link-service-connection-state**|object|A collection of information about the state of the connection between service consumer and provider.|private_link_service_connection_state| +### machinelearningservices private-endpoint-connection show + +show a machinelearningservices private-endpoint-connection. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--private-endpoint-connection-name**|string|The name of the private endpoint connection associated with the workspace|private_endpoint_connection_name| +### machinelearningservices private-link-resource list + +list a machinelearningservices private-link-resource. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +### machinelearningservices quota list + +list a machinelearningservices quota. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--location**|string|The location for which resource usage is queried.|location| +### machinelearningservices quota update + +update a machinelearningservices quota. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--location**|string|The location for update quota is queried.|location| +|**--value**|array|The list for update quota.|value| +### machinelearningservices usage list + +list a machinelearningservices usage. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--location**|string|The location for which resource usage is queried.|location| +### machinelearningservices virtual-machine-size list + +list a machinelearningservices virtual-machine-size. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--location**|string|The location upon which virtual-machine-sizes is queried.|location| +### machinelearningservices workspace create + +create a machinelearningservices workspace. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--location**|string|Specifies the location of the resource.|location| +|**--tags**|dictionary|Contains resource tags defined as key/value pairs.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--identity-type**|sealed-choice|The identity type.|type_identity_type| +|**--identity-user-assigned-identities**|dictionary|The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.|user_assigned_identities| +|**--description**|string|The description of this workspace.|description| +|**--friendly-name**|string|The friendly name for this workspace. This name in mutable|friendly_name| +|**--key-vault**|string|ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created|key_vault| +|**--application-insights**|string|ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created|application_insights| +|**--container-registry**|string|ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created|container_registry| +|**--storage-account**|string|ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created|storage_account| +|**--discovery-url**|string|Url for the discovery service to identify regional endpoints for machine learning experimentation services|discovery_url| +|**--hbi-workspace**|boolean|The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service|hbi_workspace| +|**--image-build-compute**|string|The compute name for image build|image_build_compute| +|**--allow-public-access-when-behind-vnet**|boolean|The flag to indicate whether to allow public access when behind VNet.|allow_public_access_when_behind_vnet| +|**--shared-private-link-resources**|array|The list of shared private link resources in this workspace.|shared_private_link_resources| +|**--encryption-status**|choice|Indicates whether or not the encryption is enabled for the workspace.|status| +|**--encryption-key-vault-properties**|object|Customer Key vault properties.|key_vault_properties| +### machinelearningservices workspace delete + +delete a machinelearningservices workspace. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +### machinelearningservices workspace list + +list a machinelearningservices workspace. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--skiptoken**|string|Continuation token for pagination.|skiptoken| +### machinelearningservices workspace list-key + +list-key a machinelearningservices workspace. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +### machinelearningservices workspace resync-key + +resync-key a machinelearningservices workspace. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +### machinelearningservices workspace show + +show a machinelearningservices workspace. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +### machinelearningservices workspace update + +update a machinelearningservices workspace. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| +|**--tags**|dictionary|The resource tags for the machine learning workspace.|tags| +|**--sku**|object|The sku of the workspace.|sku| +|**--description**|string|The description of this workspace.|description| +|**--friendly-name**|string|The friendly name for this workspace.|friendly_name| +### machinelearningservices workspace-feature list + +list a machinelearningservices workspace-feature. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource-group-name**|string|Name of the resource group in which workspace is located.|resource_group_name| +|**--workspace-name**|string|Name of Azure Machine Learning workspace.|workspace_name| \ No newline at end of file diff --git a/src/machinelearningservices/setup.cfg b/src/machinelearningservices/setup.cfg new file mode 100644 index 0000000000..2fdd96e5d3 --- /dev/null +++ b/src/machinelearningservices/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/machinelearningservices/setup.py b/src/machinelearningservices/setup.py new file mode 100644 index 0000000000..f2e66878eb --- /dev/null +++ b/src/machinelearningservices/setup.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# TODO: Confirm this is the right version number you want and it matches your +# HISTORY.rst entry. +VERSION = '0.1.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = [] + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='machinelearningservices', + version=VERSION, + description='Microsoft Azure Command-Line Tools AzureMachineLearningWorkspaces Extension', + # TODO: Update author and email, if applicable + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + # TODO: consider pointing directly to your source code instead of the generic repo + url='https://github.com/Azure/azure-cli-extensions', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_machinelearningservices': ['azext_metadata.json']}, +)