diff --git a/sdk/storagemover/arm-storagemover/CHANGELOG.md b/sdk/storagemover/arm-storagemover/CHANGELOG.md index 8d65e811ae77..abd5732de45a 100644 --- a/sdk/storagemover/arm-storagemover/CHANGELOG.md +++ b/sdk/storagemover/arm-storagemover/CHANGELOG.md @@ -1,15 +1,38 @@ # Release History + +## 2.0.0-beta.1 (2023-07-18) + +**Features** -## 1.0.1 (Unreleased) + - 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 -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +**Breaking Changes** + - 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 + - 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/js-track2-quickstart). diff --git a/sdk/storagemover/arm-storagemover/README.md b/sdk/storagemover/arm-storagemover/README.md index 411dde446c2f..8f64927a90ed 100644 --- a/sdk/storagemover/arm-storagemover/README.md +++ b/sdk/storagemover/arm-storagemover/README.md @@ -6,7 +6,7 @@ The Azure Storage Mover REST API. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagemover/arm-storagemover) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-storagemover) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-storagemover) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-storagemover?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/storagemover/arm-storagemover/_meta.json b/sdk/storagemover/arm-storagemover/_meta.json index fc40817da6cf..0c80ad258160 100644 --- a/sdk/storagemover/arm-storagemover/_meta.json +++ b/sdk/storagemover/arm-storagemover/_meta.json @@ -1,8 +1,8 @@ { - "commit": "80d422bdf9d305b5403c1540fffbcb981269791e", + "commit": "d3af9ae230da00f4afa638dcbbc0ffa066d2354a", "readme": "specification/storagemover/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --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.0-rc.9 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --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.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.9" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ 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 bc3d49317415..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_2f9b95e7ca" -} diff --git a/sdk/storagemover/arm-storagemover/package.json b/sdk/storagemover/arm-storagemover/package.json index e45164a32b6f..d94b6ce3a08d 100644 --- a/sdk/storagemover/arm-storagemover/package.json +++ b/sdk/storagemover/arm-storagemover/package.json @@ -3,12 +3,12 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for StorageMoverClient.", - "version": "1.0.1", + "version": "2.0.0-beta.1", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.3", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", @@ -111,13 +111,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/review/arm-storagemover.api.md b/sdk/storagemover/arm-storagemover/review/arm-storagemover.api.md index 3409f0aa4726..93c30ebe2eba 100644 --- a/sdk/storagemover/arm-storagemover/review/arm-storagemover.api.md +++ b/sdk/storagemover/arm-storagemover/review/arm-storagemover.api.md @@ -26,7 +26,6 @@ export interface Agent extends ProxyResource { readonly memoryInMB?: number; readonly numberOfCores?: number; readonly provisioningState?: ProvisioningState; - readonly systemData?: SystemData; readonly uptimeInSeconds?: number; } @@ -101,7 +100,14 @@ export interface AgentUpdateParameters { description?: string; } -// @public (undocumented) +// @public +export interface AzureKeyVaultSmbCredentials extends Credentials { + passwordUri?: string; + type: "AzureKeyVaultSmb"; + usernameUri?: string; +} + +// @public export interface AzureStorageBlobContainerEndpointProperties extends EndpointBaseProperties { blobContainerName: string; endpointType: "AzureStorageBlobContainer"; @@ -110,6 +116,19 @@ export interface AzureStorageBlobContainerEndpointProperties extends EndpointBas // @public (undocumented) export interface AzureStorageBlobContainerEndpointUpdateProperties extends EndpointBaseUpdateProperties { + endpointType: "AzureStorageBlobContainer"; +} + +// @public +export interface AzureStorageSmbFileShareEndpointProperties extends EndpointBaseProperties { + endpointType: "AzureStorageSmbFileShare"; + fileShareName: string; + storageAccountResourceId: string; +} + +// @public +export interface AzureStorageSmbFileShareEndpointUpdateProperties extends EndpointBaseUpdateProperties { + endpointType: "AzureStorageSmbFileShare"; } // @public @@ -118,32 +137,46 @@ export type CopyMode = string; // @public export type CreatedByType = string; +// @public +export interface Credentials { + type: "AzureKeyVaultSmb"; +} + +// @public (undocumented) +export type CredentialsUnion = Credentials | AzureKeyVaultSmbCredentials; + +// @public +export type CredentialType = string; + // @public export interface Endpoint extends ProxyResource { properties: EndpointBasePropertiesUnion; - readonly systemData?: SystemData; } // @public export interface EndpointBaseProperties { description?: string; - endpointType: "AzureStorageBlobContainer" | "NfsMount"; + endpointType: "AzureStorageBlobContainer" | "NfsMount" | "AzureStorageSmbFileShare" | "SmbMount"; readonly provisioningState?: ProvisioningState; } // @public (undocumented) -export type EndpointBasePropertiesUnion = EndpointBaseProperties | AzureStorageBlobContainerEndpointProperties | NfsMountEndpointProperties; +export type EndpointBasePropertiesUnion = EndpointBaseProperties | AzureStorageBlobContainerEndpointProperties | NfsMountEndpointProperties | AzureStorageSmbFileShareEndpointProperties | SmbMountEndpointProperties; // @public export interface EndpointBaseUpdateParameters { - properties?: EndpointBaseUpdateProperties; + properties?: EndpointBaseUpdatePropertiesUnion; } // @public export interface EndpointBaseUpdateProperties { description?: string; + endpointType: "AzureStorageBlobContainer" | "NfsMount" | "AzureStorageSmbFileShare" | "SmbMount"; } +// @public (undocumented) +export type EndpointBaseUpdatePropertiesUnion = EndpointBaseUpdateProperties | AzureStorageBlobContainerEndpointUpdateProperties | NfsMountEndpointUpdateProperties | AzureStorageSmbFileShareEndpointUpdateProperties | SmbMountEndpointUpdateProperties; + // @public export interface EndpointList { readonly nextLink?: string; @@ -240,7 +273,6 @@ export interface JobDefinition extends ProxyResource { sourceName: string; readonly sourceResourceId?: string; sourceSubpath?: string; - readonly systemData?: SystemData; targetName: string; readonly targetResourceId?: string; targetSubpath?: string; @@ -353,7 +385,6 @@ export interface JobRun extends ProxyResource { readonly sourceProperties?: Record; readonly sourceResourceId?: string; readonly status?: JobRunStatus; - readonly systemData?: SystemData; readonly targetName?: string; readonly targetProperties?: Record; readonly targetResourceId?: string; @@ -439,10 +470,17 @@ export enum KnownCreatedByType { User = "User" } +// @public +export enum KnownCredentialType { + AzureKeyVaultSmb = "AzureKeyVaultSmb" +} + // @public export enum KnownEndpointType { AzureStorageBlobContainer = "AzureStorageBlobContainer", - NfsMount = "NfsMount" + AzureStorageSmbFileShare = "AzureStorageSmbFileShare", + NfsMount = "NfsMount", + SmbMount = "SmbMount" } // @public @@ -483,7 +521,7 @@ export enum KnownProvisioningState { Succeeded = "Succeeded" } -// @public (undocumented) +// @public export interface NfsMountEndpointProperties extends EndpointBaseProperties { endpointType: "NfsMount"; export: string; @@ -493,6 +531,7 @@ export interface NfsMountEndpointProperties extends EndpointBaseProperties { // @public (undocumented) export interface NfsMountEndpointUpdateProperties extends EndpointBaseUpdateProperties { + endpointType: "NfsMount"; } // @public @@ -547,7 +586,6 @@ export type Origin = string; export interface Project extends ProxyResource { description?: string; readonly provisioningState?: ProvisioningState; - readonly systemData?: SystemData; } // @public @@ -623,14 +661,28 @@ export interface ProxyResource extends Resource { export interface Resource { readonly id?: string; readonly name?: string; + readonly systemData?: SystemData; readonly type?: string; } +// @public +export interface SmbMountEndpointProperties extends EndpointBaseProperties { + credentials?: AzureKeyVaultSmbCredentials; + endpointType: "SmbMount"; + host: string; + shareName: string; +} + +// @public +export interface SmbMountEndpointUpdateProperties extends EndpointBaseUpdateProperties { + credentials?: AzureKeyVaultSmbCredentials; + endpointType: "SmbMount"; +} + // @public export interface StorageMover extends TrackedResource { description?: string; readonly provisioningState?: ProvisioningState; - readonly systemData?: SystemData; } // @public (undocumented) 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 38e90820268e..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/agentsCreateOrUpdateSample.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 { 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/2023-03-01/examples/Agents_CreateOrUpdate.json - */ -async function agentsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/11111111-2222-3333-4444-555555555555/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); -} - -async function main() { - agentsCreateOrUpdate(); -} - -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 abaa52fecf87..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/2023-03-01/examples/Agents_Delete.json - */ -async function agentsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 8879c8788ee9..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/agentsGetSample.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 an Agent resource. - * - * @summary Gets an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_Get.json - */ -async function agentsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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() { - agentsGet(); -} - -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 bd362f43a04c..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/agentsListSample.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 Agents in a Storage Mover. - * - * @summary Lists all Agents in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_List.json - */ -async function agentsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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() { - agentsList(); -} - -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 3cd3c7a0aba4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/agentsUpdateSample.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 { - 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/2023-03-01/examples/Agents_Update.json - */ -async function agentsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: AgentUpdateParameters = { - description: "Updated Agent Description" - }; - 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 c0d57401af51..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/endpointsCreateOrUpdateSample.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 { 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/2023-03-01/examples/Endpoints_CreateOrUpdate.json - */ -async function endpointsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example Storage Container Endpoint Description", - blobContainerName: "examples-blobContainerName", - endpointType: "AzureStorageBlobContainer", - storageAccountResourceId: - "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examples-storageAccountName/" - } - }; - 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() { - endpointsCreateOrUpdate(); -} - -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 c561cee43774..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/2023-03-01/examples/Endpoints_Delete.json - */ -async function endpointsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 e379151dbebe..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/endpointsGetSample.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 an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Endpoints_Get.json - */ -async function endpointsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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() { - endpointsGet(); -} - -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 11176c2ead14..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/2023-03-01/examples/Endpoints_List.json - */ -async function endpointsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 beb1b86393b4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples-dev/endpointsUpdateSample.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 { - 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/2023-03-01/examples/Endpoints_Update.json - */ -async function endpointsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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" } - }; - 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() { - endpointsUpdate(); -} - -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 94ce6bc03824..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/2023-03-01/examples/JobDefinitions_CreateOrUpdate.json - */ -async function jobDefinitionsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 64538653d444..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/2023-03-01/examples/JobDefinitions_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 a0799bd2bb28..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/2023-03-01/examples/JobDefinitions_Get.json - */ -async function jobDefinitionsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 988a4be51668..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/2023-03-01/examples/JobDefinitions_List.json - */ -async function jobDefinitionsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 de14a8894857..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 Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource. - * - * @summary Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/JobDefinitions_StartJob.json - */ -async function jobDefinitionsStartJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 9b9c0ee59c14..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/2023-03-01/examples/JobDefinitions_StopJob.json - */ -async function jobDefinitionsStopJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 3ed51e7132ba..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/2023-03-01/examples/JobDefinitions_Update.json - */ -async function jobDefinitionsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 002b2bb31e1b..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/2023-03-01/examples/JobRuns_Get.json - */ -async function jobRunsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 0c1d397c2b3b..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/2023-03-01/examples/JobRuns_List.json - */ -async function jobRunsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 2f7be8c82f9f..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/2023-03-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 0b9c4983354b..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/2023-03-01/examples/Projects_CreateOrUpdate.json - */ -async function projectsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 662712435bcd..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/2023-03-01/examples/Projects_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 9215411e45fc..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/2023-03-01/examples/Projects_Get.json - */ -async function projectsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 0465a2f00913..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/2023-03-01/examples/Projects_List.json - */ -async function projectsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 6fa09b8c36d5..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/2023-03-01/examples/Projects_Update.json - */ -async function projectsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 0a8c3dd3ae1d..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/2023-03-01/examples/StorageMovers_CreateOrUpdate.json - */ -async function storageMoversCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 a5e5bc461377..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/2023-03-01/examples/StorageMovers_Delete.json - */ -async function storageMoversDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 f011143d2b4c..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/2023-03-01/examples/StorageMovers_Get.json - */ -async function storageMoversGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 7441b70fbd32..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/2023-03-01/examples/StorageMovers_ListBySubscription.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 c279149424a0..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/2023-03-01/examples/StorageMovers_List.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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 e7c9ac4945bd..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/2023-03-01/examples/StorageMovers_Update.json - */ -async function storageMoversUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/README.md b/sdk/storagemover/arm-storagemover/samples/v1/javascript/README.md deleted file mode 100644 index 57dfbcb2f9f6..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Agents_CreateOrUpdate.json | -| [agentsDeleteSample.js][agentsdeletesample] | Deletes an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_Delete.json | -| [agentsGetSample.js][agentsgetsample] | Gets an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_Get.json | -| [agentsListSample.js][agentslistsample] | Lists all Agents in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_List.json | -| [agentsUpdateSample.js][agentsupdatesample] | Creates or updates an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-01/examples/Endpoints_CreateOrUpdate.json | -| [endpointsDeleteSample.js][endpointsdeletesample] | Deletes an Endpoint resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Endpoints_Delete.json | -| [endpointsGetSample.js][endpointsgetsample] | Gets an Endpoint resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Endpoints_Get.json | -| [endpointsListSample.js][endpointslistsample] | Lists all Endpoints in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-01/examples/Endpoints_Update.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/2023-03-01/examples/JobDefinitions_CreateOrUpdate.json | -| [jobDefinitionsDeleteSample.js][jobdefinitionsdeletesample] | Deletes a Job Definition resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/JobDefinitions_Delete.json | -| [jobDefinitionsGetSample.js][jobdefinitionsgetsample] | Gets a Job Definition resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-01/examples/JobDefinitions_List.json | -| [jobDefinitionsStartJobSample.js][jobdefinitionsstartjobsample] | Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-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/2023-03-01/examples/JobDefinitions_Update.json | -| [jobRunsGetSample.js][jobrunsgetsample] | Gets a Job Run resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-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/2023-03-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/2023-03-01/examples/Projects_CreateOrUpdate.json | -| [projectsDeleteSample.js][projectsdeletesample] | Deletes a Project resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Projects_Delete.json | -| [projectsGetSample.js][projectsgetsample] | Gets a Project resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-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/2023-03-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/2023-03-01/examples/StorageMovers_CreateOrUpdate.json | -| [storageMoversDeleteSample.js][storagemoversdeletesample] | Deletes a Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/StorageMovers_Delete.json | -| [storageMoversGetSample.js][storagemoversgetsample] | Gets a Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-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/2023-03-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/2023-03-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 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/v1/javascript/agentsCreateOrUpdateSample.js -[agentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsDeleteSample.js -[agentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsGetSample.js -[agentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsListSample.js -[agentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsUpdateSample.js -[endpointscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsCreateOrUpdateSample.js -[endpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsDeleteSample.js -[endpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsGetSample.js -[endpointslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsListSample.js -[endpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsUpdateSample.js -[jobdefinitionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsCreateOrUpdateSample.js -[jobdefinitionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsDeleteSample.js -[jobdefinitionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsGetSample.js -[jobdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsListSample.js -[jobdefinitionsstartjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsStartJobSample.js -[jobdefinitionsstopjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsStopJobSample.js -[jobdefinitionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsUpdateSample.js -[jobrunsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobRunsGetSample.js -[jobrunslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobRunsListSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/operationsListSample.js -[projectscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsCreateOrUpdateSample.js -[projectsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsDeleteSample.js -[projectsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsGetSample.js -[projectslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsListSample.js -[projectsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsUpdateSample.js -[storagemoverscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversCreateOrUpdateSample.js -[storagemoversdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversDeleteSample.js -[storagemoversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversGetSample.js -[storagemoverslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversListBySubscriptionSample.js -[storagemoverslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversListSample.js -[storagemoversupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/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/v1/javascript/agentsCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsCreateOrUpdateSample.js deleted file mode 100644 index 93b6a59936b4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsCreateOrUpdateSample.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 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/2023-03-01/examples/Agents_CreateOrUpdate.json - */ -async function agentsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/11111111-2222-3333-4444-555555555555/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); -} - -async function main() { - agentsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsDeleteSample.js deleted file mode 100644 index ece9df1bde56..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Agents_Delete.json - */ -async function agentsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/agentsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsGetSample.js deleted file mode 100644 index a523eb3fad0b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsGetSample.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 an Agent resource. - * - * @summary Gets an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_Get.json - */ -async function agentsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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() { - agentsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsListSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsListSample.js deleted file mode 100644 index 1ec1b8d17485..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsListSample.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 Agents in a Storage Mover. - * - * @summary Lists all Agents in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_List.json - */ -async function agentsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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() { - agentsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsUpdateSample.js deleted file mode 100644 index 5c3420e2e926..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/javascript/agentsUpdateSample.js +++ /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. -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/2023-03-01/examples/Agents_Update.json - */ -async function agentsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent = { - description: "Updated Agent Description", - }; - 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/v1/javascript/endpointsCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsCreateOrUpdateSample.js deleted file mode 100644 index 6a4d47909ccf..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsCreateOrUpdateSample.js +++ /dev/null @@ -1,51 +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/2023-03-01/examples/Endpoints_CreateOrUpdate.json - */ -async function endpointsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { - description: "Example Storage Container Endpoint Description", - blobContainerName: "examples-blobContainerName", - endpointType: "AzureStorageBlobContainer", - storageAccountResourceId: - "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examples-storageAccountName/", - }, - }; - 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() { - endpointsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsDeleteSample.js deleted file mode 100644 index 343224ce31ba..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Endpoints_Delete.json - */ -async function endpointsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/endpointsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsGetSample.js deleted file mode 100644 index ff0b0643ecb4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsGetSample.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 an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Endpoints_Get.json - */ -async function endpointsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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() { - endpointsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsListSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsListSample.js deleted file mode 100644 index 4bdbda7271f2..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Endpoints_List.json - */ -async function endpointsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/endpointsUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsUpdateSample.js deleted file mode 100644 index 734a0d0d8a13..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/javascript/endpointsUpdateSample.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 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/2023-03-01/examples/Endpoints_Update.json - */ -async function endpointsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint = { - properties: { description: "Updated Endpoint Description" }, - }; - 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() { - endpointsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsCreateOrUpdateSample.js deleted file mode 100644 index 344bd0639f80..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_CreateOrUpdate.json - */ -async function jobDefinitionsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/jobDefinitionsDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsDeleteSample.js deleted file mode 100644 index 6c9a1719a6bc..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/jobDefinitionsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsGetSample.js deleted file mode 100644 index 24f33468c521..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_Get.json - */ -async function jobDefinitionsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/jobDefinitionsListSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsListSample.js deleted file mode 100644 index bb54b6121696..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_List.json - */ -async function jobDefinitionsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/jobDefinitionsStartJobSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsStartJobSample.js deleted file mode 100644 index 45adba0869a1..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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 Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource. - * - * @summary Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/JobDefinitions_StartJob.json - */ -async function jobDefinitionsStartJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/jobDefinitionsStopJobSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsStopJobSample.js deleted file mode 100644 index bea37f6be400..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_StopJob.json - */ -async function jobDefinitionsStopJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/jobDefinitionsUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobDefinitionsUpdateSample.js deleted file mode 100644 index fd0e1c7e08eb..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_Update.json - */ -async function jobDefinitionsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/jobRunsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobRunsGetSample.js deleted file mode 100644 index ef2086c9191a..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobRuns_Get.json - */ -async function jobRunsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/jobRunsListSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/jobRunsListSample.js deleted file mode 100644 index a4770606d184..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobRuns_List.json - */ -async function jobRunsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/operationsListSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index 3b5c27205955..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-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/v1/javascript/package.json b/sdk/storagemover/arm-storagemover/samples/v1/javascript/package.json deleted file mode 100644 index 87ff01b7d801..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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": ">=14.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": "^2.0.1" - } -} diff --git a/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsCreateOrUpdateSample.js deleted file mode 100644 index 1289df6bdde0..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_CreateOrUpdate.json - */ -async function projectsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/projectsDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsDeleteSample.js deleted file mode 100644 index 66f3b6086398..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/projectsGetSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsGetSample.js deleted file mode 100644 index d511ae52fa87..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_Get.json - */ -async function projectsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/projectsListSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsListSample.js deleted file mode 100644 index 93b43d6b4e98..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_List.json - */ -async function projectsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/projectsUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/projectsUpdateSample.js deleted file mode 100644 index c86a115b3b6e..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_Update.json - */ -async function projectsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/sample.env b/sdk/storagemover/arm-storagemover/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversCreateOrUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversCreateOrUpdateSample.js deleted file mode 100644 index 7965d979b1d1..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_CreateOrUpdate.json - */ -async function storageMoversCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/storageMoversDeleteSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversDeleteSample.js deleted file mode 100644 index abfd11e5e19b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_Delete.json - */ -async function storageMoversDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/storageMoversGetSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversGetSample.js deleted file mode 100644 index 4d2eb69e17cf..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_Get.json - */ -async function storageMoversGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/storageMoversListBySubscriptionSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversListBySubscriptionSample.js deleted file mode 100644 index c03ef1178960..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_ListBySubscription.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/storageMoversListSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversListSample.js deleted file mode 100644 index b8e2ccdf5ab7..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_List.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/javascript/storageMoversUpdateSample.js b/sdk/storagemover/arm-storagemover/samples/v1/javascript/storageMoversUpdateSample.js deleted file mode 100644 index a3357c53dd96..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_Update.json - */ -async function storageMoversUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/README.md b/sdk/storagemover/arm-storagemover/samples/v1/typescript/README.md deleted file mode 100644 index 8ddcf812558e..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Agents_CreateOrUpdate.json | -| [agentsDeleteSample.ts][agentsdeletesample] | Deletes an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_Delete.json | -| [agentsGetSample.ts][agentsgetsample] | Gets an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_Get.json | -| [agentsListSample.ts][agentslistsample] | Lists all Agents in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_List.json | -| [agentsUpdateSample.ts][agentsupdatesample] | Creates or updates an Agent resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-01/examples/Endpoints_CreateOrUpdate.json | -| [endpointsDeleteSample.ts][endpointsdeletesample] | Deletes an Endpoint resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Endpoints_Delete.json | -| [endpointsGetSample.ts][endpointsgetsample] | Gets an Endpoint resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Endpoints_Get.json | -| [endpointsListSample.ts][endpointslistsample] | Lists all Endpoints in a Storage Mover. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-01/examples/Endpoints_Update.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/2023-03-01/examples/JobDefinitions_CreateOrUpdate.json | -| [jobDefinitionsDeleteSample.ts][jobdefinitionsdeletesample] | Deletes a Job Definition resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/JobDefinitions_Delete.json | -| [jobDefinitionsGetSample.ts][jobdefinitionsgetsample] | Gets a Job Definition resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-01/examples/JobDefinitions_List.json | -| [jobDefinitionsStartJobSample.ts][jobdefinitionsstartjobsample] | Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-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/2023-03-01/examples/JobDefinitions_Update.json | -| [jobRunsGetSample.ts][jobrunsgetsample] | Gets a Job Run resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-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/2023-03-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/2023-03-01/examples/Projects_CreateOrUpdate.json | -| [projectsDeleteSample.ts][projectsdeletesample] | Deletes a Project resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Projects_Delete.json | -| [projectsGetSample.ts][projectsgetsample] | Gets a Project resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-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/2023-03-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/2023-03-01/examples/StorageMovers_CreateOrUpdate.json | -| [storageMoversDeleteSample.ts][storagemoversdeletesample] | Deletes a Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/StorageMovers_Delete.json | -| [storageMoversGetSample.ts][storagemoversgetsample] | Gets a Storage Mover resource. x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-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/2023-03-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/2023-03-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/2023-03-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 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/v1/typescript/src/agentsCreateOrUpdateSample.ts -[agentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsDeleteSample.ts -[agentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsGetSample.ts -[agentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsListSample.ts -[agentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsUpdateSample.ts -[endpointscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsCreateOrUpdateSample.ts -[endpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsDeleteSample.ts -[endpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsGetSample.ts -[endpointslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsListSample.ts -[endpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsUpdateSample.ts -[jobdefinitionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsCreateOrUpdateSample.ts -[jobdefinitionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsDeleteSample.ts -[jobdefinitionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsGetSample.ts -[jobdefinitionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsListSample.ts -[jobdefinitionsstartjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsStartJobSample.ts -[jobdefinitionsstopjobsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsStopJobSample.ts -[jobdefinitionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsUpdateSample.ts -[jobrunsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobRunsGetSample.ts -[jobrunslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobRunsListSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/operationsListSample.ts -[projectscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsCreateOrUpdateSample.ts -[projectsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsDeleteSample.ts -[projectsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsGetSample.ts -[projectslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsListSample.ts -[projectsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsUpdateSample.ts -[storagemoverscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversCreateOrUpdateSample.ts -[storagemoversdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversDeleteSample.ts -[storagemoversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversGetSample.ts -[storagemoverslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversListBySubscriptionSample.ts -[storagemoverslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversListSample.ts -[storagemoversupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storagemover/arm-storagemover/samples/v1/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/v1/typescript/package.json b/sdk/storagemover/arm-storagemover/samples/v1/typescript/package.json deleted file mode 100644 index 046162def51e..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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": ">=14.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": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~5.0.0", - "rimraf": "latest" - } -} diff --git a/sdk/storagemover/arm-storagemover/samples/v1/typescript/sample.env b/sdk/storagemover/arm-storagemover/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsCreateOrUpdateSample.ts deleted file mode 100644 index 38e90820268e..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsCreateOrUpdateSample.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 { 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/2023-03-01/examples/Agents_CreateOrUpdate.json - */ -async function agentsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/11111111-2222-3333-4444-555555555555/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); -} - -async function main() { - agentsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsDeleteSample.ts deleted file mode 100644 index abaa52fecf87..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Agents_Delete.json - */ -async function agentsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/agentsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsGetSample.ts deleted file mode 100644 index 8879c8788ee9..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsGetSample.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 an Agent resource. - * - * @summary Gets an Agent resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_Get.json - */ -async function agentsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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() { - agentsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsListSample.ts deleted file mode 100644 index bd362f43a04c..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsListSample.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 Agents in a Storage Mover. - * - * @summary Lists all Agents in a Storage Mover. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Agents_List.json - */ -async function agentsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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() { - agentsList(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsUpdateSample.ts deleted file mode 100644 index 3cd3c7a0aba4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/agentsUpdateSample.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 { - 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/2023-03-01/examples/Agents_Update.json - */ -async function agentsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const agentName = "examples-agentName"; - const agent: AgentUpdateParameters = { - description: "Updated Agent Description" - }; - 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/v1/typescript/src/endpointsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsCreateOrUpdateSample.ts deleted file mode 100644 index c0d57401af51..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsCreateOrUpdateSample.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 { 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/2023-03-01/examples/Endpoints_CreateOrUpdate.json - */ -async function endpointsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["STORAGEMOVER_RESOURCE_GROUP"] || "examples-rg"; - const storageMoverName = "examples-storageMoverName"; - const endpointName = "examples-endpointName"; - const endpoint: Endpoint = { - properties: { - description: "Example Storage Container Endpoint Description", - blobContainerName: "examples-blobContainerName", - endpointType: "AzureStorageBlobContainer", - storageAccountResourceId: - "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examples-storageAccountName/" - } - }; - 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() { - endpointsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsDeleteSample.ts deleted file mode 100644 index c561cee43774..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Endpoints_Delete.json - */ -async function endpointsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/endpointsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsGetSample.ts deleted file mode 100644 index e379151dbebe..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsGetSample.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 an Endpoint resource. - * - * @summary Gets an Endpoint resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/Endpoints_Get.json - */ -async function endpointsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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() { - endpointsGet(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsListSample.ts deleted file mode 100644 index 11176c2ead14..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Endpoints_List.json - */ -async function endpointsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/endpointsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsUpdateSample.ts deleted file mode 100644 index beb1b86393b4..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/endpointsUpdateSample.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 { - 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/2023-03-01/examples/Endpoints_Update.json - */ -async function endpointsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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" } - }; - 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() { - endpointsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsCreateOrUpdateSample.ts deleted file mode 100644 index 94ce6bc03824..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_CreateOrUpdate.json - */ -async function jobDefinitionsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/jobDefinitionsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsDeleteSample.ts deleted file mode 100644 index 64538653d444..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/jobDefinitionsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsGetSample.ts deleted file mode 100644 index a0799bd2bb28..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_Get.json - */ -async function jobDefinitionsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/jobDefinitionsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsListSample.ts deleted file mode 100644 index 988a4be51668..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_List.json - */ -async function jobDefinitionsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/jobDefinitionsStartJobSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsStartJobSample.ts deleted file mode 100644 index de14a8894857..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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 Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource. - * - * @summary Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource. - * x-ms-original-file: specification/storagemover/resource-manager/Microsoft.StorageMover/stable/2023-03-01/examples/JobDefinitions_StartJob.json - */ -async function jobDefinitionsStartJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/jobDefinitionsStopJobSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsStopJobSample.ts deleted file mode 100644 index 9b9c0ee59c14..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_StopJob.json - */ -async function jobDefinitionsStopJob() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/jobDefinitionsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobDefinitionsUpdateSample.ts deleted file mode 100644 index 3ed51e7132ba..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobDefinitions_Update.json - */ -async function jobDefinitionsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/jobRunsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobRunsGetSample.ts deleted file mode 100644 index 002b2bb31e1b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobRuns_Get.json - */ -async function jobRunsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/jobRunsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/jobRunsListSample.ts deleted file mode 100644 index 0c1d397c2b3b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/JobRuns_List.json - */ -async function jobRunsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/operationsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index 2f7be8c82f9f..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-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/v1/typescript/src/projectsCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsCreateOrUpdateSample.ts deleted file mode 100644 index 0b9c4983354b..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_CreateOrUpdate.json - */ -async function projectsCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/projectsDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsDeleteSample.ts deleted file mode 100644 index 662712435bcd..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_Delete.json - */ -async function projectsDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/projectsGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsGetSample.ts deleted file mode 100644 index 9215411e45fc..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_Get.json - */ -async function projectsGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/projectsListSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsListSample.ts deleted file mode 100644 index 0465a2f00913..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_List.json - */ -async function projectsList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/projectsUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/projectsUpdateSample.ts deleted file mode 100644 index 6fa09b8c36d5..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/Projects_Update.json - */ -async function projectsUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/storageMoversCreateOrUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversCreateOrUpdateSample.ts deleted file mode 100644 index 0a8c3dd3ae1d..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_CreateOrUpdate.json - */ -async function storageMoversCreateOrUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/storageMoversDeleteSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversDeleteSample.ts deleted file mode 100644 index a5e5bc461377..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_Delete.json - */ -async function storageMoversDelete() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/storageMoversGetSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversGetSample.ts deleted file mode 100644 index f011143d2b4c..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_Get.json - */ -async function storageMoversGet() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/storageMoversListBySubscriptionSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversListBySubscriptionSample.ts deleted file mode 100644 index 7441b70fbd32..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_ListBySubscription.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/storageMoversListSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversListSample.ts deleted file mode 100644 index c279149424a0..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_List.json - */ -async function storageMoversList() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/src/storageMoversUpdateSample.ts b/sdk/storagemover/arm-storagemover/samples/v1/typescript/src/storageMoversUpdateSample.ts deleted file mode 100644 index e7c9ac4945bd..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/2023-03-01/examples/StorageMovers_Update.json - */ -async function storageMoversUpdate() { - const subscriptionId = - process.env["STORAGEMOVER_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - 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/v1/typescript/tsconfig.json b/sdk/storagemover/arm-storagemover/samples/v1/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/storagemover/arm-storagemover/samples/v1/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/src/models/index.ts b/sdk/storagemover/arm-storagemover/src/models/index.ts index f45e1fbc3122..e0dafae262dc 100644 --- a/sdk/storagemover/arm-storagemover/src/models/index.ts +++ b/sdk/storagemover/arm-storagemover/src/models/index.ts @@ -11,7 +11,16 @@ import * as coreClient from "@azure/core-client"; export type EndpointBasePropertiesUnion = | EndpointBaseProperties | AzureStorageBlobContainerEndpointProperties - | NfsMountEndpointProperties; + | NfsMountEndpointProperties + | AzureStorageSmbFileShareEndpointProperties + | SmbMountEndpointProperties; +export type EndpointBaseUpdatePropertiesUnion = + | EndpointBaseUpdateProperties + | AzureStorageBlobContainerEndpointUpdateProperties + | NfsMountEndpointUpdateProperties + | AzureStorageSmbFileShareEndpointUpdateProperties + | SmbMountEndpointUpdateProperties; +export type CredentialsUnion = Credentials | AzureKeyVaultSmbCredentials; /** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ export interface OperationListResult { @@ -137,22 +146,6 @@ export interface StorageMoverList { readonly nextLink?: string; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** @@ -170,6 +163,27 @@ export interface Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; } /** The Storage Mover resource. */ @@ -218,7 +232,11 @@ export interface EndpointList { /** The resource specific properties for the Storage Mover resource. */ export interface EndpointBaseProperties { /** Polymorphic discriminator, which specifies the different types this object can be */ - endpointType: "AzureStorageBlobContainer" | "NfsMount"; + endpointType: + | "AzureStorageBlobContainer" + | "NfsMount" + | "AzureStorageSmbFileShare" + | "SmbMount"; /** A description for the Endpoint. */ description?: string; /** @@ -231,11 +249,17 @@ export interface EndpointBaseProperties { /** The Endpoint resource. */ export interface EndpointBaseUpdateParameters { /** The Endpoint resource, which contains information about file sources and targets. */ - properties?: EndpointBaseUpdateProperties; + properties?: EndpointBaseUpdatePropertiesUnion; } /** The Endpoint resource, which contains information about file sources and targets. */ export interface EndpointBaseUpdateProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + endpointType: + | "AzureStorageBlobContainer" + | "NfsMount" + | "AzureStorageSmbFileShare" + | "SmbMount"; /** A description for the Endpoint. */ description?: string; } @@ -308,6 +332,12 @@ export interface JobRunError { target?: string; } +/** The Credentials. */ +export interface Credentials { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "AzureKeyVaultSmb"; +} + /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ export interface TrackedResource extends Resource { /** Resource tags. */ @@ -319,6 +349,7 @@ export interface TrackedResource extends Resource { /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} +/** The properties of Azure Storage blob container endpoint. */ export interface AzureStorageBlobContainerEndpointProperties extends EndpointBaseProperties { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -329,6 +360,7 @@ export interface AzureStorageBlobContainerEndpointProperties blobContainerName: string; } +/** The properties of NFS share endpoint. */ export interface NfsMountEndpointProperties extends EndpointBaseProperties { /** Polymorphic discriminator, which specifies the different types this object can be */ endpointType: "NfsMount"; @@ -340,19 +372,69 @@ export interface NfsMountEndpointProperties extends EndpointBaseProperties { export: string; } +/** The properties of Azure Storage SMB file share endpoint. */ +export interface AzureStorageSmbFileShareEndpointProperties + extends EndpointBaseProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + endpointType: "AzureStorageSmbFileShare"; + /** The Azure Resource ID of the storage account. */ + storageAccountResourceId: string; + /** The name of the Azure Storage file share. */ + fileShareName: string; +} + +/** The properties of SMB share endpoint. */ +export interface SmbMountEndpointProperties extends EndpointBaseProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + endpointType: "SmbMount"; + /** The host name or IP address of the server exporting the file system. */ + host: string; + /** The name of the SMB share being exported from the server. */ + shareName: string; + /** The Azure Key Vault secret URIs which store the required credentials to access the SMB share. */ + credentials?: AzureKeyVaultSmbCredentials; +} + export interface AzureStorageBlobContainerEndpointUpdateProperties - extends EndpointBaseUpdateProperties {} + extends EndpointBaseUpdateProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + endpointType: "AzureStorageBlobContainer"; +} export interface NfsMountEndpointUpdateProperties - extends EndpointBaseUpdateProperties {} + extends EndpointBaseUpdateProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + endpointType: "NfsMount"; +} + +/** The properties of Azure Storage SMB file share endpoint to update. */ +export interface AzureStorageSmbFileShareEndpointUpdateProperties + extends EndpointBaseUpdateProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + endpointType: "AzureStorageSmbFileShare"; +} + +/** The properties of SMB share endpoint to update. */ +export interface SmbMountEndpointUpdateProperties + extends EndpointBaseUpdateProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + endpointType: "SmbMount"; + /** The Azure Key Vault secret URIs which store the required credentials to access the SMB share. */ + credentials?: AzureKeyVaultSmbCredentials; +} + +/** The Azure Key Vault secret URIs which store the credentials. */ +export interface AzureKeyVaultSmbCredentials extends Credentials { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "AzureKeyVaultSmb"; + /** The Azure Key Vault secret URI which stores the username. Use empty string to clean-up existing value. */ + usernameUri?: string; + /** The Azure Key Vault secret URI which stores the password. Use empty string to clean-up existing value. */ + passwordUri?: string; +} /** The Storage Mover resource, which is a container for a group of Agents, Projects, and Endpoints. */ export interface StorageMover extends TrackedResource { - /** - * Resource system metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; /** A description for the Storage Mover. */ description?: string; /** @@ -364,11 +446,6 @@ export interface StorageMover extends TrackedResource { /** The Agent resource. */ export interface Agent extends ProxyResource { - /** - * Resource system metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; /** A description for the Agent. */ description?: string; /** @@ -423,20 +500,10 @@ export interface Agent extends ProxyResource { export interface Endpoint extends ProxyResource { /** The resource specific properties for the Storage Mover resource. */ properties: EndpointBasePropertiesUnion; - /** - * Resource system metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; } /** The Project resource. */ export interface Project extends ProxyResource { - /** - * Resource system metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; /** A description for the Project. */ description?: string; /** @@ -448,11 +515,6 @@ export interface Project extends ProxyResource { /** The Job Definition resource. */ export interface JobDefinition extends ProxyResource { - /** - * Resource system metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; /** A description for the Job Definition. */ description?: string; /** Strategy to use for copy. */ @@ -506,11 +568,6 @@ export interface JobDefinition extends ProxyResource { /** The Job Run resource. */ export interface JobRun extends ProxyResource { - /** - * Resource system metadata. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; /** * The state of the job execution. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -763,7 +820,11 @@ export enum KnownEndpointType { /** AzureStorageBlobContainer */ AzureStorageBlobContainer = "AzureStorageBlobContainer", /** NfsMount */ - NfsMount = "NfsMount" + NfsMount = "NfsMount", + /** AzureStorageSmbFileShare */ + AzureStorageSmbFileShare = "AzureStorageSmbFileShare", + /** SmbMount */ + SmbMount = "SmbMount" } /** @@ -772,7 +833,9 @@ export enum KnownEndpointType { * this enum contains the known values that the service supports. * ### Known values supported by the service * **AzureStorageBlobContainer** \ - * **NfsMount** + * **NfsMount** \ + * **AzureStorageSmbFileShare** \ + * **SmbMount** */ export type EndpointType = string; @@ -872,6 +935,21 @@ export enum KnownNfsVersion { */ export type NfsVersion = string; +/** Known values of {@link CredentialType} that the service accepts. */ +export enum KnownCredentialType { + /** AzureKeyVaultSmb */ + AzureKeyVaultSmb = "AzureKeyVaultSmb" +} + +/** + * Defines values for CredentialType. \ + * {@link KnownCredentialType} can be used interchangeably with CredentialType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AzureKeyVaultSmb** + */ +export type CredentialType = string; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/storagemover/arm-storagemover/src/models/mappers.ts b/sdk/storagemover/arm-storagemover/src/models/mappers.ts index e290f0446688..6836611a5f30 100644 --- a/sdk/storagemover/arm-storagemover/src/models/mappers.ts +++ b/sdk/storagemover/arm-storagemover/src/models/mappers.ts @@ -243,6 +243,43 @@ export const StorageMoverList: coreClient.CompositeMapper = { } }; +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", @@ -288,36 +325,6 @@ export const SystemData: coreClient.CompositeMapper = { } }; -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - export const StorageMoverUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -488,7 +495,19 @@ export const EndpointBaseUpdateProperties: coreClient.CompositeMapper = { type: { name: "Composite", className: "EndpointBaseUpdateProperties", + uberParent: "EndpointBaseUpdateProperties", + polymorphicDiscriminator: { + serializedName: "endpointType", + clientName: "endpointType" + }, modelProperties: { + endpointType: { + serializedName: "endpointType", + required: true, + type: { + name: "String" + } + }, description: { serializedName: "description", type: { @@ -671,6 +690,27 @@ export const JobRunError: coreClient.CompositeMapper = { } }; +export const Credentials: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Credentials", + uberParent: "Credentials", + polymorphicDiscriminator: { + serializedName: "type", + clientName: "type" + }, + modelProperties: { + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -767,10 +807,77 @@ export const NfsMountEndpointProperties: coreClient.CompositeMapper = { } }; +export const AzureStorageSmbFileShareEndpointProperties: coreClient.CompositeMapper = { + serializedName: "AzureStorageSmbFileShare", + type: { + name: "Composite", + className: "AzureStorageSmbFileShareEndpointProperties", + uberParent: "EndpointBaseProperties", + polymorphicDiscriminator: + EndpointBaseProperties.type.polymorphicDiscriminator, + modelProperties: { + ...EndpointBaseProperties.type.modelProperties, + storageAccountResourceId: { + serializedName: "storageAccountResourceId", + required: true, + type: { + name: "String" + } + }, + fileShareName: { + serializedName: "fileShareName", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SmbMountEndpointProperties: coreClient.CompositeMapper = { + serializedName: "SmbMount", + type: { + name: "Composite", + className: "SmbMountEndpointProperties", + uberParent: "EndpointBaseProperties", + polymorphicDiscriminator: + EndpointBaseProperties.type.polymorphicDiscriminator, + modelProperties: { + ...EndpointBaseProperties.type.modelProperties, + host: { + serializedName: "host", + required: true, + type: { + name: "String" + } + }, + shareName: { + serializedName: "shareName", + required: true, + type: { + name: "String" + } + }, + credentials: { + serializedName: "credentials", + type: { + name: "Composite", + className: "AzureKeyVaultSmbCredentials" + } + } + } + } +}; + export const AzureStorageBlobContainerEndpointUpdateProperties: coreClient.CompositeMapper = { + serializedName: "AzureStorageBlobContainer", type: { name: "Composite", className: "AzureStorageBlobContainerEndpointUpdateProperties", + uberParent: "EndpointBaseUpdateProperties", + polymorphicDiscriminator: + EndpointBaseUpdateProperties.type.polymorphicDiscriminator, modelProperties: { ...EndpointBaseUpdateProperties.type.modelProperties } @@ -778,28 +885,85 @@ export const AzureStorageBlobContainerEndpointUpdateProperties: coreClient.Compo }; export const NfsMountEndpointUpdateProperties: coreClient.CompositeMapper = { + serializedName: "NfsMount", type: { name: "Composite", className: "NfsMountEndpointUpdateProperties", + uberParent: "EndpointBaseUpdateProperties", + polymorphicDiscriminator: + EndpointBaseUpdateProperties.type.polymorphicDiscriminator, modelProperties: { ...EndpointBaseUpdateProperties.type.modelProperties } } }; -export const StorageMover: coreClient.CompositeMapper = { +export const AzureStorageSmbFileShareEndpointUpdateProperties: coreClient.CompositeMapper = { + serializedName: "AzureStorageSmbFileShare", type: { name: "Composite", - className: "StorageMover", + className: "AzureStorageSmbFileShareEndpointUpdateProperties", + uberParent: "EndpointBaseUpdateProperties", + polymorphicDiscriminator: + EndpointBaseUpdateProperties.type.polymorphicDiscriminator, modelProperties: { - ...TrackedResource.type.modelProperties, - systemData: { - serializedName: "systemData", + ...EndpointBaseUpdateProperties.type.modelProperties + } + } +}; + +export const SmbMountEndpointUpdateProperties: coreClient.CompositeMapper = { + serializedName: "SmbMount", + type: { + name: "Composite", + className: "SmbMountEndpointUpdateProperties", + uberParent: "EndpointBaseUpdateProperties", + polymorphicDiscriminator: + EndpointBaseUpdateProperties.type.polymorphicDiscriminator, + modelProperties: { + ...EndpointBaseUpdateProperties.type.modelProperties, + credentials: { + serializedName: "credentials", type: { name: "Composite", - className: "SystemData" + className: "AzureKeyVaultSmbCredentials" + } + } + } + } +}; + +export const AzureKeyVaultSmbCredentials: coreClient.CompositeMapper = { + serializedName: "AzureKeyVaultSmb", + type: { + name: "Composite", + className: "AzureKeyVaultSmbCredentials", + uberParent: "Credentials", + polymorphicDiscriminator: Credentials.type.polymorphicDiscriminator, + modelProperties: { + ...Credentials.type.modelProperties, + usernameUri: { + serializedName: "usernameUri", + type: { + name: "String" } }, + passwordUri: { + serializedName: "passwordUri", + type: { + name: "String" + } + } + } + } +}; + +export const StorageMover: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageMover", + modelProperties: { + ...TrackedResource.type.modelProperties, description: { serializedName: "properties.description", type: { @@ -823,13 +987,6 @@ export const Agent: coreClient.CompositeMapper = { className: "Agent", modelProperties: { ...ProxyResource.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, description: { serializedName: "properties.description", type: { @@ -929,13 +1086,6 @@ export const Endpoint: coreClient.CompositeMapper = { name: "Composite", className: "EndpointBaseProperties" } - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } } } } @@ -947,13 +1097,6 @@ export const Project: coreClient.CompositeMapper = { className: "Project", modelProperties: { ...ProxyResource.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, description: { serializedName: "properties.description", type: { @@ -977,13 +1120,6 @@ export const JobDefinition: coreClient.CompositeMapper = { className: "JobDefinition", modelProperties: { ...ProxyResource.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, description: { serializedName: "properties.description", type: { @@ -1088,13 +1224,6 @@ export const JobRun: coreClient.CompositeMapper = { className: "JobRun", modelProperties: { ...ProxyResource.type.modelProperties, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, status: { serializedName: "properties.status", readOnly: true, @@ -1300,6 +1429,15 @@ export const JobRun: coreClient.CompositeMapper = { export let discriminators = { EndpointBaseProperties: EndpointBaseProperties, + EndpointBaseUpdateProperties: EndpointBaseUpdateProperties, + Credentials: Credentials, "EndpointBaseProperties.AzureStorageBlobContainer": AzureStorageBlobContainerEndpointProperties, - "EndpointBaseProperties.NfsMount": NfsMountEndpointProperties + "EndpointBaseProperties.NfsMount": NfsMountEndpointProperties, + "EndpointBaseProperties.AzureStorageSmbFileShare": AzureStorageSmbFileShareEndpointProperties, + "EndpointBaseProperties.SmbMount": SmbMountEndpointProperties, + "EndpointBaseUpdateProperties.AzureStorageBlobContainer": AzureStorageBlobContainerEndpointUpdateProperties, + "EndpointBaseUpdateProperties.NfsMount": NfsMountEndpointUpdateProperties, + "EndpointBaseUpdateProperties.AzureStorageSmbFileShare": AzureStorageSmbFileShareEndpointUpdateProperties, + "EndpointBaseUpdateProperties.SmbMount": SmbMountEndpointUpdateProperties, + "Credentials.AzureKeyVaultSmb": AzureKeyVaultSmbCredentials }; diff --git a/sdk/storagemover/arm-storagemover/src/models/parameters.ts b/sdk/storagemover/arm-storagemover/src/models/parameters.ts index f19365aea4a0..af3130ee2073 100644 --- a/sdk/storagemover/arm-storagemover/src/models/parameters.ts +++ b/sdk/storagemover/arm-storagemover/src/models/parameters.ts @@ -51,7 +51,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-03-01", + defaultValue: "2023-07-01-preview", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/storagemover/arm-storagemover/src/storageMoverClient.ts b/sdk/storagemover/arm-storagemover/src/storageMoverClient.ts index 96be85e8ec76..e640f61a26b9 100644 --- a/sdk/storagemover/arm-storagemover/src/storageMoverClient.ts +++ b/sdk/storagemover/arm-storagemover/src/storageMoverClient.ts @@ -66,7 +66,7 @@ export class StorageMoverClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-storagemover/1.0.1`; + const packageDetails = `azsdk-js-arm-storagemover/2.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -119,7 +119,7 @@ export class StorageMoverClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-03-01"; + this.apiVersion = options.apiVersion || "2023-07-01-preview"; this.operations = new OperationsImpl(this); this.storageMovers = new StorageMoversImpl(this); this.agents = new AgentsImpl(this); diff --git a/sdk/storagemover/arm-storagemover/test/sampleTest.ts b/sdk/storagemover/arm-storagemover/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /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 a1156e766363..000000000000 --- a/sdk/storagemover/arm-storagemover/test/storagemover_operations_test.spec.ts +++ /dev/null @@ -1,265 +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 -}; - -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 = "eastus"; - 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) - 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) - 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) - const res1 = await client.endpoints.beginDeleteAndWait(resourceGroup, storageMoverName, endpointName1) - 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) - 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) - 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..3e6ae96443f3 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" + "./test/**/*.ts" ], "exclude": [ "node_modules"