diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f52e8265a995..0aef59fb1e60 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3428,7 +3428,7 @@ packages: version: 0.0.0 '@rush-temp/arm-storagemover@file:projects/arm-storagemover.tgz': - resolution: {integrity: sha512-bCAKnCipcNgK97r9dFp6xBdMynr3/yk5qFzeddAgDwuj1Gc9mKnsDsBAi11BFdTTVr6tQLs/2ym1iQ3Nnxl1pw==, tarball: file:projects/arm-storagemover.tgz} + resolution: {integrity: sha512-eNk7Mg/9r+xe0qSZ8oEFtiWP3Ss9Lu0Yv1zTHn8kzlToDnGIx283mj+flzLioaAE+3wffTfkalz9HIrQMVhtKA==, tarball: file:projects/arm-storagemover.tgz} version: 0.0.0 '@rush-temp/arm-storagesync@file:projects/arm-storagesync.tgz': @@ -15078,18 +15078,17 @@ snapshots: dependencies: '@azure-tools/test-credential': 1.3.1 '@azure-tools/test-recorder': 3.5.2 - '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 '@types/chai': 4.3.20 '@types/mocha': 10.0.10 '@types/node': 18.19.68 chai: 4.5.0 dotenv: 16.4.7 - mocha: 11.0.2 - ts-node: 10.9.2(@types/node@18.19.68)(typescript@5.7.2) + mocha: 10.8.2 + ts-node: 10.9.2(@types/node@18.19.68)(typescript@5.6.3) tslib: 2.8.1 tsx: 4.19.2 - typescript: 5.7.2 + typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' diff --git a/sdk/storagemover/arm-storagemover/CHANGELOG.md b/sdk/storagemover/arm-storagemover/CHANGELOG.md deleted file mode 100644 index aad481d5e0c0..000000000000 --- a/sdk/storagemover/arm-storagemover/CHANGELOG.md +++ /dev/null @@ -1,103 +0,0 @@ -# Release History - -## 2.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 2.1.0 (2024-06-13) - -### Features Added - - - Added Interface Recurrence - - Added Interface Time - - Added Interface UploadLimit - - Added Interface UploadLimitSchedule - - Added Interface UploadLimitWeeklyRecurrence - - Added Interface WeeklyRecurrence - - Added Type Alias DayOfWeek - - Added Type Alias Minute - - Interface Agent has a new optional parameter timeZone - - Interface Agent has a new optional parameter uploadLimitSchedule - - Interface AgentUpdateParameters has a new optional parameter uploadLimitSchedule - - Added Enum KnownMinute - - Enum KnownJobRunStatus has a new value PausedByBandwidthManagement - - Enum KnownProvisioningState has a new value Canceled - - Enum KnownProvisioningState has a new value Deleting - - Enum KnownProvisioningState has a new value Failed - - -## 2.0.0 (2023-10-07) - -### Features Added - - - Added Interface AzureKeyVaultSmbCredentials - - Added Interface AzureStorageSmbFileShareEndpointProperties - - Added Interface AzureStorageSmbFileShareEndpointUpdateProperties - - Added Interface Credentials - - Added Interface SmbMountEndpointProperties - - Added Interface SmbMountEndpointUpdateProperties - - Added Type Alias CredentialsUnion - - Added Type Alias CredentialType - - Added Type Alias EndpointBaseUpdatePropertiesUnion - - Interface Resource has a new optional parameter systemData - - Type of parameter endpointType of interface EndpointBaseProperties is changed from "AzureStorageBlobContainer" | "NfsMount" to "AzureStorageBlobContainer" | "NfsMount" | "AzureStorageSmbFileShare" | "SmbMount" - - Added Enum KnownCredentialType - - Enum KnownEndpointType has a new value AzureStorageSmbFileShare - - Enum KnownEndpointType has a new value SmbMount - - Interface Agent no longer has parameter systemData - - Interface Endpoint no longer has parameter systemData - - Interface JobDefinition no longer has parameter systemData - - Interface JobRun no longer has parameter systemData - - Interface Project no longer has parameter systemData - - Interface StorageMover no longer has parameter systemData - -### Breaking Changes - - - Interface AzureStorageBlobContainerEndpointUpdateProperties has a new required parameter endpointType - - Interface EndpointBaseUpdateProperties has a new required parameter endpointType - - Interface NfsMountEndpointUpdateProperties has a new required parameter endpointType - - Type of parameter properties of interface EndpointBaseUpdateParameters is changed from EndpointBaseUpdateProperties to EndpointBaseUpdatePropertiesUnion - - -## 2.0.0-beta.1 (2023-07-12) - -### Features Added - - - Added Interface AzureKeyVaultSmbCredentials - - Added Interface AzureStorageSmbFileShareEndpointProperties - - Added Interface AzureStorageSmbFileShareEndpointUpdateProperties - - Added Interface Credentials - - Added Interface SmbMountEndpointProperties - - Added Interface SmbMountEndpointUpdateProperties - - Added Type Alias CredentialsUnion - - Added Type Alias CredentialType - - Added Type Alias EndpointBaseUpdatePropertiesUnion - - Interface Resource has a new optional parameter systemData - - Type of parameter endpointType of interface EndpointBaseProperties is changed from "AzureStorageBlobContainer" | "NfsMount" to "AzureStorageBlobContainer" | "NfsMount" | "AzureStorageSmbFileShare" | "SmbMount" - - Added Enum KnownCredentialType - - Enum KnownEndpointType has a new value AzureStorageSmbFileShare - - Enum KnownEndpointType has a new value SmbMount - - Interface Agent no longer has parameter systemData - - Interface Endpoint no longer has parameter systemData - - Interface JobDefinition no longer has parameter systemData - - Interface JobRun no longer has parameter systemData - - Interface Project no longer has parameter systemData - - Interface StorageMover no longer has parameter systemData - -### Breaking Changes - - - Interface AzureStorageBlobContainerEndpointUpdateProperties has a new required parameter endpointType - - Interface EndpointBaseUpdateProperties has a new required parameter endpointType - - Interface NfsMountEndpointUpdateProperties has a new required parameter endpointType - - Type of parameter properties of interface EndpointBaseUpdateParameters is changed from EndpointBaseUpdateProperties to EndpointBaseUpdatePropertiesUnion - - -## 1.0.0 (2023-03-07) - -The package of @azure/arm-storagemover is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). diff --git a/sdk/storagemover/arm-storagemover/README.md b/sdk/storagemover/arm-storagemover/README.md index 411dde446c2f..f32def9a6f06 100644 --- a/sdk/storagemover/arm-storagemover/README.md +++ b/sdk/storagemover/arm-storagemover/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure StorageMover** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/storagemover/arm-storagemover/_meta.json b/sdk/storagemover/arm-storagemover/_meta.json index 1a0286b5b199..c9f75b481872 100644 --- a/sdk/storagemover/arm-storagemover/_meta.json +++ b/sdk/storagemover/arm-storagemover/_meta.json @@ -1,8 +1,8 @@ { - "commit": "412364b282e52b50eadc3cd88d56d283b6c8712a", + "commit": "b52afe55461bab8ad37455607f2393aa22ac6387", "readme": "specification/storagemover/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\storagemover\\resource-manager\\readme.md --use=@autorest/typescript@6.0.23 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --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/storagemover/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.10", - "use": "@autorest/typescript@6.0.23" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/storagemover/arm-storagemover/assets.json b/sdk/storagemover/arm-storagemover/assets.json deleted file mode 100644 index 89061d6ed79c..000000000000 --- a/sdk/storagemover/arm-storagemover/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/storagemover/arm-storagemover", - "Tag": "js/storagemover/arm-storagemover_3add9a4edf" -} diff --git a/sdk/storagemover/arm-storagemover/package.json b/sdk/storagemover/arm-storagemover/package.json index 7c931d099e2e..320ea82924c1 100644 --- a/sdk/storagemover/arm-storagemover/package.json +++ b/sdk/storagemover/arm-storagemover/package.json @@ -8,11 +8,11 @@ "node": ">=18.0.0" }, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.6.0", - "@azure/core-client": "^1.7.0", "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, @@ -28,19 +28,19 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-storagemover.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.1.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", - "@types/chai": "^4.2.8", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", - "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", "tsx": "^4.7.1", - "typescript": "~5.7.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -68,28 +68,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", - "build:samples": "echo skipped.", + "build:browser": "echo skipped", "build:test": "echo skipped", + "build:samples": "echo skipped.", "check-format": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", "format": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "prepack": "npm run build", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored 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": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -102,13 +102,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagemover/arm-storagemover", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-storagemover?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagemover/arm-storagemover" +} \ No newline at end of file diff --git a/sdk/storagemover/arm-storagemover/sample.env b/sdk/storagemover/arm-storagemover/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/storagemover/arm-storagemover/sample.env +++ b/sdk/storagemover/arm-storagemover/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/storagemover/arm-storagemover/samples-dev/agentsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/agentsCreateOrUpdateSample.ts deleted file mode 100644 index 596cba244e26..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/agentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,156 +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 { Agent, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * - * @summary Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_MaximumSet.json - */ -async function agentsCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: Agent = { - description: "Example Agent Description", - arcResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", - uploadLimitSchedule: { - weeklyRecurrences: [ - { - days: ["Monday"], - endTime: { hour: 18, minute: 30 }, - limitInMbps: 2000, - startTime: { hour: 9, minute: 0 }, - }, - ], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.createOrUpdate( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * - * @summary Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_MinimumSet.json - */ -async function agentsCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: Agent = { - arcResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.createOrUpdate( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * - * @summary Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.json - */ -async function agentsCreateOrUpdateWithOvernightUploadLimitSchedule() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: Agent = { - arcResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", - uploadLimitSchedule: { - weeklyRecurrences: [ - { - days: [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday", - ], - endTime: { hour: 24, minute: 0 }, - limitInMbps: 2000, - startTime: { hour: 18, minute: 0 }, - }, - { - days: [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday", - ], - endTime: { hour: 9, minute: 0 }, - limitInMbps: 2000, - startTime: { hour: 0, minute: 0 }, - }, - ], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.createOrUpdate( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -async function main() { - agentsCreateOrUpdateMaximumSet(); - agentsCreateOrUpdateMinimumSet(); - agentsCreateOrUpdateWithOvernightUploadLimitSchedule(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/agentsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/agentsDeleteSample.ts deleted file mode 100644 index 8a0592314c95..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/agentsDeleteSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an Agent resource. - * - * @summary Deletes an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Delete.json - */ -async function agentsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - agentName, - ); - console.log(result); -} - -async function main() { - agentsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/agentsGetSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/agentsGetSample.ts deleted file mode 100644 index 1c43f29f10a1..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/agentsGetSample.ts +++ /dev/null @@ -1,70 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an Agent resource. - * - * @summary Gets an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Get_MaximumSet.json - */ -async function agentsGetMaximumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.get( - resourceGroupName, - storageMoverName, - agentName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Agent resource. - * - * @summary Gets an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Get_MinimumSet.json - */ -async function agentsGetMinimumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.get( - resourceGroupName, - storageMoverName, - agentName, - ); - console.log(result); -} - -async function main() { - agentsGetMaximumSet(); - agentsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/agentsListSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/agentsListSample.ts deleted file mode 100644 index ca7ba4f779f2..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/agentsListSample.ts +++ /dev/null @@ -1,72 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Agents in a Storage Mover. - * - * @summary Lists all Agents in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_List_MaximumSet.json - */ -async function agentsListMaximumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.agents.list( - resourceGroupName, - storageMoverName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists all Agents in a Storage Mover. - * - * @summary Lists all Agents in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_List_MinimumSet.json - */ -async function agentsListMinimumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.agents.list( - resourceGroupName, - storageMoverName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - agentsListMaximumSet(); - agentsListMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/agentsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/agentsUpdateSample.ts deleted file mode 100644 index aa5013233155..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/agentsUpdateSample.ts +++ /dev/null @@ -1,62 +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 { - AgentUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an Agent resource. - * - * @summary Creates or updates an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Update.json - */ -async function agentsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: AgentUpdateParameters = { - description: "Example Agent Description", - uploadLimitSchedule: { - weeklyRecurrences: [ - { - days: ["Monday"], - endTime: { hour: 18, minute: 30 }, - limitInMbps: 2000, - startTime: { hour: 9, minute: 0 }, - }, - ], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.update( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -async function main() { - agentsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/endpointsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/endpointsCreateOrUpdateSample.ts deleted file mode 100644 index 9bda1719d2ea..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/endpointsCreateOrUpdateSample.ts +++ /dev/null @@ -1,165 +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 { Endpoint, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json - */ -async function endpointsCreateOrUpdateAzureStorageBlobContainer() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example Storage Blob Container Endpoint Description", - blobContainerName: "examples-blobcontainer", - endpointType: "AzureStorageBlobContainer", - storageAccountResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesa", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.json - */ -async function endpointsCreateOrUpdateAzureStorageSmbFileShare() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example Storage File Share Endpoint Description", - endpointType: "AzureStorageSmbFileShare", - fileShareName: "examples-fileshare", - storageAccountResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesa", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_NfsMount.json - */ -async function endpointsCreateOrUpdateNfsMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example NFS Mount Endpoint Description", - endpointType: "NfsMount", - export: "examples-exportName", - host: "0.0.0.0", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_SmbMount.json - */ -async function endpointsCreateOrUpdateSmbMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example SMB Mount Endpoint Description", - credentials: { - type: "AzureKeyVaultSmb", - passwordUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-password", - usernameUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-username", - }, - endpointType: "SmbMount", - host: "0.0.0.0", - shareName: "examples-shareName", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -async function main() { - endpointsCreateOrUpdateAzureStorageBlobContainer(); - endpointsCreateOrUpdateAzureStorageSmbFileShare(); - endpointsCreateOrUpdateNfsMount(); - endpointsCreateOrUpdateSmbMount(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/endpointsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/endpointsDeleteSample.ts deleted file mode 100644 index 41ceb5668cab..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/endpointsDeleteSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an Endpoint resource. - * - * @summary Deletes an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Delete.json - */ -async function endpointsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -async function main() { - endpointsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/endpointsGetSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/endpointsGetSample.ts deleted file mode 100644 index d18feec97d9b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/endpointsGetSample.ts +++ /dev/null @@ -1,120 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_AzureStorageBlobContainer.json - */ -async function endpointsGetAzureStorageBlobContainer() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_AzureStorageSmbFileShare.json - */ -async function endpointsGetAzureStorageSmbFileShare() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_NfsMount.json - */ -async function endpointsGetNfsMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_SmbMount.json - */ -async function endpointsGetSmbMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -async function main() { - endpointsGetAzureStorageBlobContainer(); - endpointsGetAzureStorageSmbFileShare(); - endpointsGetNfsMount(); - endpointsGetSmbMount(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/endpointsListSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/endpointsListSample.ts deleted file mode 100644 index 022718bbe4c8..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/endpointsListSample.ts +++ /dev/null @@ -1,46 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Endpoints in a Storage Mover. - * - * @summary Lists all Endpoints in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_List.json - */ -async function endpointsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.endpoints.list( - resourceGroupName, - storageMoverName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - endpointsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/endpointsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/endpointsUpdateSample.ts deleted file mode 100644 index a0892b46912e..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/endpointsUpdateSample.ts +++ /dev/null @@ -1,158 +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 { - EndpointBaseUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_AzureStorageBlobContainer.json - */ -async function endpointsUpdateAzureStorageBlobContainer() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: EndpointBaseUpdateParameters = { - properties: { - description: "Updated Endpoint Description", - endpointType: "AzureStorageBlobContainer", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_AzureStorageSmbFileShare.json - */ -async function endpointsUpdateAzureStorageSmbFileShare() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: EndpointBaseUpdateParameters = { - properties: { - description: "Updated Endpoint Description", - endpointType: "AzureStorageSmbFileShare", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_NfsMount.json - */ -async function endpointsUpdateNfsMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: EndpointBaseUpdateParameters = { - properties: { - description: "Updated Endpoint Description", - endpointType: "NfsMount", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_SmbMount.json - */ -async function endpointsUpdateSmbMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: EndpointBaseUpdateParameters = { - properties: { - description: "Updated Endpoint Description", - credentials: { - type: "AzureKeyVaultSmb", - passwordUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-updated-password", - usernameUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-updated-username", - }, - endpointType: "SmbMount", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -async function main() { - endpointsUpdateAzureStorageBlobContainer(); - endpointsUpdateAzureStorageSmbFileShare(); - endpointsUpdateNfsMount(); - endpointsUpdateSmbMount(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsCreateOrUpdateSample.ts deleted file mode 100644 index 689f30203019..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,57 +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 { JobDefinition, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a Job Definition resource, which contains configuration for a single unit of managed data transfer. - * - * @summary Creates or updates a Job Definition resource, which contains configuration for a single unit of managed data transfer. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_CreateOrUpdate.json - */ -async function jobDefinitionsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const jobDefinition: JobDefinition = { - description: "Example Job Definition Description", - agentName: "migration-agent", - copyMode: "Additive", - sourceName: "examples-sourceEndpointName", - sourceSubpath: "/", - targetName: "examples-targetEndpointName", - targetSubpath: "/", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.createOrUpdate( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - jobDefinition, - ); - console.log(result); -} - -async function main() { - jobDefinitionsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsDeleteSample.ts deleted file mode 100644 index 6f6efcad03a0..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsDeleteSample.ts +++ /dev/null @@ -1,47 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Job Definition resource. - * - * @summary Deletes a Job Definition resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - projectsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsGetSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsGetSample.ts deleted file mode 100644 index 9cb7315d21e1..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsGetSample.ts +++ /dev/null @@ -1,47 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Job Definition resource. - * - * @summary Gets a Job Definition resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Get.json - */ -async function jobDefinitionsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.get( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - jobDefinitionsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsListSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsListSample.ts deleted file mode 100644 index 549ce892193c..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsListSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Job Definitions in a Project. - * - * @summary Lists all Job Definitions in a Project. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_List.json - */ -async function jobDefinitionsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.jobDefinitions.list( - resourceGroupName, - storageMoverName, - projectName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - jobDefinitionsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsStartJobSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsStartJobSample.ts deleted file mode 100644 index 4ef05859d435..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsStartJobSample.ts +++ /dev/null @@ -1,47 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a new Job Run resource for the specified Job Definition and passes it to the Agent for execution. - * - * @summary Creates a new Job Run resource for the specified Job Definition and passes it to the Agent for execution. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StartJob.json - */ -async function jobDefinitionsStartJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.startJob( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - jobDefinitionsStartJob(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsStopJobSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsStopJobSample.ts deleted file mode 100644 index 8d85ea36320c..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsStopJobSample.ts +++ /dev/null @@ -1,47 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Requests the Agent of any active instance of this Job Definition to stop. - * - * @summary Requests the Agent of any active instance of this Job Definition to stop. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StopJob.json - */ -async function jobDefinitionsStopJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.stopJob( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - jobDefinitionsStopJob(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsUpdateSample.ts deleted file mode 100644 index 1b383f96b689..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/jobDefinitionsUpdateSample.ts +++ /dev/null @@ -1,55 +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 { - JobDefinitionUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Update.json - */ -async function jobDefinitionsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const jobDefinition: JobDefinitionUpdateParameters = { - description: "Updated Job Definition Description", - agentName: "updatedAgentName", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.update( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - jobDefinition, - ); - console.log(result); -} - -async function main() { - jobDefinitionsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/jobRunsGetSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/jobRunsGetSample.ts deleted file mode 100644 index e88fcdb19baa..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/jobRunsGetSample.ts +++ /dev/null @@ -1,49 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Job Run resource. - * - * @summary Gets a Job Run resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_Get.json - */ -async function jobRunsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const jobRunName = "examples-jobRunName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobRuns.get( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - jobRunName, - ); - console.log(result); -} - -async function main() { - jobRunsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/jobRunsListSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/jobRunsListSample.ts deleted file mode 100644 index 752d48574814..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/jobRunsListSample.ts +++ /dev/null @@ -1,50 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Job Runs in a Job Definition. - * - * @summary Lists all Job Runs in a Job Definition. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_List.json - */ -async function jobRunsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.jobRuns.list( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - jobRunsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/operationsListSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/operationsListSample.ts deleted file mode 100644 index 8ab240b83ce9..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,40 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all the supported operations for the Azure Storage Mover REST API. - * - * @summary Lists all the supported operations for the Azure Storage Mover REST API. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/projectsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/projectsCreateOrUpdateSample.ts deleted file mode 100644 index 3069a96a9b2b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/projectsCreateOrUpdateSample.ts +++ /dev/null @@ -1,47 +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 { Project, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a Project resource, which is a logical grouping of related jobs. - * - * @summary Creates or updates a Project resource, which is a logical grouping of related jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_CreateOrUpdate.json - */ -async function projectsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const project: Project = { description: "Example Project Description" }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.createOrUpdate( - resourceGroupName, - storageMoverName, - projectName, - project, - ); - console.log(result); -} - -async function main() { - projectsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/projectsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/projectsDeleteSample.ts deleted file mode 100644 index 05b10a7aba58..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/projectsDeleteSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Project resource. - * - * @summary Deletes a Project resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - projectName, - ); - console.log(result); -} - -async function main() { - projectsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/projectsGetSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/projectsGetSample.ts deleted file mode 100644 index f38a960bca3b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/projectsGetSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Project resource. - * - * @summary Gets a Project resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Get.json - */ -async function projectsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.get( - resourceGroupName, - storageMoverName, - projectName, - ); - console.log(result); -} - -async function main() { - projectsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/projectsListSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/projectsListSample.ts deleted file mode 100644 index 3a0c3ebfffae..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/projectsListSample.ts +++ /dev/null @@ -1,46 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Projects in a Storage Mover. - * - * @summary Lists all Projects in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_List.json - */ -async function projectsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.projects.list( - resourceGroupName, - storageMoverName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - projectsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/projectsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/projectsUpdateSample.ts deleted file mode 100644 index c400bff8d407..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/projectsUpdateSample.ts +++ /dev/null @@ -1,52 +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 { - ProjectUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates properties for a Project resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for a Project resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Update.json - */ -async function projectsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const project: ProjectUpdateParameters = { - description: "Example Project Description", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.update( - resourceGroupName, - storageMoverName, - projectName, - project, - ); - console.log(result); -} - -async function main() { - projectsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/storageMoversCreateOrUpdateSample.ts deleted file mode 100644 index 766dec10f3bb..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversCreateOrUpdateSample.ts +++ /dev/null @@ -1,49 +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 { StorageMover, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a top-level Storage Mover resource. - * - * @summary Creates or updates a top-level Storage Mover resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_CreateOrUpdate.json - */ -async function storageMoversCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const storageMover: StorageMover = { - description: "Example Storage Mover Description", - location: "eastus2", - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.createOrUpdate( - resourceGroupName, - storageMoverName, - storageMover, - ); - console.log(result); -} - -async function main() { - storageMoversCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/storageMoversDeleteSample.ts deleted file mode 100644 index e25ea195fc02..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversDeleteSample.ts +++ /dev/null @@ -1,43 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Storage Mover resource. - * - * @summary Deletes a Storage Mover resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Delete.json - */ -async function storageMoversDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - ); - console.log(result); -} - -async function main() { - storageMoversDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversGetSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/storageMoversGetSample.ts deleted file mode 100644 index c336a529613c..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversGetSample.ts +++ /dev/null @@ -1,43 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Storage Mover resource. - * - * @summary Gets a Storage Mover resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Get.json - */ -async function storageMoversGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.get( - resourceGroupName, - storageMoverName, - ); - console.log(result); -} - -async function main() { - storageMoversGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversListBySubscriptionSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/storageMoversListBySubscriptionSample.ts deleted file mode 100644 index e800ebc0b5f4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Storage Movers in a subscription. - * - * @summary Lists all Storage Movers in a subscription. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_ListBySubscription.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.storageMovers.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - storageMoversList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversListSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/storageMoversListSample.ts deleted file mode 100644 index 0dc26c469ac9..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversListSample.ts +++ /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. -import { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Storage Movers in a resource group. - * - * @summary Lists all Storage Movers in a resource group. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_List.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.storageMovers.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - storageMoversList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples-dev/storageMoversUpdateSample.ts deleted file mode 100644 index f652e4e6edec..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/storageMoversUpdateSample.ts +++ /dev/null @@ -1,50 +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 { - StorageMoverUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates properties for a Storage Mover resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for a Storage Mover resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Update.json - */ -async function storageMoversUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const storageMover: StorageMoverUpdateParameters = { - description: "Updated Storage Mover Description", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.update( - resourceGroupName, - storageMoverName, - storageMover, - ); - console.log(result); -} - -async function main() { - storageMoversUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/README.md b/sdk/storagemover/arm-storagemover/samples/v2/javascript/README.md deleted file mode 100644 index c33af48d8b52..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/README.md +++ /dev/null @@ -1,110 +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** | -| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| [agentsCreateOrUpdateSample.js][agentscreateorupdatesample] | Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_MaximumSet.json | -| [agentsDeleteSample.js][agentsdeletesample] | Deletes an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Delete.json | -| [agentsGetSample.js][agentsgetsample] | Gets an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Get_MaximumSet.json | -| [agentsListSample.js][agentslistsample] | Lists all Agents in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_List_MaximumSet.json | -| [agentsUpdateSample.js][agentsupdatesample] | Creates or updates an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Update.json | -| [endpointsCreateOrUpdateSample.js][endpointscreateorupdatesample] | Creates or updates an Endpoint resource, which represents a data transfer source or destination. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json | -| [endpointsDeleteSample.js][endpointsdeletesample] | Deletes an Endpoint resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Delete.json | -| [endpointsGetSample.js][endpointsgetsample] | Gets an Endpoint resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_AzureStorageBlobContainer.json | -| [endpointsListSample.js][endpointslistsample] | Lists all Endpoints in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_List.json | -| [endpointsUpdateSample.js][endpointsupdatesample] | Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_AzureStorageBlobContainer.json | -| [jobDefinitionsCreateOrUpdateSample.js][jobdefinitionscreateorupdatesample] | Creates or updates a Job Definition resource, which contains configuration for a single unit of managed data transfer. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_CreateOrUpdate.json | -| [jobDefinitionsDeleteSample.js][jobdefinitionsdeletesample] | Deletes a Job Definition resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Delete.json | -| [jobDefinitionsGetSample.js][jobdefinitionsgetsample] | Gets a Job Definition resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Get.json | -| [jobDefinitionsListSample.js][jobdefinitionslistsample] | Lists all Job Definitions in a Project. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_List.json | -| [jobDefinitionsStartJobSample.js][jobdefinitionsstartjobsample] | Creates a new Job Run resource for the specified Job Definition and passes it to the Agent for execution. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StartJob.json | -| [jobDefinitionsStopJobSample.js][jobdefinitionsstopjobsample] | Requests the Agent of any active instance of this Job Definition to stop. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StopJob.json | -| [jobDefinitionsUpdateSample.js][jobdefinitionsupdatesample] | Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Update.json | -| [jobRunsGetSample.js][jobrunsgetsample] | Gets a Job Run resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_Get.json | -| [jobRunsListSample.js][jobrunslistsample] | Lists all Job Runs in a Job Definition. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_List.json | -| [operationsListSample.js][operationslistsample] | Lists all the supported operations for the Azure Storage Mover REST API. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Operations_List.json | -| [projectsCreateOrUpdateSample.js][projectscreateorupdatesample] | Creates or updates a Project resource, which is a logical grouping of related jobs. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_CreateOrUpdate.json | -| [projectsDeleteSample.js][projectsdeletesample] | Deletes a Project resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Delete.json | -| [projectsGetSample.js][projectsgetsample] | Gets a Project resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Get.json | -| [projectsListSample.js][projectslistsample] | Lists all Projects in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_List.json | -| [projectsUpdateSample.js][projectsupdatesample] | Updates properties for a Project resource. Properties not specified in the request body will be unchanged. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Update.json | -| [storageMoversCreateOrUpdateSample.js][storagemoverscreateorupdatesample] | Creates or updates a top-level Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_CreateOrUpdate.json | -| [storageMoversDeleteSample.js][storagemoversdeletesample] | Deletes a Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Delete.json | -| [storageMoversGetSample.js][storagemoversgetsample] | Gets a Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Get.json | -| [storageMoversListBySubscriptionSample.js][storagemoverslistbysubscriptionsample] | Lists all Storage Movers in a subscription. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_ListBySubscription.json | -| [storageMoversListSample.js][storagemoverslistsample] | Lists all Storage Movers in a resource group. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_List.json | -| [storageMoversUpdateSample.js][storagemoversupdatesample] | Updates properties for a Storage Mover resource. Properties not specified in the request body will be unchanged. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Update.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -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 agentsCreateOrUpdateSample.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 dev-tool run vendored cross-env STORAGEMOVER_SUBSCRIPTION_ID="" STORAGEMOVER_RESOURCE_GROUP="" node agentsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[agentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsCreateOrUpdateSample.js -[agentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsDeleteSample.js -[agentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsGetSample.js -[agentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsListSample.js -[agentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsUpdateSample.js -[endpointscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsCreateOrUpdateSample.js -[endpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsDeleteSample.js -[endpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsGetSample.js -[endpointslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsListSample.js -[endpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsUpdateSample.js -[jobdefinitionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsCreateOrUpdateSample.js -[jobdefinitionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsDeleteSample.js -[jobdefinitionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsGetSample.js -[jobdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsListSample.js -[jobdefinitionsstartjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsStartJobSample.js -[jobdefinitionsstopjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsStopJobSample.js -[jobdefinitionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsUpdateSample.js -[jobrunsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobRunsGetSample.js -[jobrunslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobRunsListSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/operationsListSample.js -[projectscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsCreateOrUpdateSample.js -[projectsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsDeleteSample.js -[projectsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsGetSample.js -[projectslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsListSample.js -[projectsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsUpdateSample.js -[storagemoverscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversCreateOrUpdateSample.js -[storagemoversdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversDeleteSample.js -[storagemoversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversGetSample.js -[storagemoverslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversListBySubscriptionSample.js -[storagemoverslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversListSample.js -[storagemoversupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversUpdateSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-storagemover?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagemover/arm-storagemover/README.md diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsCreateOrUpdateSample.js deleted file mode 100644 index 6814a6dfa465..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsCreateOrUpdateSample.js +++ /dev/null @@ -1,132 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * - * @summary Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_MaximumSet.json - */ -async function agentsCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent = { - description: "Example Agent Description", - arcResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", - uploadLimitSchedule: { - weeklyRecurrences: [ - { - days: ["Monday"], - endTime: { hour: 18, minute: 30 }, - limitInMbps: 2000, - startTime: { hour: 9, minute: 0 }, - }, - ], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.createOrUpdate( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * - * @summary Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_MinimumSet.json - */ -async function agentsCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent = { - arcResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.createOrUpdate( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * - * @summary Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.json - */ -async function agentsCreateOrUpdateWithOvernightUploadLimitSchedule() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent = { - arcResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", - uploadLimitSchedule: { - weeklyRecurrences: [ - { - days: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], - endTime: { hour: 24, minute: 0 }, - limitInMbps: 2000, - startTime: { hour: 18, minute: 0 }, - }, - { - days: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], - endTime: { hour: 9, minute: 0 }, - limitInMbps: 2000, - startTime: { hour: 0, minute: 0 }, - }, - ], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.createOrUpdate( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -async function main() { - agentsCreateOrUpdateMaximumSet(); - agentsCreateOrUpdateMinimumSet(); - agentsCreateOrUpdateWithOvernightUploadLimitSchedule(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsDeleteSample.js deleted file mode 100644 index 90f345509822..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsDeleteSample.js +++ /dev/null @@ -1,41 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes an Agent resource. - * - * @summary Deletes an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Delete.json - */ -async function agentsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - agentName, - ); - console.log(result); -} - -async function main() { - agentsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsGetSample.js deleted file mode 100644 index a5d2b9e1be6f..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsGetSample.js +++ /dev/null @@ -1,56 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets an Agent resource. - * - * @summary Gets an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Get_MaximumSet.json - */ -async function agentsGetMaximumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.get(resourceGroupName, storageMoverName, agentName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Agent resource. - * - * @summary Gets an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Get_MinimumSet.json - */ -async function agentsGetMinimumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.get(resourceGroupName, storageMoverName, agentName); - console.log(result); -} - -async function main() { - agentsGetMaximumSet(); - agentsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsListSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsListSample.js deleted file mode 100644 index 5b927678a27d..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsListSample.js +++ /dev/null @@ -1,60 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all Agents in a Storage Mover. - * - * @summary Lists all Agents in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_List_MaximumSet.json - */ -async function agentsListMaximumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.agents.list(resourceGroupName, storageMoverName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists all Agents in a Storage Mover. - * - * @summary Lists all Agents in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_List_MinimumSet.json - */ -async function agentsListMinimumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.agents.list(resourceGroupName, storageMoverName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - agentsListMaximumSet(); - agentsListMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsUpdateSample.js deleted file mode 100644 index 6c9e28360993..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/agentsUpdateSample.js +++ /dev/null @@ -1,50 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates an Agent resource. - * - * @summary Creates or updates an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Update.json - */ -async function agentsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent = { - description: "Example Agent Description", - uploadLimitSchedule: { - weeklyRecurrences: [ - { - days: ["Monday"], - endTime: { hour: 18, minute: 30 }, - limitInMbps: 2000, - startTime: { hour: 9, minute: 0 }, - }, - ], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.update(resourceGroupName, storageMoverName, agentName, agent); - console.log(result); -} - -async function main() { - agentsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsCreateOrUpdateSample.js deleted file mode 100644 index e512cb6cc6e4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsCreateOrUpdateSample.js +++ /dev/null @@ -1,153 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json - */ -async function endpointsCreateOrUpdateAzureStorageBlobContainer() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { - description: "Example Storage Blob Container Endpoint Description", - blobContainerName: "examples-blobcontainer", - endpointType: "AzureStorageBlobContainer", - storageAccountResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesa", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.json - */ -async function endpointsCreateOrUpdateAzureStorageSmbFileShare() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { - description: "Example Storage File Share Endpoint Description", - endpointType: "AzureStorageSmbFileShare", - fileShareName: "examples-fileshare", - storageAccountResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesa", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_NfsMount.json - */ -async function endpointsCreateOrUpdateNfsMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { - description: "Example NFS Mount Endpoint Description", - endpointType: "NfsMount", - export: "examples-exportName", - host: "0.0.0.0", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_SmbMount.json - */ -async function endpointsCreateOrUpdateSmbMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { - description: "Example SMB Mount Endpoint Description", - credentials: { - type: "AzureKeyVaultSmb", - passwordUri: "https://examples-azureKeyVault.vault.azure.net/secrets/examples-password", - usernameUri: "https://examples-azureKeyVault.vault.azure.net/secrets/examples-username", - }, - endpointType: "SmbMount", - host: "0.0.0.0", - shareName: "examples-shareName", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -async function main() { - endpointsCreateOrUpdateAzureStorageBlobContainer(); - endpointsCreateOrUpdateAzureStorageSmbFileShare(); - endpointsCreateOrUpdateNfsMount(); - endpointsCreateOrUpdateSmbMount(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsDeleteSample.js deleted file mode 100644 index 198635d91d63..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsDeleteSample.js +++ /dev/null @@ -1,41 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes an Endpoint resource. - * - * @summary Deletes an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Delete.json - */ -async function endpointsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -async function main() { - endpointsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsGetSample.js deleted file mode 100644 index 8f1823b3600a..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsGetSample.js +++ /dev/null @@ -1,94 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_AzureStorageBlobContainer.json - */ -async function endpointsGetAzureStorageBlobContainer() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get(resourceGroupName, storageMoverName, endpointName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_AzureStorageSmbFileShare.json - */ -async function endpointsGetAzureStorageSmbFileShare() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get(resourceGroupName, storageMoverName, endpointName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_NfsMount.json - */ -async function endpointsGetNfsMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get(resourceGroupName, storageMoverName, endpointName); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_SmbMount.json - */ -async function endpointsGetSmbMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get(resourceGroupName, storageMoverName, endpointName); - console.log(result); -} - -async function main() { - endpointsGetAzureStorageBlobContainer(); - endpointsGetAzureStorageSmbFileShare(); - endpointsGetNfsMount(); - endpointsGetSmbMount(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsListSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsListSample.js deleted file mode 100644 index e0709a29b8e9..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsListSample.js +++ /dev/null @@ -1,39 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all Endpoints in a Storage Mover. - * - * @summary Lists all Endpoints in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_List.json - */ -async function endpointsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.endpoints.list(resourceGroupName, storageMoverName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - endpointsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsUpdateSample.js deleted file mode 100644 index 4d6f4b061a8e..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/endpointsUpdateSample.js +++ /dev/null @@ -1,145 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_AzureStorageBlobContainer.json - */ -async function endpointsUpdateAzureStorageBlobContainer() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { - description: "Updated Endpoint Description", - endpointType: "AzureStorageBlobContainer", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_AzureStorageSmbFileShare.json - */ -async function endpointsUpdateAzureStorageSmbFileShare() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { - description: "Updated Endpoint Description", - endpointType: "AzureStorageSmbFileShare", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_NfsMount.json - */ -async function endpointsUpdateNfsMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { - description: "Updated Endpoint Description", - endpointType: "NfsMount", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_SmbMount.json - */ -async function endpointsUpdateSmbMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { - description: "Updated Endpoint Description", - credentials: { - type: "AzureKeyVaultSmb", - passwordUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-updated-password", - usernameUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-updated-username", - }, - endpointType: "SmbMount", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -async function main() { - endpointsUpdateAzureStorageBlobContainer(); - endpointsUpdateAzureStorageSmbFileShare(); - endpointsUpdateNfsMount(); - endpointsUpdateSmbMount(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsCreateOrUpdateSample.js deleted file mode 100644 index e4abbefc1a96..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsCreateOrUpdateSample.js +++ /dev/null @@ -1,53 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a Job Definition resource, which contains configuration for a single unit of managed data transfer. - * - * @summary Creates or updates a Job Definition resource, which contains configuration for a single unit of managed data transfer. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_CreateOrUpdate.json - */ -async function jobDefinitionsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const jobDefinition = { - description: "Example Job Definition Description", - agentName: "migration-agent", - copyMode: "Additive", - sourceName: "examples-sourceEndpointName", - sourceSubpath: "/", - targetName: "examples-targetEndpointName", - targetSubpath: "/", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.createOrUpdate( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - jobDefinition, - ); - console.log(result); -} - -async function main() { - jobDefinitionsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsDeleteSample.js deleted file mode 100644 index 94d8fa82b0c4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsDeleteSample.js +++ /dev/null @@ -1,43 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Job Definition resource. - * - * @summary Deletes a Job Definition resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - projectsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsGetSample.js deleted file mode 100644 index e9756d8b0265..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsGetSample.js +++ /dev/null @@ -1,43 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a Job Definition resource. - * - * @summary Gets a Job Definition resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Get.json - */ -async function jobDefinitionsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.get( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - jobDefinitionsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsListSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsListSample.js deleted file mode 100644 index 9688eb57fd0e..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsListSample.js +++ /dev/null @@ -1,44 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all Job Definitions in a Project. - * - * @summary Lists all Job Definitions in a Project. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_List.json - */ -async function jobDefinitionsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.jobDefinitions.list( - resourceGroupName, - storageMoverName, - projectName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - jobDefinitionsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsStartJobSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsStartJobSample.js deleted file mode 100644 index 5569dab7612d..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsStartJobSample.js +++ /dev/null @@ -1,43 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a new Job Run resource for the specified Job Definition and passes it to the Agent for execution. - * - * @summary Creates a new Job Run resource for the specified Job Definition and passes it to the Agent for execution. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StartJob.json - */ -async function jobDefinitionsStartJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.startJob( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - jobDefinitionsStartJob(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsStopJobSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsStopJobSample.js deleted file mode 100644 index 08001a48ee50..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsStopJobSample.js +++ /dev/null @@ -1,43 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Requests the Agent of any active instance of this Job Definition to stop. - * - * @summary Requests the Agent of any active instance of this Job Definition to stop. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StopJob.json - */ -async function jobDefinitionsStopJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.stopJob( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - jobDefinitionsStopJob(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsUpdateSample.js deleted file mode 100644 index a6c6129f37b7..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobDefinitionsUpdateSample.js +++ /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. -const { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Update.json - */ -async function jobDefinitionsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const jobDefinition = { - description: "Updated Job Definition Description", - agentName: "updatedAgentName", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.update( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - jobDefinition, - ); - console.log(result); -} - -async function main() { - jobDefinitionsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobRunsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobRunsGetSample.js deleted file mode 100644 index 8d01c4ce92de..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobRunsGetSample.js +++ /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. -const { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a Job Run resource. - * - * @summary Gets a Job Run resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_Get.json - */ -async function jobRunsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const jobRunName = "examples-jobRunName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobRuns.get( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - jobRunName, - ); - console.log(result); -} - -async function main() { - jobRunsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobRunsListSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobRunsListSample.js deleted file mode 100644 index 054a65da0664..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/jobRunsListSample.js +++ /dev/null @@ -1,46 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all Job Runs in a Job Definition. - * - * @summary Lists all Job Runs in a Job Definition. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_List.json - */ -async function jobRunsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.jobRuns.list( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - jobRunsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/operationsListSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/operationsListSample.js deleted file mode 100644 index 70f85fe4e018..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/operationsListSample.js +++ /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. -const { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all the supported operations for the Azure Storage Mover REST API. - * - * @summary Lists all the supported operations for the Azure Storage Mover REST API. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/package.json b/sdk/storagemover/arm-storagemover/samples/v2/javascript/package.json deleted file mode 100644 index d1efe76848c2..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-storagemover-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/storagemover/arm-storagemover" - }, - "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/storagemover/arm-storagemover", - "dependencies": { - "@azure/arm-storagemover": "latest", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - } -} diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsCreateOrUpdateSample.js deleted file mode 100644 index 8c7db2a53ca1..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsCreateOrUpdateSample.js +++ /dev/null @@ -1,43 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a Project resource, which is a logical grouping of related jobs. - * - * @summary Creates or updates a Project resource, which is a logical grouping of related jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_CreateOrUpdate.json - */ -async function projectsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const project = { description: "Example Project Description" }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.createOrUpdate( - resourceGroupName, - storageMoverName, - projectName, - project, - ); - console.log(result); -} - -async function main() { - projectsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsDeleteSample.js deleted file mode 100644 index 86a0b9f78990..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsDeleteSample.js +++ /dev/null @@ -1,41 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Project resource. - * - * @summary Deletes a Project resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - projectName, - ); - console.log(result); -} - -async function main() { - projectsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsGetSample.js deleted file mode 100644 index b2afa36bc81d..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsGetSample.js +++ /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. -const { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a Project resource. - * - * @summary Gets a Project resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Get.json - */ -async function projectsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.get(resourceGroupName, storageMoverName, projectName); - console.log(result); -} - -async function main() { - projectsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsListSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsListSample.js deleted file mode 100644 index 496684a1a80d..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsListSample.js +++ /dev/null @@ -1,39 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all Projects in a Storage Mover. - * - * @summary Lists all Projects in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_List.json - */ -async function projectsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.projects.list(resourceGroupName, storageMoverName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - projectsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsUpdateSample.js deleted file mode 100644 index 14a5f8955c28..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/projectsUpdateSample.js +++ /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. -const { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates properties for a Project resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for a Project resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Update.json - */ -async function projectsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const project = { - description: "Example Project Description", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.update( - resourceGroupName, - storageMoverName, - projectName, - project, - ); - console.log(result); -} - -async function main() { - projectsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/sample.env b/sdk/storagemover/arm-storagemover/samples/v2/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/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/storagemover/arm-storagemover/samples/v2/javascript/storageMoversCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversCreateOrUpdateSample.js deleted file mode 100644 index b72b1960db16..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversCreateOrUpdateSample.js +++ /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. -const { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates a top-level Storage Mover resource. - * - * @summary Creates or updates a top-level Storage Mover resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_CreateOrUpdate.json - */ -async function storageMoversCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const storageMover = { - description: "Example Storage Mover Description", - location: "eastus2", - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.createOrUpdate( - resourceGroupName, - storageMoverName, - storageMover, - ); - console.log(result); -} - -async function main() { - storageMoversCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversDeleteSample.js deleted file mode 100644 index 21296d8f1856..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversDeleteSample.js +++ /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. -const { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a Storage Mover resource. - * - * @summary Deletes a Storage Mover resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Delete.json - */ -async function storageMoversDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.beginDeleteAndWait(resourceGroupName, storageMoverName); - console.log(result); -} - -async function main() { - storageMoversDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversGetSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversGetSample.js deleted file mode 100644 index 8b144322955d..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversGetSample.js +++ /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. -const { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a Storage Mover resource. - * - * @summary Gets a Storage Mover resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Get.json - */ -async function storageMoversGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.get(resourceGroupName, storageMoverName); - console.log(result); -} - -async function main() { - storageMoversGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversListBySubscriptionSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversListBySubscriptionSample.js deleted file mode 100644 index 88cd11f213e1..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversListBySubscriptionSample.js +++ /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. -const { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all Storage Movers in a subscription. - * - * @summary Lists all Storage Movers in a subscription. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_ListBySubscription.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.storageMovers.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - storageMoversList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversListSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversListSample.js deleted file mode 100644 index 9496bd1f97b8..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversListSample.js +++ /dev/null @@ -1,38 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all Storage Movers in a resource group. - * - * @summary Lists all Storage Movers in a resource group. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_List.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.storageMovers.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - storageMoversList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversUpdateSample.js deleted file mode 100644 index 4acbd1793cf0..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/javascript/storageMoversUpdateSample.js +++ /dev/null @@ -1,43 +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 { StorageMoverClient } = require("@azure/arm-storagemover"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates properties for a Storage Mover resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for a Storage Mover resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Update.json - */ -async function storageMoversUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const storageMover = { - description: "Updated Storage Mover Description", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.update( - resourceGroupName, - storageMoverName, - storageMover, - ); - console.log(result); -} - -async function main() { - storageMoversUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/README.md b/sdk/storagemover/arm-storagemover/samples/v2/typescript/README.md deleted file mode 100644 index cbdca43345de..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/README.md +++ /dev/null @@ -1,123 +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** | -| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| [agentsCreateOrUpdateSample.ts][agentscreateorupdatesample] | Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_MaximumSet.json | -| [agentsDeleteSample.ts][agentsdeletesample] | Deletes an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Delete.json | -| [agentsGetSample.ts][agentsgetsample] | Gets an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Get_MaximumSet.json | -| [agentsListSample.ts][agentslistsample] | Lists all Agents in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_List_MaximumSet.json | -| [agentsUpdateSample.ts][agentsupdatesample] | Creates or updates an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Update.json | -| [endpointsCreateOrUpdateSample.ts][endpointscreateorupdatesample] | Creates or updates an Endpoint resource, which represents a data transfer source or destination. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json | -| [endpointsDeleteSample.ts][endpointsdeletesample] | Deletes an Endpoint resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Delete.json | -| [endpointsGetSample.ts][endpointsgetsample] | Gets an Endpoint resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_AzureStorageBlobContainer.json | -| [endpointsListSample.ts][endpointslistsample] | Lists all Endpoints in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_List.json | -| [endpointsUpdateSample.ts][endpointsupdatesample] | Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_AzureStorageBlobContainer.json | -| [jobDefinitionsCreateOrUpdateSample.ts][jobdefinitionscreateorupdatesample] | Creates or updates a Job Definition resource, which contains configuration for a single unit of managed data transfer. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_CreateOrUpdate.json | -| [jobDefinitionsDeleteSample.ts][jobdefinitionsdeletesample] | Deletes a Job Definition resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Delete.json | -| [jobDefinitionsGetSample.ts][jobdefinitionsgetsample] | Gets a Job Definition resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Get.json | -| [jobDefinitionsListSample.ts][jobdefinitionslistsample] | Lists all Job Definitions in a Project. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_List.json | -| [jobDefinitionsStartJobSample.ts][jobdefinitionsstartjobsample] | Creates a new Job Run resource for the specified Job Definition and passes it to the Agent for execution. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StartJob.json | -| [jobDefinitionsStopJobSample.ts][jobdefinitionsstopjobsample] | Requests the Agent of any active instance of this Job Definition to stop. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StopJob.json | -| [jobDefinitionsUpdateSample.ts][jobdefinitionsupdatesample] | Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Update.json | -| [jobRunsGetSample.ts][jobrunsgetsample] | Gets a Job Run resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_Get.json | -| [jobRunsListSample.ts][jobrunslistsample] | Lists all Job Runs in a Job Definition. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_List.json | -| [operationsListSample.ts][operationslistsample] | Lists all the supported operations for the Azure Storage Mover REST API. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Operations_List.json | -| [projectsCreateOrUpdateSample.ts][projectscreateorupdatesample] | Creates or updates a Project resource, which is a logical grouping of related jobs. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_CreateOrUpdate.json | -| [projectsDeleteSample.ts][projectsdeletesample] | Deletes a Project resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Delete.json | -| [projectsGetSample.ts][projectsgetsample] | Gets a Project resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Get.json | -| [projectsListSample.ts][projectslistsample] | Lists all Projects in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_List.json | -| [projectsUpdateSample.ts][projectsupdatesample] | Updates properties for a Project resource. Properties not specified in the request body will be unchanged. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Update.json | -| [storageMoversCreateOrUpdateSample.ts][storagemoverscreateorupdatesample] | Creates or updates a top-level Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_CreateOrUpdate.json | -| [storageMoversDeleteSample.ts][storagemoversdeletesample] | Deletes a Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Delete.json | -| [storageMoversGetSample.ts][storagemoversgetsample] | Gets a Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Get.json | -| [storageMoversListBySubscriptionSample.ts][storagemoverslistbysubscriptionsample] | Lists all Storage Movers in a subscription. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_ListBySubscription.json | -| [storageMoversListSample.ts][storagemoverslistsample] | Lists all Storage Movers in a resource group. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_List.json | -| [storageMoversUpdateSample.ts][storagemoversupdatesample] | Updates properties for a Storage Mover resource. Properties not specified in the request body will be unchanged. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Update.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -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/agentsCreateOrUpdateSample.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 dev-tool run vendored cross-env STORAGEMOVER_SUBSCRIPTION_ID="" STORAGEMOVER_RESOURCE_GROUP="" node dist/agentsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[agentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsCreateOrUpdateSample.ts -[agentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsDeleteSample.ts -[agentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsGetSample.ts -[agentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsListSample.ts -[agentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsUpdateSample.ts -[endpointscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsCreateOrUpdateSample.ts -[endpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsDeleteSample.ts -[endpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsGetSample.ts -[endpointslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsListSample.ts -[endpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsUpdateSample.ts -[jobdefinitionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsCreateOrUpdateSample.ts -[jobdefinitionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsDeleteSample.ts -[jobdefinitionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsGetSample.ts -[jobdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsListSample.ts -[jobdefinitionsstartjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsStartJobSample.ts -[jobdefinitionsstopjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsStopJobSample.ts -[jobdefinitionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsUpdateSample.ts -[jobrunsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobRunsGetSample.ts -[jobrunslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobRunsListSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/operationsListSample.ts -[projectscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsCreateOrUpdateSample.ts -[projectsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsDeleteSample.ts -[projectsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsGetSample.ts -[projectslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsListSample.ts -[projectsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsUpdateSample.ts -[storagemoverscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversCreateOrUpdateSample.ts -[storagemoversdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversDeleteSample.ts -[storagemoversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversGetSample.ts -[storagemoverslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversListBySubscriptionSample.ts -[storagemoverslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversListSample.ts -[storagemoversupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversUpdateSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-storagemover?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagemover/arm-storagemover/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/package.json b/sdk/storagemover/arm-storagemover/samples/v2/typescript/package.json deleted file mode 100644 index 358bcab2c022..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-storagemover-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/storagemover/arm-storagemover" - }, - "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/storagemover/arm-storagemover", - "dependencies": { - "@azure/arm-storagemover": "latest", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.7.2", - "rimraf": "latest" - } -} diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/sample.env b/sdk/storagemover/arm-storagemover/samples/v2/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/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/storagemover/arm-storagemover/samples/v2/typescript/src/agentsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsCreateOrUpdateSample.ts deleted file mode 100644 index 596cba244e26..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,156 +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 { Agent, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * - * @summary Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_MaximumSet.json - */ -async function agentsCreateOrUpdateMaximumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: Agent = { - description: "Example Agent Description", - arcResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", - uploadLimitSchedule: { - weeklyRecurrences: [ - { - days: ["Monday"], - endTime: { hour: 18, minute: 30 }, - limitInMbps: 2000, - startTime: { hour: 9, minute: 0 }, - }, - ], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.createOrUpdate( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * - * @summary Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_MinimumSet.json - */ -async function agentsCreateOrUpdateMinimumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: Agent = { - arcResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.createOrUpdate( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * - * @summary Creates or updates an Agent resource, which references a hybrid compute machine that can run jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.json - */ -async function agentsCreateOrUpdateWithOvernightUploadLimitSchedule() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: Agent = { - arcResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", - uploadLimitSchedule: { - weeklyRecurrences: [ - { - days: [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday", - ], - endTime: { hour: 24, minute: 0 }, - limitInMbps: 2000, - startTime: { hour: 18, minute: 0 }, - }, - { - days: [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday", - ], - endTime: { hour: 9, minute: 0 }, - limitInMbps: 2000, - startTime: { hour: 0, minute: 0 }, - }, - ], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.createOrUpdate( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -async function main() { - agentsCreateOrUpdateMaximumSet(); - agentsCreateOrUpdateMinimumSet(); - agentsCreateOrUpdateWithOvernightUploadLimitSchedule(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsDeleteSample.ts deleted file mode 100644 index 8a0592314c95..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsDeleteSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an Agent resource. - * - * @summary Deletes an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Delete.json - */ -async function agentsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - agentName, - ); - console.log(result); -} - -async function main() { - agentsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsGetSample.ts deleted file mode 100644 index 1c43f29f10a1..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsGetSample.ts +++ /dev/null @@ -1,70 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an Agent resource. - * - * @summary Gets an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Get_MaximumSet.json - */ -async function agentsGetMaximumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.get( - resourceGroupName, - storageMoverName, - agentName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Agent resource. - * - * @summary Gets an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Get_MinimumSet.json - */ -async function agentsGetMinimumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.get( - resourceGroupName, - storageMoverName, - agentName, - ); - console.log(result); -} - -async function main() { - agentsGetMaximumSet(); - agentsGetMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsListSample.ts deleted file mode 100644 index ca7ba4f779f2..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsListSample.ts +++ /dev/null @@ -1,72 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Agents in a Storage Mover. - * - * @summary Lists all Agents in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_List_MaximumSet.json - */ -async function agentsListMaximumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.agents.list( - resourceGroupName, - storageMoverName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * This sample demonstrates how to Lists all Agents in a Storage Mover. - * - * @summary Lists all Agents in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_List_MinimumSet.json - */ -async function agentsListMinimumSet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.agents.list( - resourceGroupName, - storageMoverName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - agentsListMaximumSet(); - agentsListMinimumSet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsUpdateSample.ts deleted file mode 100644 index aa5013233155..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/agentsUpdateSample.ts +++ /dev/null @@ -1,62 +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 { - AgentUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an Agent resource. - * - * @summary Creates or updates an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Agents_Update.json - */ -async function agentsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: AgentUpdateParameters = { - description: "Example Agent Description", - uploadLimitSchedule: { - weeklyRecurrences: [ - { - days: ["Monday"], - endTime: { hour: 18, minute: 30 }, - limitInMbps: 2000, - startTime: { hour: 9, minute: 0 }, - }, - ], - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.agents.update( - resourceGroupName, - storageMoverName, - agentName, - agent, - ); - console.log(result); -} - -async function main() { - agentsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsCreateOrUpdateSample.ts deleted file mode 100644 index 9bda1719d2ea..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsCreateOrUpdateSample.ts +++ /dev/null @@ -1,165 +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 { Endpoint, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json - */ -async function endpointsCreateOrUpdateAzureStorageBlobContainer() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example Storage Blob Container Endpoint Description", - blobContainerName: "examples-blobcontainer", - endpointType: "AzureStorageBlobContainer", - storageAccountResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesa", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.json - */ -async function endpointsCreateOrUpdateAzureStorageSmbFileShare() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example Storage File Share Endpoint Description", - endpointType: "AzureStorageSmbFileShare", - fileShareName: "examples-fileshare", - storageAccountResourceId: - "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesa", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_NfsMount.json - */ -async function endpointsCreateOrUpdateNfsMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example NFS Mount Endpoint Description", - endpointType: "NfsMount", - export: "examples-exportName", - host: "0.0.0.0", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * - * @summary Creates or updates an Endpoint resource, which represents a data transfer source or destination. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_CreateOrUpdate_SmbMount.json - */ -async function endpointsCreateOrUpdateSmbMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example SMB Mount Endpoint Description", - credentials: { - type: "AzureKeyVaultSmb", - passwordUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-password", - usernameUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-username", - }, - endpointType: "SmbMount", - host: "0.0.0.0", - shareName: "examples-shareName", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.createOrUpdate( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -async function main() { - endpointsCreateOrUpdateAzureStorageBlobContainer(); - endpointsCreateOrUpdateAzureStorageSmbFileShare(); - endpointsCreateOrUpdateNfsMount(); - endpointsCreateOrUpdateSmbMount(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsDeleteSample.ts deleted file mode 100644 index 41ceb5668cab..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsDeleteSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an Endpoint resource. - * - * @summary Deletes an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Delete.json - */ -async function endpointsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -async function main() { - endpointsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsGetSample.ts deleted file mode 100644 index d18feec97d9b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsGetSample.ts +++ /dev/null @@ -1,120 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_AzureStorageBlobContainer.json - */ -async function endpointsGetAzureStorageBlobContainer() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_AzureStorageSmbFileShare.json - */ -async function endpointsGetAzureStorageSmbFileShare() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_NfsMount.json - */ -async function endpointsGetNfsMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Get_SmbMount.json - */ -async function endpointsGetSmbMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.get( - resourceGroupName, - storageMoverName, - endpointName, - ); - console.log(result); -} - -async function main() { - endpointsGetAzureStorageBlobContainer(); - endpointsGetAzureStorageSmbFileShare(); - endpointsGetNfsMount(); - endpointsGetSmbMount(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsListSample.ts deleted file mode 100644 index 022718bbe4c8..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsListSample.ts +++ /dev/null @@ -1,46 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Endpoints in a Storage Mover. - * - * @summary Lists all Endpoints in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_List.json - */ -async function endpointsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.endpoints.list( - resourceGroupName, - storageMoverName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - endpointsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsUpdateSample.ts deleted file mode 100644 index a0892b46912e..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/endpointsUpdateSample.ts +++ /dev/null @@ -1,158 +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 { - EndpointBaseUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_AzureStorageBlobContainer.json - */ -async function endpointsUpdateAzureStorageBlobContainer() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: EndpointBaseUpdateParameters = { - properties: { - description: "Updated Endpoint Description", - endpointType: "AzureStorageBlobContainer", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_AzureStorageSmbFileShare.json - */ -async function endpointsUpdateAzureStorageSmbFileShare() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: EndpointBaseUpdateParameters = { - properties: { - description: "Updated Endpoint Description", - endpointType: "AzureStorageSmbFileShare", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_NfsMount.json - */ -async function endpointsUpdateNfsMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: EndpointBaseUpdateParameters = { - properties: { - description: "Updated Endpoint Description", - endpointType: "NfsMount", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for an Endpoint resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Endpoints_Update_SmbMount.json - */ -async function endpointsUpdateSmbMount() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: EndpointBaseUpdateParameters = { - properties: { - description: "Updated Endpoint Description", - credentials: { - type: "AzureKeyVaultSmb", - passwordUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-updated-password", - usernameUri: - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-updated-username", - }, - endpointType: "SmbMount", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.endpoints.update( - resourceGroupName, - storageMoverName, - endpointName, - endpoint, - ); - console.log(result); -} - -async function main() { - endpointsUpdateAzureStorageBlobContainer(); - endpointsUpdateAzureStorageSmbFileShare(); - endpointsUpdateNfsMount(); - endpointsUpdateSmbMount(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsCreateOrUpdateSample.ts deleted file mode 100644 index 689f30203019..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsCreateOrUpdateSample.ts +++ /dev/null @@ -1,57 +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 { JobDefinition, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a Job Definition resource, which contains configuration for a single unit of managed data transfer. - * - * @summary Creates or updates a Job Definition resource, which contains configuration for a single unit of managed data transfer. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_CreateOrUpdate.json - */ -async function jobDefinitionsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const jobDefinition: JobDefinition = { - description: "Example Job Definition Description", - agentName: "migration-agent", - copyMode: "Additive", - sourceName: "examples-sourceEndpointName", - sourceSubpath: "/", - targetName: "examples-targetEndpointName", - targetSubpath: "/", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.createOrUpdate( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - jobDefinition, - ); - console.log(result); -} - -async function main() { - jobDefinitionsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsDeleteSample.ts deleted file mode 100644 index 6f6efcad03a0..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsDeleteSample.ts +++ /dev/null @@ -1,47 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Job Definition resource. - * - * @summary Deletes a Job Definition resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - projectsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsGetSample.ts deleted file mode 100644 index 9cb7315d21e1..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsGetSample.ts +++ /dev/null @@ -1,47 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Job Definition resource. - * - * @summary Gets a Job Definition resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Get.json - */ -async function jobDefinitionsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.get( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - jobDefinitionsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsListSample.ts deleted file mode 100644 index 549ce892193c..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsListSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Job Definitions in a Project. - * - * @summary Lists all Job Definitions in a Project. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_List.json - */ -async function jobDefinitionsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.jobDefinitions.list( - resourceGroupName, - storageMoverName, - projectName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - jobDefinitionsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsStartJobSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsStartJobSample.ts deleted file mode 100644 index 4ef05859d435..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsStartJobSample.ts +++ /dev/null @@ -1,47 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a new Job Run resource for the specified Job Definition and passes it to the Agent for execution. - * - * @summary Creates a new Job Run resource for the specified Job Definition and passes it to the Agent for execution. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StartJob.json - */ -async function jobDefinitionsStartJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.startJob( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - jobDefinitionsStartJob(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsStopJobSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsStopJobSample.ts deleted file mode 100644 index 8d85ea36320c..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsStopJobSample.ts +++ /dev/null @@ -1,47 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Requests the Agent of any active instance of this Job Definition to stop. - * - * @summary Requests the Agent of any active instance of this Job Definition to stop. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_StopJob.json - */ -async function jobDefinitionsStopJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.stopJob( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - ); - console.log(result); -} - -async function main() { - jobDefinitionsStopJob(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsUpdateSample.ts deleted file mode 100644 index 1b383f96b689..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobDefinitionsUpdateSample.ts +++ /dev/null @@ -1,55 +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 { - JobDefinitionUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for a Job Definition resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobDefinitions_Update.json - */ -async function jobDefinitionsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const jobDefinition: JobDefinitionUpdateParameters = { - description: "Updated Job Definition Description", - agentName: "updatedAgentName", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobDefinitions.update( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - jobDefinition, - ); - console.log(result); -} - -async function main() { - jobDefinitionsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobRunsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobRunsGetSample.ts deleted file mode 100644 index e88fcdb19baa..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobRunsGetSample.ts +++ /dev/null @@ -1,49 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Job Run resource. - * - * @summary Gets a Job Run resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_Get.json - */ -async function jobRunsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const jobRunName = "examples-jobRunName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.jobRuns.get( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - jobRunName, - ); - console.log(result); -} - -async function main() { - jobRunsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobRunsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobRunsListSample.ts deleted file mode 100644 index 752d48574814..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/jobRunsListSample.ts +++ /dev/null @@ -1,50 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Job Runs in a Job Definition. - * - * @summary Lists all Job Runs in a Job Definition. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/JobRuns_List.json - */ -async function jobRunsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const jobDefinitionName = "examples-jobDefinitionName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.jobRuns.list( - resourceGroupName, - storageMoverName, - projectName, - jobDefinitionName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - jobRunsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/operationsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/operationsListSample.ts deleted file mode 100644 index 8ab240b83ce9..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,40 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all the supported operations for the Azure Storage Mover REST API. - * - * @summary Lists all the supported operations for the Azure Storage Mover REST API. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsCreateOrUpdateSample.ts deleted file mode 100644 index 3069a96a9b2b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsCreateOrUpdateSample.ts +++ /dev/null @@ -1,47 +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 { Project, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a Project resource, which is a logical grouping of related jobs. - * - * @summary Creates or updates a Project resource, which is a logical grouping of related jobs. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_CreateOrUpdate.json - */ -async function projectsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const project: Project = { description: "Example Project Description" }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.createOrUpdate( - resourceGroupName, - storageMoverName, - projectName, - project, - ); - console.log(result); -} - -async function main() { - projectsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsDeleteSample.ts deleted file mode 100644 index 05b10a7aba58..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsDeleteSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Project resource. - * - * @summary Deletes a Project resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - projectName, - ); - console.log(result); -} - -async function main() { - projectsDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsGetSample.ts deleted file mode 100644 index f38a960bca3b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsGetSample.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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Project resource. - * - * @summary Gets a Project resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Get.json - */ -async function projectsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.get( - resourceGroupName, - storageMoverName, - projectName, - ); - console.log(result); -} - -async function main() { - projectsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsListSample.ts deleted file mode 100644 index 3a0c3ebfffae..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsListSample.ts +++ /dev/null @@ -1,46 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Projects in a Storage Mover. - * - * @summary Lists all Projects in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_List.json - */ -async function projectsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.projects.list( - resourceGroupName, - storageMoverName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - projectsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsUpdateSample.ts deleted file mode 100644 index c400bff8d407..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/projectsUpdateSample.ts +++ /dev/null @@ -1,52 +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 { - ProjectUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates properties for a Project resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for a Project resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/Projects_Update.json - */ -async function projectsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const projectName = "examples-projectName"; - const project: ProjectUpdateParameters = { - description: "Example Project Description", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.projects.update( - resourceGroupName, - storageMoverName, - projectName, - project, - ); - console.log(result); -} - -async function main() { - projectsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversCreateOrUpdateSample.ts deleted file mode 100644 index 766dec10f3bb..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversCreateOrUpdateSample.ts +++ /dev/null @@ -1,49 +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 { StorageMover, StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates a top-level Storage Mover resource. - * - * @summary Creates or updates a top-level Storage Mover resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_CreateOrUpdate.json - */ -async function storageMoversCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const storageMover: StorageMover = { - description: "Example Storage Mover Description", - location: "eastus2", - tags: { key1: "value1", key2: "value2" }, - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.createOrUpdate( - resourceGroupName, - storageMoverName, - storageMover, - ); - console.log(result); -} - -async function main() { - storageMoversCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversDeleteSample.ts deleted file mode 100644 index e25ea195fc02..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversDeleteSample.ts +++ /dev/null @@ -1,43 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a Storage Mover resource. - * - * @summary Deletes a Storage Mover resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Delete.json - */ -async function storageMoversDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.beginDeleteAndWait( - resourceGroupName, - storageMoverName, - ); - console.log(result); -} - -async function main() { - storageMoversDelete(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversGetSample.ts deleted file mode 100644 index c336a529613c..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversGetSample.ts +++ /dev/null @@ -1,43 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Storage Mover resource. - * - * @summary Gets a Storage Mover resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Get.json - */ -async function storageMoversGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.get( - resourceGroupName, - storageMoverName, - ); - console.log(result); -} - -async function main() { - storageMoversGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversListBySubscriptionSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversListBySubscriptionSample.ts deleted file mode 100644 index e800ebc0b5f4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +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 { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Storage Movers in a subscription. - * - * @summary Lists all Storage Movers in a subscription. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_ListBySubscription.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.storageMovers.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - storageMoversList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversListSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversListSample.ts deleted file mode 100644 index 0dc26c469ac9..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversListSample.ts +++ /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. -import { StorageMoverClient } from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all Storage Movers in a resource group. - * - * @summary Lists all Storage Movers in a resource group. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_List.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.storageMovers.list(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - storageMoversList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversUpdateSample.ts deleted file mode 100644 index f652e4e6edec..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/src/storageMoversUpdateSample.ts +++ /dev/null @@ -1,50 +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 { - StorageMoverUpdateParameters, - StorageMoverClient, -} from "@azure/arm-storagemover"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates properties for a Storage Mover resource. Properties not specified in the request body will be unchanged. - * - * @summary Updates properties for a Storage Mover resource. Properties not specified in the request body will be unchanged. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2024-07-01/examples/StorageMovers_Update.json - */ -async function storageMoversUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "60bcfc77-6589-4da2-b7fd-f9ec9322cf95"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const storageMover: StorageMoverUpdateParameters = { - description: "Updated Storage Mover Description", - }; - const credential = new DefaultAzureCredential(); - const client = new StorageMoverClient(credential, subscriptionId); - const result = await client.storageMovers.update( - resourceGroupName, - storageMoverName, - storageMover, - ); - console.log(result); -} - -async function main() { - storageMoversUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v2/typescript/tsconfig.json b/sdk/storagemover/arm-storagemover/samples/v2/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v2/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "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/storagemover/arm-storagemover/test/sampleTest.ts b/sdk/storagemover/arm-storagemover/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/storagemover/arm-storagemover/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +import { + Recorder, + RecorderStartOptions, + env, +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +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 (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/storagemover/arm-storagemover/test/storagemover_operations_test.spec.ts b/sdk/storagemover/arm-storagemover/test/storagemover_operations_test.spec.ts deleted file mode 100644 index 8a29d9d91f6a..000000000000 --- a/sdk/storagemover/arm-storagemover/test/storagemover_operations_test.spec.ts +++ /dev/null @@ -1,269 +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. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { StorageMoverClient } from "../src/storageMoverClient"; - -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, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("storageMover test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: StorageMoverClient; - let location: string; - let resourceGroup: string; - let storageMoverName: string; - let agentName: string; - let endpointName: string; - let endpointName1: string; - let projectName: string; - let jobDefinitionName: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new StorageMoverClient(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus2euap"; - resourceGroup = "myjstest"; - storageMoverName = "storageMoverName"; - agentName = "testagent"; - endpointName = "testendpoint"; - endpointName1 = "testendpoint1"; - projectName = "testendproject"; - jobDefinitionName = "testjobDefinition"; - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("storageMovers create test", async function () { - const res = await client.storageMovers.createOrUpdate( - resourceGroup, - storageMoverName, - { - description: "Example Storage Mover Description", - location, - tags: { key1: "value1", key2: "value2" } - }); - assert.equal(res.name, storageMoverName); - }); - - it("agents create test", async function () { - const arcResourceid = "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroup + "/providers/Microsoft.HybridCompute/machines/testhybridCompute" - const res = await client.agents.createOrUpdate( - resourceGroup, - storageMoverName, - agentName, - { - description: "Example Agent Description", - arcResourceId: arcResourceid, - arcVmUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9" - }); - assert.equal(res.name, agentName); - }); - - it("endpoints create test", async function () { - const said = "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroup + "/providers/Microsoft.Storage/storageAccounts/teststorageaccountxxx1" - const res = await client.endpoints.createOrUpdate( - resourceGroup, - storageMoverName, - endpointName, - { - properties: { - description: "Example Storage Container Endpoint Description", - blobContainerName: "testblob", - endpointType: "AzureStorageBlobContainer", - storageAccountResourceId: said - } - }); - assert.equal(res.name, endpointName); - - const result = await client.endpoints.createOrUpdate( - resourceGroup, - storageMoverName, - endpointName1, - { - properties: { - endpointType: "NfsMount", - host: endpointName1, - export: "" - } - }); - assert.equal(result.name, endpointName1); - }); - - it("projects create test", async function () { - const res = await client.projects.createOrUpdate( - resourceGroup, - storageMoverName, - projectName, - { - description: "Example Project Description" - }); - assert.equal(res.name, projectName); - }); - - it("jobDefinitions create test", async function () { - const res = await client.jobDefinitions.createOrUpdate( - resourceGroup, - storageMoverName, - projectName, - jobDefinitionName, - { - description: "Example Job Definition Description", - agentName: agentName, - copyMode: "Additive", - sourceName: endpointName1, - sourceSubpath: "/", - targetName: endpointName, - targetSubpath: "/" - }); - assert.equal(res.name, jobDefinitionName); - }); - - it("storageMovers get test", async function () { - const res = await client.storageMovers.get(resourceGroup, storageMoverName); - assert.equal(res.name, storageMoverName); - }); - - it("agent get test", async function () { - const res = await client.agents.get(resourceGroup, storageMoverName, agentName); - assert.equal(res.name, agentName); - }); - - it("endpoints get test", async function () { - const res = await client.endpoints.get(resourceGroup, storageMoverName, endpointName); - assert.equal(res.name, endpointName); - }); - - it("projects get test", async function () { - const res = await client.projects.get(resourceGroup, storageMoverName, projectName); - assert.equal(res.name, projectName); - }); - - it("jobDefinitions get test", async function () { - const res = await client.jobDefinitions.get(resourceGroup, storageMoverName, projectName, jobDefinitionName); - assert.equal(res.name, jobDefinitionName); - }); - - it("endpoints list test", async function () { - const resArray = new Array(); - for await (let item of client.endpoints.list(resourceGroup, storageMoverName)) { - resArray.push(item); - } - assert.equal(resArray.length, 2); - }); - - it("agent list test", async function () { - const resArray = new Array(); - for await (let item of client.agents.list(resourceGroup, storageMoverName)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("projects list test", async function () { - const resArray = new Array(); - for await (let item of client.projects.list(resourceGroup, storageMoverName)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("jobDefinitions list test", async function () { - const resArray = new Array(); - for await (let item of client.jobDefinitions.list(resourceGroup, storageMoverName, projectName)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("storageMovers list test", async function () { - const resArray = new Array(); - for await (let item of client.storageMovers.listBySubscription()) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("jobDefinitions delete test", async function () { - const resArray = new Array(); - const res = await client.jobDefinitions.beginDeleteAndWait(resourceGroup, storageMoverName, projectName, jobDefinitionName, testPollingOptions) - for await (let item of client.jobDefinitions.list(resourceGroup, storageMoverName, projectName)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("agent delete test", async function () { - const resArray = new Array(); - const res = await client.agents.beginDeleteAndWait(resourceGroup, storageMoverName, agentName, testPollingOptions) - for await (let item of client.agents.list(resourceGroup, storageMoverName)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("endpoints delete test", async function () { - const resArray = new Array(); - const res = await client.endpoints.beginDeleteAndWait(resourceGroup, storageMoverName, endpointName, testPollingOptions) - const res1 = await client.endpoints.beginDeleteAndWait(resourceGroup, storageMoverName, endpointName1, testPollingOptions) - for await (let item of client.endpoints.list(resourceGroup, storageMoverName)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("projects delete test", async function () { - const resArray = new Array(); - const res = await client.projects.beginDeleteAndWait(resourceGroup, storageMoverName, projectName, testPollingOptions) - for await (let item of client.projects.list(resourceGroup, storageMoverName)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - it("storageMovers delete test", async function () { - const resArray = new Array(); - const res = await client.storageMovers.beginDeleteAndWait(resourceGroup, storageMoverName, testPollingOptions) - for await (let item of client.storageMovers.listBySubscription()) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); -}) diff --git a/sdk/storagemover/arm-storagemover/tsconfig.json b/sdk/storagemover/arm-storagemover/tsconfig.json index aff39d40c9b4..b35d05ad6e9d 100644 --- a/sdk/storagemover/arm-storagemover/tsconfig.json +++ b/sdk/storagemover/arm-storagemover/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-storagemover": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ - "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "src/**/*.ts", + "test/**/*.ts" ], "exclude": [ "node_modules"