From 8ba16937516fa47aaa82c45e129b2095144ccd48 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 20 May 2022 14:22:05 +0000 Subject: [PATCH] CodeGen from PR 18645 in Azure/azure-rest-api-specs Merge ccb7192b1bf9cd615aeeef1dc676a34a115409f1 into ace0542cdd24df36b68203f754b1e7a4a1883014 --- .../arm-workspaces/CHANGELOG.md | 27 ------ sdk/machinelearning/arm-workspaces/_meta.json | 10 +- .../arm-workspaces/package.json | 22 ++--- .../node/my_test/recording_sample_test.js | 5 - sdk/machinelearning/arm-workspaces/sample.env | 4 - .../samples-dev/listWorkspaceKeys.ts | 36 ------- .../samples-dev/resyncStorageKeys.ts | 36 ------- .../samples-dev/workspaceCreate.ts | 48 ---------- .../samples-dev/workspaceDelete.ts | 36 ------- .../samples-dev/workspaceGet.ts | 33 ------- .../samples-dev/workspaceGetBySubscription.ts | 34 ------- .../samples-dev/workspaceListResourceGroup.ts | 37 -------- .../samples-dev/workspaceUpdate.ts | 45 --------- .../workspacesCreateOrUpdateSample.ts | 48 ---------- .../samples-dev/workspacesDeleteSample.ts | 36 ------- .../samples-dev/workspacesGetSample.ts | 33 ------- .../workspacesListByResourceGroupSample.ts | 37 -------- .../samples-dev/workspacesListSample.ts | 34 ------- .../workspacesListWorkspaceKeysSample.ts | 36 ------- .../workspacesResyncStorageKeysSample.ts | 36 ------- .../samples-dev/workspacesUpdateSample.ts | 45 --------- .../samples/v1/javascript/README.md | 80 ---------------- .../v1/javascript/listWorkspaceKeys.js | 30 ------ .../samples/v1/javascript/package.json | 32 ------- .../v1/javascript/resyncStorageKeys.js | 30 ------ .../samples/v1/javascript/sample.env | 4 - .../samples/v1/javascript/workspaceCreate.js | 42 --------- .../samples/v1/javascript/workspaceDelete.js | 30 ------ .../samples/v1/javascript/workspaceGet.js | 30 ------ .../javascript/workspaceGetBySubscription.js | 31 ------- .../javascript/workspaceListResourceGroup.js | 32 ------- .../samples/v1/javascript/workspaceUpdate.js | 35 ------- .../workspacesCreateOrUpdateSample.js | 42 --------- .../v1/javascript/workspacesDeleteSample.js | 30 ------ .../v1/javascript/workspacesGetSample.js | 30 ------ .../workspacesListByResourceGroupSample.js | 32 ------- .../v1/javascript/workspacesListSample.js | 31 ------- .../workspacesListWorkspaceKeysSample.js | 30 ------ .../workspacesResyncStorageKeysSample.js | 30 ------ .../v1/javascript/workspacesUpdateSample.js | 35 ------- .../samples/v1/typescript/README.md | 93 ------------------- .../samples/v1/typescript/package.json | 41 -------- .../samples/v1/typescript/sample.env | 4 - .../v1/typescript/src/listWorkspaceKeys.ts | 36 ------- .../v1/typescript/src/resyncStorageKeys.ts | 36 ------- .../v1/typescript/src/workspaceCreate.ts | 48 ---------- .../v1/typescript/src/workspaceDelete.ts | 36 ------- .../samples/v1/typescript/src/workspaceGet.ts | 33 ------- .../src/workspaceGetBySubscription.ts | 34 ------- .../src/workspaceListResourceGroup.ts | 37 -------- .../v1/typescript/src/workspaceUpdate.ts | 45 --------- .../src/workspacesCreateOrUpdateSample.ts | 48 ---------- .../typescript/src/workspacesDeleteSample.ts | 36 ------- .../v1/typescript/src/workspacesGetSample.ts | 33 ------- .../workspacesListByResourceGroupSample.ts | 37 -------- .../v1/typescript/src/workspacesListSample.ts | 34 ------- .../src/workspacesListWorkspaceKeysSample.ts | 36 ------- .../src/workspacesResyncStorageKeysSample.ts | 36 ------- .../typescript/src/workspacesUpdateSample.ts | 45 --------- .../samples/v1/typescript/tsconfig.json | 17 ---- ...chineLearningWorkspacesManagementClient.ts | 36 ++++++- .../arm-workspaces/test/sampleTest.ts | 39 ++++---- .../arm-workspaces/tsconfig.json | 12 +-- 63 files changed, 69 insertions(+), 2097 deletions(-) delete mode 100644 sdk/machinelearning/arm-workspaces/CHANGELOG.md delete mode 100644 sdk/machinelearning/arm-workspaces/recordings/node/my_test/recording_sample_test.js delete mode 100644 sdk/machinelearning/arm-workspaces/sample.env delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/listWorkspaceKeys.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/resyncStorageKeys.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspaceCreate.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspaceDelete.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspaceGet.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspaceGetBySubscription.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspaceListResourceGroup.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspaceUpdate.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspacesCreateOrUpdateSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspacesDeleteSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspacesGetSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspacesListByResourceGroupSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspacesListSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspacesListWorkspaceKeysSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspacesResyncStorageKeysSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples-dev/workspacesUpdateSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/README.md delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/listWorkspaceKeys.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/package.json delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/resyncStorageKeys.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/sample.env delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceCreate.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceDelete.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGet.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGetBySubscription.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceListResourceGroup.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceUpdate.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesCreateOrUpdateSample.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesDeleteSample.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesGetSample.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListByResourceGroupSample.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListSample.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListWorkspaceKeysSample.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesResyncStorageKeysSample.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesUpdateSample.js delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/README.md delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/package.json delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/sample.env delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/listWorkspaceKeys.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/resyncStorageKeys.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceCreate.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceDelete.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGet.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGetBySubscription.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceListResourceGroup.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceUpdate.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesCreateOrUpdateSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesDeleteSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesGetSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListByResourceGroupSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListWorkspaceKeysSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesResyncStorageKeysSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesUpdateSample.ts delete mode 100644 sdk/machinelearning/arm-workspaces/samples/v1/typescript/tsconfig.json diff --git a/sdk/machinelearning/arm-workspaces/CHANGELOG.md b/sdk/machinelearning/arm-workspaces/CHANGELOG.md deleted file mode 100644 index 6180e93a2c55..000000000000 --- a/sdk/machinelearning/arm-workspaces/CHANGELOG.md +++ /dev/null @@ -1,27 +0,0 @@ -# Release History - -## 1.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.1 (2022-04-24) - -**Features** - - - Bug fix - -## 1.0.0 (2022-01-19) - -The package of @azure/arm-workspaces is using our next generation design principles since version 1.0.0, which contains breaking changes. - -To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). - -To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). - -To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/machinelearning/arm-workspaces/_meta.json b/sdk/machinelearning/arm-workspaces/_meta.json index 6889a98dfb30..964ebec6c04b 100644 --- a/sdk/machinelearning/arm-workspaces/_meta.json +++ b/sdk/machinelearning/arm-workspaces/_meta.json @@ -1,8 +1,8 @@ { - "commit": "1b0a465061c68175898f8f5d27f0301f42ce994c", - "readme": "specification\\machinelearning\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\machinelearning\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "a9ffcb97dd19a2d206c0c8a6c1973877fc60ee49", + "readme": "specification/machinelearning/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/machinelearning/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/machinelearning/arm-workspaces/package.json b/sdk/machinelearning/arm-workspaces/package.json index ca72025e305e..ebf5754aaa05 100644 --- a/sdk/machinelearning/arm-workspaces/package.json +++ b/sdk/machinelearning/arm-workspaces/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for MachineLearningWorkspacesManagementClient.", - "version": "1.0.2", + "version": "1.0.3", "engines": { "node": ">=12.0.0" }, @@ -38,9 +38,11 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/machinelearning/arm-workspaces", "repository": { @@ -91,7 +93,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -104,13 +106,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-workspaces?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/machinelearning/arm-workspaces/recordings/node/my_test/recording_sample_test.js b/sdk/machinelearning/arm-workspaces/recordings/node/my_test/recording_sample_test.js deleted file mode 100644 index 0f6ecb857acf..000000000000 --- a/sdk/machinelearning/arm-workspaces/recordings/node/my_test/recording_sample_test.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/machinelearning/arm-workspaces/sample.env b/sdk/machinelearning/arm-workspaces/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/machinelearning/arm-workspaces/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/listWorkspaceKeys.ts b/sdk/machinelearning/arm-workspaces/samples-dev/listWorkspaceKeys.ts deleted file mode 100644 index 9551cd959beb..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/listWorkspaceKeys.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to List the authorization keys associated with this workspace. - * - * @summary List the authorization keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listWorkspaceKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.listWorkspaceKeys( - workspaceName, - resourceGroupName - ); - console.log(result); -} - -listWorkspaceKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/resyncStorageKeys.ts b/sdk/machinelearning/arm-workspaces/samples-dev/resyncStorageKeys.ts deleted file mode 100644 index 5a62fe61a086..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/resyncStorageKeys.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Resync storage keys associated with this workspace. - * - * @summary Resync storage keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function resyncStorageKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.resyncStorageKeys( - workspaceName, - resourceGroupName - ); - console.log(result); -} - -resyncStorageKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceCreate.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspaceCreate.ts deleted file mode 100644 index a3140421fd47..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceCreate.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Creates or updates a workspace with the specified parameters. - * - * @summary Creates or updates a workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json - */ -import { - Workspace, - MachineLearningWorkspacesManagementClient -} from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceCreate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters: Workspace = { - location: "West Europe", - ownerEmail: "abc@microsoft.com", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" }, - userStorageAccountId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/teststorage" - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.createOrUpdate( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceCreate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceDelete.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspaceDelete.ts deleted file mode 100644 index a04cf7db0a4b..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceDelete.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes a machine learning workspace. - * - * @summary Deletes a machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.delete( - resourceGroupName, - workspaceName - ); - console.log(result); -} - -workspaceDelete().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceGet.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspaceGet.ts deleted file mode 100644 index 380124c43262..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceGet.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the properties of the specified machine learning workspace. - * - * @summary Gets the properties of the specified machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceGet() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.get(resourceGroupName, workspaceName); - console.log(result); -} - -workspaceGet().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceGetBySubscription.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspaceGetBySubscription.ts deleted file mode 100644 index 18d9c463d359..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceGetBySubscription.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified subscription. - * - * @summary Lists all the available machine learning workspaces under the specified subscription. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceGetBySubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.workspaces.list()) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceGetBySubscription().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceListResourceGroup.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspaceListResourceGroup.ts deleted file mode 100644 index 20532c840e89..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceListResourceGroup.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified resource group. - * - * @summary Lists all the available machine learning workspaces under the specified resource group. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceListResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.workspaces.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceListResourceGroup().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceUpdate.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspaceUpdate.ts deleted file mode 100644 index badba0bae2da..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspaceUpdate.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Updates a machine learning workspace with the specified parameters. - * - * @summary Updates a machine learning workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json - */ -import { - WorkspaceUpdateParameters, - MachineLearningWorkspacesManagementClient -} from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceUpdate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters: WorkspaceUpdateParameters = { - keyVaultIdentifierId: "kvidnew", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.update( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceUpdate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesCreateOrUpdateSample.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspacesCreateOrUpdateSample.ts deleted file mode 100644 index cf7d121b95dc..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesCreateOrUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Workspace, - MachineLearningWorkspacesManagementClient -} from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a workspace with the specified parameters. - * - * @summary Creates or updates a workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json - */ -async function workspaceCreate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters: Workspace = { - location: "West Europe", - ownerEmail: "abc@microsoft.com", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" }, - userStorageAccountId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/teststorage" - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.createOrUpdate( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceCreate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesDeleteSample.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspacesDeleteSample.ts deleted file mode 100644 index 75b69937de3d..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a machine learning workspace. - * - * @summary Deletes a machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json - */ -async function workspaceDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.delete( - resourceGroupName, - workspaceName - ); - console.log(result); -} - -workspaceDelete().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesGetSample.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspacesGetSample.ts deleted file mode 100644 index 727911110d3c..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the properties of the specified machine learning workspace. - * - * @summary Gets the properties of the specified machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json - */ -async function workspaceGet() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.get(resourceGroupName, workspaceName); - console.log(result); -} - -workspaceGet().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesListByResourceGroupSample.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspacesListByResourceGroupSample.ts deleted file mode 100644 index 8138ca92226e..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesListByResourceGroupSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified resource group. - * - * @summary Lists all the available machine learning workspaces under the specified resource group. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json - */ -async function workspaceListResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.workspaces.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceListResourceGroup().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesListSample.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspacesListSample.ts deleted file mode 100644 index 1b78f4e73734..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified subscription. - * - * @summary Lists all the available machine learning workspaces under the specified subscription. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json - */ -async function workspaceGetBySubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.workspaces.list()) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceGetBySubscription().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesListWorkspaceKeysSample.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspacesListWorkspaceKeysSample.ts deleted file mode 100644 index eea63e0ab4a8..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesListWorkspaceKeysSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List the authorization keys associated with this workspace. - * - * @summary List the authorization keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json - */ -async function listWorkspaceKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.listWorkspaceKeys( - workspaceName, - resourceGroupName - ); - console.log(result); -} - -listWorkspaceKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesResyncStorageKeysSample.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspacesResyncStorageKeysSample.ts deleted file mode 100644 index 2e54040ce305..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesResyncStorageKeysSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Resync storage keys associated with this workspace. - * - * @summary Resync storage keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json - */ -async function resyncStorageKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.resyncStorageKeys( - workspaceName, - resourceGroupName - ); - console.log(result); -} - -resyncStorageKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesUpdateSample.ts b/sdk/machinelearning/arm-workspaces/samples-dev/workspacesUpdateSample.ts deleted file mode 100644 index bb3adce7d2ef..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples-dev/workspacesUpdateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - WorkspaceUpdateParameters, - MachineLearningWorkspacesManagementClient -} from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates a machine learning workspace with the specified parameters. - * - * @summary Updates a machine learning workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json - */ -async function workspaceUpdate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters: WorkspaceUpdateParameters = { - keyVaultIdentifierId: "kvidnew", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.update( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceUpdate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/README.md b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/README.md deleted file mode 100644 index d8bff6630bf1..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [listWorkspaceKeys.js][listworkspacekeys] | List the authorization keys associated with this workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json | -| [resyncStorageKeys.js][resyncstoragekeys] | Resync storage keys associated with this workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json | -| [workspaceCreate.js][workspacecreate] | Creates or updates a workspace with the specified parameters. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json | -| [workspaceDelete.js][workspacedelete] | Deletes a machine learning workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json | -| [workspaceGet.js][workspaceget] | Gets the properties of the specified machine learning workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json | -| [workspaceGetBySubscription.js][workspacegetbysubscription] | Lists all the available machine learning workspaces under the specified subscription. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json | -| [workspaceListResourceGroup.js][workspacelistresourcegroup] | Lists all the available machine learning workspaces under the specified resource group. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json | -| [workspaceUpdate.js][workspaceupdate] | Updates a machine learning workspace with the specified parameters. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json | -| [workspacesCreateOrUpdateSample.js][workspacescreateorupdatesample] | Creates or updates a workspace with the specified parameters. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json | -| [workspacesDeleteSample.js][workspacesdeletesample] | Deletes a machine learning workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json | -| [workspacesGetSample.js][workspacesgetsample] | Gets the properties of the specified machine learning workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json | -| [workspacesListByResourceGroupSample.js][workspaceslistbyresourcegroupsample] | Lists all the available machine learning workspaces under the specified resource group. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json | -| [workspacesListSample.js][workspaceslistsample] | Lists all the available machine learning workspaces under the specified subscription. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json | -| [workspacesListWorkspaceKeysSample.js][workspaceslistworkspacekeyssample] | List the authorization keys associated with this workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json | -| [workspacesResyncStorageKeysSample.js][workspacesresyncstoragekeyssample] | Resync storage keys associated with this workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json | -| [workspacesUpdateSample.js][workspacesupdatesample] | Updates a machine learning workspace with the specified parameters. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node listWorkspaceKeys.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node listWorkspaceKeys.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[listworkspacekeys]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/listWorkspaceKeys.js -[resyncstoragekeys]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/resyncStorageKeys.js -[workspacecreate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceCreate.js -[workspacedelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceDelete.js -[workspaceget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGet.js -[workspacegetbysubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGetBySubscription.js -[workspacelistresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceListResourceGroup.js -[workspaceupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceUpdate.js -[workspacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesCreateOrUpdateSample.js -[workspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesDeleteSample.js -[workspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesGetSample.js -[workspaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListByResourceGroupSample.js -[workspaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListSample.js -[workspaceslistworkspacekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListWorkspaceKeysSample.js -[workspacesresyncstoragekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesResyncStorageKeysSample.js -[workspacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesUpdateSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-workspaces?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/machinelearning/arm-workspaces/README.md diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/listWorkspaceKeys.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/listWorkspaceKeys.js deleted file mode 100644 index ecff7cb2963b..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/listWorkspaceKeys.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to List the authorization keys associated with this workspace. - * - * @summary List the authorization keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json - */ -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function listWorkspaceKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.listWorkspaceKeys(workspaceName, resourceGroupName); - console.log(result); -} - -listWorkspaceKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/package.json b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/package.json deleted file mode 100644 index eea522c681bb..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-workspaces-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=12.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/machinelearning/arm-workspaces" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/machinelearning/arm-workspaces", - "dependencies": { - "@azure/arm-workspaces": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/resyncStorageKeys.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/resyncStorageKeys.js deleted file mode 100644 index 059e8c7b7bd5..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/resyncStorageKeys.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Resync storage keys associated with this workspace. - * - * @summary Resync storage keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json - */ -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function resyncStorageKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.resyncStorageKeys(workspaceName, resourceGroupName); - console.log(result); -} - -resyncStorageKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/sample.env b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceCreate.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceCreate.js deleted file mode 100644 index 4e7953d74924..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceCreate.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Creates or updates a workspace with the specified parameters. - * - * @summary Creates or updates a workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json - */ -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function workspaceCreate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters = { - location: "West Europe", - ownerEmail: "abc@microsoft.com", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" }, - userStorageAccountId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/teststorage", - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.createOrUpdate( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceCreate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceDelete.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceDelete.js deleted file mode 100644 index 1cbec59499a0..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceDelete.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes a machine learning workspace. - * - * @summary Deletes a machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json - */ -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function workspaceDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.delete(resourceGroupName, workspaceName); - console.log(result); -} - -workspaceDelete().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGet.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGet.js deleted file mode 100644 index 870172fe908e..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGet.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the properties of the specified machine learning workspace. - * - * @summary Gets the properties of the specified machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json - */ -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function workspaceGet() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.get(resourceGroupName, workspaceName); - console.log(result); -} - -workspaceGet().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGetBySubscription.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGetBySubscription.js deleted file mode 100644 index 6b8bdb6a39e6..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceGetBySubscription.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified subscription. - * - * @summary Lists all the available machine learning workspaces under the specified subscription. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json - */ -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function workspaceGetBySubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.workspaces.list()) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceGetBySubscription().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceListResourceGroup.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceListResourceGroup.js deleted file mode 100644 index 47d81bb0c8b4..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceListResourceGroup.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified resource group. - * - * @summary Lists all the available machine learning workspaces under the specified resource group. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json - */ -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function workspaceListResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.workspaces.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceListResourceGroup().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceUpdate.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceUpdate.js deleted file mode 100644 index 6f7527c3d215..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspaceUpdate.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Updates a machine learning workspace with the specified parameters. - * - * @summary Updates a machine learning workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json - */ -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function workspaceUpdate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters = { - keyVaultIdentifierId: "kvidnew", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.update(resourceGroupName, workspaceName, parameters); - console.log(result); -} - -workspaceUpdate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesCreateOrUpdateSample.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesCreateOrUpdateSample.js deleted file mode 100644 index e74fda5b7c1c..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesCreateOrUpdateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Creates or updates a workspace with the specified parameters. - * - * @summary Creates or updates a workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json - */ -async function workspaceCreate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters = { - location: "West Europe", - ownerEmail: "abc@microsoft.com", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" }, - userStorageAccountId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/teststorage", - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.createOrUpdate( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceCreate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesDeleteSample.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesDeleteSample.js deleted file mode 100644 index ed76b35d72b2..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Deletes a machine learning workspace. - * - * @summary Deletes a machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json - */ -async function workspaceDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.delete(resourceGroupName, workspaceName); - console.log(result); -} - -workspaceDelete().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesGetSample.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesGetSample.js deleted file mode 100644 index fd0e8cb58feb..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Gets the properties of the specified machine learning workspace. - * - * @summary Gets the properties of the specified machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json - */ -async function workspaceGet() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.get(resourceGroupName, workspaceName); - console.log(result); -} - -workspaceGet().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListByResourceGroupSample.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListByResourceGroupSample.js deleted file mode 100644 index be0a92c0c67d..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified resource group. - * - * @summary Lists all the available machine learning workspaces under the specified resource group. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json - */ -async function workspaceListResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.workspaces.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceListResourceGroup().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListSample.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListSample.js deleted file mode 100644 index 531c25c50bf2..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified subscription. - * - * @summary Lists all the available machine learning workspaces under the specified subscription. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json - */ -async function workspaceGetBySubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.workspaces.list()) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceGetBySubscription().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListWorkspaceKeysSample.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListWorkspaceKeysSample.js deleted file mode 100644 index 2287783a3a0c..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesListWorkspaceKeysSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List the authorization keys associated with this workspace. - * - * @summary List the authorization keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json - */ -async function listWorkspaceKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.listWorkspaceKeys(workspaceName, resourceGroupName); - console.log(result); -} - -listWorkspaceKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesResyncStorageKeysSample.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesResyncStorageKeysSample.js deleted file mode 100644 index ca1adf4f3d05..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesResyncStorageKeysSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Resync storage keys associated with this workspace. - * - * @summary Resync storage keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json - */ -async function resyncStorageKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.resyncStorageKeys(workspaceName, resourceGroupName); - console.log(result); -} - -resyncStorageKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesUpdateSample.js b/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesUpdateSample.js deleted file mode 100644 index 254d9bba4f3a..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/javascript/workspacesUpdateSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { MachineLearningWorkspacesManagementClient } = require("@azure/arm-workspaces"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Updates a machine learning workspace with the specified parameters. - * - * @summary Updates a machine learning workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json - */ -async function workspaceUpdate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters = { - keyVaultIdentifierId: "kvidnew", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" }, - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient(credential, subscriptionId); - const result = await client.workspaces.update(resourceGroupName, workspaceName, parameters); - console.log(result); -} - -workspaceUpdate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/README.md b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/README.md deleted file mode 100644 index 0ec1f2caa67d..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [listWorkspaceKeys.ts][listworkspacekeys] | List the authorization keys associated with this workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json | -| [resyncStorageKeys.ts][resyncstoragekeys] | Resync storage keys associated with this workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json | -| [workspaceCreate.ts][workspacecreate] | Creates or updates a workspace with the specified parameters. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json | -| [workspaceDelete.ts][workspacedelete] | Deletes a machine learning workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json | -| [workspaceGet.ts][workspaceget] | Gets the properties of the specified machine learning workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json | -| [workspaceGetBySubscription.ts][workspacegetbysubscription] | Lists all the available machine learning workspaces under the specified subscription. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json | -| [workspaceListResourceGroup.ts][workspacelistresourcegroup] | Lists all the available machine learning workspaces under the specified resource group. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json | -| [workspaceUpdate.ts][workspaceupdate] | Updates a machine learning workspace with the specified parameters. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json | -| [workspacesCreateOrUpdateSample.ts][workspacescreateorupdatesample] | Creates or updates a workspace with the specified parameters. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json | -| [workspacesDeleteSample.ts][workspacesdeletesample] | Deletes a machine learning workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json | -| [workspacesGetSample.ts][workspacesgetsample] | Gets the properties of the specified machine learning workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json | -| [workspacesListByResourceGroupSample.ts][workspaceslistbyresourcegroupsample] | Lists all the available machine learning workspaces under the specified resource group. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json | -| [workspacesListSample.ts][workspaceslistsample] | Lists all the available machine learning workspaces under the specified subscription. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json | -| [workspacesListWorkspaceKeysSample.ts][workspaceslistworkspacekeyssample] | List the authorization keys associated with this workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json | -| [workspacesResyncStorageKeysSample.ts][workspacesresyncstoragekeyssample] | Resync storage keys associated with this workspace. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json | -| [workspacesUpdateSample.ts][workspacesupdatesample] | Updates a machine learning workspace with the specified parameters. x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/listWorkspaceKeys.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node dist/listWorkspaceKeys.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[listworkspacekeys]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/listWorkspaceKeys.ts -[resyncstoragekeys]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/resyncStorageKeys.ts -[workspacecreate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceCreate.ts -[workspacedelete]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceDelete.ts -[workspaceget]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGet.ts -[workspacegetbysubscription]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGetBySubscription.ts -[workspacelistresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceListResourceGroup.ts -[workspaceupdate]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceUpdate.ts -[workspacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesCreateOrUpdateSample.ts -[workspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesDeleteSample.ts -[workspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesGetSample.ts -[workspaceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListByResourceGroupSample.ts -[workspaceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListSample.ts -[workspaceslistworkspacekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListWorkspaceKeysSample.ts -[workspacesresyncstoragekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesResyncStorageKeysSample.ts -[workspacesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesUpdateSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-workspaces?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/machinelearning/arm-workspaces/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/package.json b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/package.json deleted file mode 100644 index 4ef8dd30c727..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-workspaces-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=12.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/machinelearning/arm-workspaces" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/machinelearning/arm-workspaces", - "dependencies": { - "@azure/arm-workspaces": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^12.0.0", - "typescript": "~4.4.0", - "rimraf": "latest" - } -} diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/sample.env b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/listWorkspaceKeys.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/listWorkspaceKeys.ts deleted file mode 100644 index 9551cd959beb..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/listWorkspaceKeys.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to List the authorization keys associated with this workspace. - * - * @summary List the authorization keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function listWorkspaceKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.listWorkspaceKeys( - workspaceName, - resourceGroupName - ); - console.log(result); -} - -listWorkspaceKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/resyncStorageKeys.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/resyncStorageKeys.ts deleted file mode 100644 index 5a62fe61a086..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/resyncStorageKeys.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Resync storage keys associated with this workspace. - * - * @summary Resync storage keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function resyncStorageKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.resyncStorageKeys( - workspaceName, - resourceGroupName - ); - console.log(result); -} - -resyncStorageKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceCreate.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceCreate.ts deleted file mode 100644 index a3140421fd47..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceCreate.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Creates or updates a workspace with the specified parameters. - * - * @summary Creates or updates a workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json - */ -import { - Workspace, - MachineLearningWorkspacesManagementClient -} from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceCreate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters: Workspace = { - location: "West Europe", - ownerEmail: "abc@microsoft.com", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" }, - userStorageAccountId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/teststorage" - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.createOrUpdate( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceCreate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceDelete.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceDelete.ts deleted file mode 100644 index a04cf7db0a4b..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceDelete.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes a machine learning workspace. - * - * @summary Deletes a machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.delete( - resourceGroupName, - workspaceName - ); - console.log(result); -} - -workspaceDelete().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGet.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGet.ts deleted file mode 100644 index 380124c43262..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGet.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the properties of the specified machine learning workspace. - * - * @summary Gets the properties of the specified machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceGet() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.get(resourceGroupName, workspaceName); - console.log(result); -} - -workspaceGet().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGetBySubscription.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGetBySubscription.ts deleted file mode 100644 index 18d9c463d359..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceGetBySubscription.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified subscription. - * - * @summary Lists all the available machine learning workspaces under the specified subscription. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceGetBySubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.workspaces.list()) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceGetBySubscription().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceListResourceGroup.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceListResourceGroup.ts deleted file mode 100644 index 20532c840e89..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceListResourceGroup.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified resource group. - * - * @summary Lists all the available machine learning workspaces under the specified resource group. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json - */ -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceListResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.workspaces.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceListResourceGroup().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceUpdate.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceUpdate.ts deleted file mode 100644 index badba0bae2da..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspaceUpdate.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * This sample demonstrates how to Updates a machine learning workspace with the specified parameters. - * - * @summary Updates a machine learning workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json - */ -import { - WorkspaceUpdateParameters, - MachineLearningWorkspacesManagementClient -} from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function workspaceUpdate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters: WorkspaceUpdateParameters = { - keyVaultIdentifierId: "kvidnew", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.update( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceUpdate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesCreateOrUpdateSample.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesCreateOrUpdateSample.ts deleted file mode 100644 index cf7d121b95dc..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesCreateOrUpdateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Workspace, - MachineLearningWorkspacesManagementClient -} from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Creates or updates a workspace with the specified parameters. - * - * @summary Creates or updates a workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/CreateWorkspace.json - */ -async function workspaceCreate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters: Workspace = { - location: "West Europe", - ownerEmail: "abc@microsoft.com", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" }, - userStorageAccountId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/teststorage" - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.createOrUpdate( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceCreate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesDeleteSample.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesDeleteSample.ts deleted file mode 100644 index 75b69937de3d..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Deletes a machine learning workspace. - * - * @summary Deletes a machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/DeleteWorkspace.json - */ -async function workspaceDelete() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.delete( - resourceGroupName, - workspaceName - ); - console.log(result); -} - -workspaceDelete().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesGetSample.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesGetSample.ts deleted file mode 100644 index 727911110d3c..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Gets the properties of the specified machine learning workspace. - * - * @summary Gets the properties of the specified machine learning workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/GetWorkspace.json - */ -async function workspaceGet() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.get(resourceGroupName, workspaceName); - console.log(result); -} - -workspaceGet().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListByResourceGroupSample.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListByResourceGroupSample.ts deleted file mode 100644 index 8138ca92226e..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListByResourceGroupSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified resource group. - * - * @summary Lists all the available machine learning workspaces under the specified resource group. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceResourceGroup.json - */ -async function workspaceListResourceGroup() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.workspaces.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceListResourceGroup().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListSample.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListSample.ts deleted file mode 100644 index 1b78f4e73734..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Lists all the available machine learning workspaces under the specified subscription. - * - * @summary Lists all the available machine learning workspaces under the specified subscription. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaces.json - */ -async function workspaceGetBySubscription() { - const subscriptionId = "00000000-1111-2222-3333-444444444444"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.workspaces.list()) { - resArray.push(item); - } - console.log(resArray); -} - -workspaceGetBySubscription().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListWorkspaceKeysSample.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListWorkspaceKeysSample.ts deleted file mode 100644 index eea63e0ab4a8..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesListWorkspaceKeysSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List the authorization keys associated with this workspace. - * - * @summary List the authorization keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ListWorkspaceKeys.json - */ -async function listWorkspaceKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.listWorkspaceKeys( - workspaceName, - resourceGroupName - ); - console.log(result); -} - -listWorkspaceKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesResyncStorageKeysSample.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesResyncStorageKeysSample.ts deleted file mode 100644 index 2e54040ce305..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesResyncStorageKeysSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { MachineLearningWorkspacesManagementClient } from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Resync storage keys associated with this workspace. - * - * @summary Resync storage keys associated with this workspace. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/ResyncStorageKeys.json - */ -async function resyncStorageKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const workspaceName = "testworkspace"; - const resourceGroupName = "myResourceGroup"; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.resyncStorageKeys( - workspaceName, - resourceGroupName - ); - console.log(result); -} - -resyncStorageKeys().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesUpdateSample.ts b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesUpdateSample.ts deleted file mode 100644 index bb3adce7d2ef..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/src/workspacesUpdateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - WorkspaceUpdateParameters, - MachineLearningWorkspacesManagementClient -} from "@azure/arm-workspaces"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Updates a machine learning workspace with the specified parameters. - * - * @summary Updates a machine learning workspace with the specified parameters. - * x-ms-original-file: specification/machinelearning/resource-manager/Microsoft.MachineLearning/stable/2019-10-01/examples/UpdateWorkspace.json - */ -async function workspaceUpdate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "myResourceGroup"; - const workspaceName = "testworkspace"; - const parameters: WorkspaceUpdateParameters = { - keyVaultIdentifierId: "kvidnew", - sku: { name: "Enterprise", tier: "Enterprise" }, - tags: { tagKey1: "TagValue1" } - }; - const credential = new DefaultAzureCredential(); - const client = new MachineLearningWorkspacesManagementClient( - credential, - subscriptionId - ); - const result = await client.workspaces.update( - resourceGroupName, - workspaceName, - parameters - ); - console.log(result); -} - -workspaceUpdate().catch(console.error); diff --git a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/tsconfig.json b/sdk/machinelearning/arm-workspaces/samples/v1/typescript/tsconfig.json deleted file mode 100644 index 416c2dd82e00..000000000000 --- a/sdk/machinelearning/arm-workspaces/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2018", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/machinelearning/arm-workspaces/src/machineLearningWorkspacesManagementClient.ts b/sdk/machinelearning/arm-workspaces/src/machineLearningWorkspacesManagementClient.ts index a482d09deada..b991f8aff230 100644 --- a/sdk/machinelearning/arm-workspaces/src/machineLearningWorkspacesManagementClient.ts +++ b/sdk/machinelearning/arm-workspaces/src/machineLearningWorkspacesManagementClient.ts @@ -8,6 +8,11 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, WorkspacesImpl } from "./operations"; import { Operations, Workspaces } from "./operationsInterfaces"; @@ -45,7 +50,7 @@ export class MachineLearningWorkspacesManagementClient extends coreClient.Servic credential: credentials }; - const packageDetails = `azsdk-js-arm-workspaces/1.0.2`; + const packageDetails = `azsdk-js-arm-workspaces/1.0.3`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -95,6 +100,35 @@ export class MachineLearningWorkspacesManagementClient extends coreClient.Servic this.apiVersion = options.apiVersion || "2019-10-01"; this.operations = new OperationsImpl(this); this.workspaces = new WorkspacesImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } operations: Operations; diff --git a/sdk/machinelearning/arm-workspaces/test/sampleTest.ts b/sdk/machinelearning/arm-workspaces/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/machinelearning/arm-workspaces/test/sampleTest.ts +++ b/sdk/machinelearning/arm-workspaces/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/machinelearning/arm-workspaces/tsconfig.json b/sdk/machinelearning/arm-workspaces/tsconfig.json index 9f01cea42931..8292b80f5b3f 100644 --- a/sdk/machinelearning/arm-workspaces/tsconfig.json +++ b/sdk/machinelearning/arm-workspaces/tsconfig.json @@ -15,19 +15,15 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-workspaces": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts", + "./test/**/*.ts" ], "exclude": [ "node_modules" ] -} +} \ No newline at end of file