diff --git a/sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md b/sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md index 429e93f96c30..8af46f7aa033 100644 --- a/sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md +++ b/sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md @@ -1,15 +1,5 @@ # Release History - -## 1.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.3 (2023-04-21) + +## 1.0.0 (2023-08-01) The package of @azure/arm-resourceconnector 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/resourceconnector/arm-resourceconnector/_meta.json b/sdk/resourceconnector/arm-resourceconnector/_meta.json index b5de76bb9817..5309990f547d 100644 --- a/sdk/resourceconnector/arm-resourceconnector/_meta.json +++ b/sdk/resourceconnector/arm-resourceconnector/_meta.json @@ -1,8 +1,8 @@ { - "commit": "9627e7e581c1517585c9f821d89a4903c6514e07", + "commit": "08ddab6d68445a82cdc0065504365641a1d885d9", "readme": "specification/resourceconnector/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\\resourceconnector\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.10 --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/resourceconnector/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.10" + "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/resourceconnector/arm-resourceconnector/assets.json b/sdk/resourceconnector/arm-resourceconnector/assets.json deleted file mode 100644 index a44ac072d1c1..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/resourceconnector/arm-resourceconnector", - "Tag": "js/resourceconnector/arm-resourceconnector_7e3f918c40" -} diff --git a/sdk/resourceconnector/arm-resourceconnector/package.json b/sdk/resourceconnector/arm-resourceconnector/package.json index 8b55cc221426..7af0bd69ce89 100644 --- a/sdk/resourceconnector/arm-resourceconnector/package.json +++ b/sdk/resourceconnector/arm-resourceconnector/package.json @@ -3,12 +3,12 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ResourceConnectorManagementClient.", - "version": "1.0.0-beta.4", + "version": "1.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.4", "@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/resourceconnector/arm-resourceconnector", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourceconnector/arm-resourceconnector" +} \ No newline at end of file diff --git a/sdk/resourceconnector/arm-resourceconnector/review/arm-resourceconnector.api.md b/sdk/resourceconnector/arm-resourceconnector/review/arm-resourceconnector.api.md index 0edbf794432b..6bda335714e6 100644 --- a/sdk/resourceconnector/arm-resourceconnector/review/arm-resourceconnector.api.md +++ b/sdk/resourceconnector/arm-resourceconnector/review/arm-resourceconnector.api.md @@ -278,8 +278,6 @@ export enum KnownDistro { // @public export enum KnownProvider { HCI = "HCI", - KubeVirt = "KubeVirt", - OpenStack = "OpenStack", Scvmm = "SCVMM", VMWare = "VMWare" } @@ -302,6 +300,7 @@ export enum KnownSSHKeyType { export enum KnownStatus { Connected = "Connected", Connecting = "Connecting", + EtcdSnapshotFailed = "ETCDSnapshotFailed", ImageDeprovisioning = "ImageDeprovisioning", ImageDownloaded = "ImageDownloaded", ImageDownloading = "ImageDownloading", @@ -324,6 +323,10 @@ export enum KnownStatus { UpgradePrerequisitesCompleted = "UpgradePrerequisitesCompleted", UpgradingKvaio = "UpgradingKVAIO", Validating = "Validating", + ValidatingEtcdHealth = "ValidatingETCDHealth", + ValidatingImageDownload = "ValidatingImageDownload", + ValidatingImageUpload = "ValidatingImageUpload", + ValidatingSFSConnectivity = "ValidatingSFSConnectivity", WaitingForCloudOperator = "WaitingForCloudOperator", WaitingForHeartbeat = "WaitingForHeartbeat", WaitingForKvaio = "WaitingForKVAIO" @@ -352,12 +355,13 @@ export class ResourceConnectorManagementClient extends coreClient.ServiceClient // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ResourceConnectorManagementClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: ResourceConnectorManagementClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) appliances: Appliances; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesCreateOrUpdateSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesCreateOrUpdateSample.ts deleted file mode 100644 index 45e36832e16a..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesCreateOrUpdateSample.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 { - Appliance, - ResourceConnectorManagementClient -} from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an Appliance in the specified Subscription and Resource Group. - * - * @summary Creates or updates an Appliance in the specified Subscription and Resource Group. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesCreate_Update.json - */ -async function createOrUpdateAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const parameters: Appliance = { - distro: "AKSEdge", - infrastructureConfig: { provider: "VMWare" }, - location: "West US" - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.beginCreateOrUpdateAndWait( - resourceGroupName, - resourceName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesDeleteSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesDeleteSample.ts deleted file mode 100644 index 14e8bf8b0dd5..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesDeleteSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. - * - * @summary Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesDelete.json - */ -async function deleteAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.beginDeleteAndWait( - resourceGroupName, - resourceName - ); - console.log(result); -} - -async function main() { - deleteAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetSample.ts deleted file mode 100644 index 1db5023285b4..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the details of an Appliance with a specified resource group and name. - * - * @summary Gets the details of an Appliance with a specified resource group and name. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesGet.json - */ -async function getAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.get(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - getAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetTelemetryConfigSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetTelemetryConfigSample.ts deleted file mode 100644 index 935614e86059..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetTelemetryConfigSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the telemetry config. - * - * @summary Gets the telemetry config. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/TelemetryConfig.json - */ -async function getTelemetryConfigAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.getTelemetryConfig(); - console.log(result); -} - -async function main() { - getTelemetryConfigAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetUpgradeGraphSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetUpgradeGraphSample.ts deleted file mode 100644 index f2eaa5f71573..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetUpgradeGraphSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. - * - * @summary Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/UpgradeGraph.json - */ -async function getApplianceUpgradeGraph() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const upgradeGraph = "stable"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.getUpgradeGraph( - resourceGroupName, - resourceName, - upgradeGraph - ); - console.log(result); -} - -async function main() { - getApplianceUpgradeGraph(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListByResourceGroupSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListByResourceGroupSample.ts deleted file mode 100644 index 01e243098d0b..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListByResourceGroupSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. - * - * @summary Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListByResourceGroup.json - */ -async function listAppliancesByResourceGroup() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.appliances.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAppliancesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListBySubscriptionSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListBySubscriptionSample.ts deleted file mode 100644 index 88bfe33b101b..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListBySubscriptionSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance - * - * @summary Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListBySubscription.json - */ -async function listAppliancesBySubscription() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.appliances.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAppliancesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListClusterUserCredentialSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListClusterUserCredentialSample.ts deleted file mode 100644 index f80d0ab6b56a..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListClusterUserCredentialSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the cluster user credentials for the dedicated appliance. - * - * @summary Returns the cluster user credentials for the dedicated appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListClusterUserCredential.json - */ -async function listClusterUserCredentialAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.listClusterUserCredential( - resourceGroupName, - resourceName - ); - console.log(result); -} - -async function main() { - listClusterUserCredentialAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListKeysSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListKeysSample.ts deleted file mode 100644 index 571853eb1602..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListKeysSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the cluster customer credentials for the dedicated appliance. - * - * @summary Returns the cluster customer credentials for the dedicated appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListKeys.json - */ -async function listKeysAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.listKeys( - resourceGroupName, - resourceName - ); - console.log(result); -} - -async function main() { - listKeysAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListOperationsSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListOperationsSample.ts deleted file mode 100644 index 3ce6674d3884..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListOperationsSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all available Appliances operations. - * - * @summary Lists all available Appliances operations. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListOperations.json - */ -async function listAppliancesOperations() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.appliances.listOperations()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAppliancesOperations(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesUpdateSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesUpdateSample.ts deleted file mode 100644 index fe1146574296..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesUpdateSample.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 { - AppliancesUpdateOptionalParams, - ResourceConnectorManagementClient -} from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. - * - * @summary Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesPatch.json - */ -async function updateAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const tags = { key: "value" }; - const options: AppliancesUpdateOptionalParams = { tags }; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.update( - resourceGroupName, - resourceName, - options - ); - console.log(result); -} - -async function main() { - updateAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/README.md b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/README.md deleted file mode 100644 index 0c39c53d8d12..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [appliancesCreateOrUpdateSample.js][appliancescreateorupdatesample] | Creates or updates an Appliance in the specified Subscription and Resource Group. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesCreate_Update.json | -| [appliancesDeleteSample.js][appliancesdeletesample] | Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesDelete.json | -| [appliancesGetSample.js][appliancesgetsample] | Gets the details of an Appliance with a specified resource group and name. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesGet.json | -| [appliancesGetTelemetryConfigSample.js][appliancesgettelemetryconfigsample] | Gets the telemetry config. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/TelemetryConfig.json | -| [appliancesGetUpgradeGraphSample.js][appliancesgetupgradegraphsample] | Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/UpgradeGraph.json | -| [appliancesListByResourceGroupSample.js][applianceslistbyresourcegroupsample] | Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListByResourceGroup.json | -| [appliancesListBySubscriptionSample.js][applianceslistbysubscriptionsample] | Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListBySubscription.json | -| [appliancesListClusterUserCredentialSample.js][applianceslistclusterusercredentialsample] | Returns the cluster user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListClusterUserCredential.json | -| [appliancesListKeysSample.js][applianceslistkeyssample] | Returns the cluster customer credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListKeys.json | -| [appliancesListOperationsSample.js][applianceslistoperationssample] | Lists all available Appliances operations. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListOperations.json | -| [appliancesUpdateSample.js][appliancesupdatesample] | Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesPatch.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 appliancesCreateOrUpdateSample.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 RESOURCECONNECTOR_SUBSCRIPTION_ID="" RESOURCECONNECTOR_RESOURCE_GROUP="" node appliancesCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[appliancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesCreateOrUpdateSample.js -[appliancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesDeleteSample.js -[appliancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetSample.js -[appliancesgettelemetryconfigsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetTelemetryConfigSample.js -[appliancesgetupgradegraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetUpgradeGraphSample.js -[applianceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListByResourceGroupSample.js -[applianceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListBySubscriptionSample.js -[applianceslistclusterusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterUserCredentialSample.js -[applianceslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListKeysSample.js -[applianceslistoperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListOperationsSample.js -[appliancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesUpdateSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourceconnector/arm-resourceconnector/README.md diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesCreateOrUpdateSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesCreateOrUpdateSample.js deleted file mode 100644 index 343c8d660588..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesCreateOrUpdateSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates or updates an Appliance in the specified Subscription and Resource Group. - * - * @summary Creates or updates an Appliance in the specified Subscription and Resource Group. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesCreate_Update.json - */ -async function createOrUpdateAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const parameters = { - distro: "AKSEdge", - infrastructureConfig: { provider: "VMWare" }, - location: "West US", - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const result = await client.appliances.beginCreateOrUpdateAndWait( - resourceGroupName, - resourceName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesDeleteSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesDeleteSample.js deleted file mode 100644 index 9df82e2b6ec5..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesDeleteSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. - * - * @summary Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesDelete.json - */ -async function deleteAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const result = await client.appliances.beginDeleteAndWait(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - deleteAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetSample.js deleted file mode 100644 index 63e957a541f4..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the details of an Appliance with a specified resource group and name. - * - * @summary Gets the details of an Appliance with a specified resource group and name. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesGet.json - */ -async function getAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const result = await client.appliances.get(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - getAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetTelemetryConfigSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetTelemetryConfigSample.js deleted file mode 100644 index 49f4ef26bdc6..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetTelemetryConfigSample.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the telemetry config. - * - * @summary Gets the telemetry config. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/TelemetryConfig.json - */ -async function getTelemetryConfigAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const result = await client.appliances.getTelemetryConfig(); - console.log(result); -} - -async function main() { - getTelemetryConfigAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetUpgradeGraphSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetUpgradeGraphSample.js deleted file mode 100644 index 9516afc89b16..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetUpgradeGraphSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. - * - * @summary Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/UpgradeGraph.json - */ -async function getApplianceUpgradeGraph() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const upgradeGraph = "stable"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const result = await client.appliances.getUpgradeGraph( - resourceGroupName, - resourceName, - upgradeGraph - ); - console.log(result); -} - -async function main() { - getApplianceUpgradeGraph(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListByResourceGroupSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListByResourceGroupSample.js deleted file mode 100644 index 9290941f9766..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListByResourceGroupSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. - * - * @summary Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListByResourceGroup.json - */ -async function listAppliancesByResourceGroup() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.appliances.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAppliancesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListBySubscriptionSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListBySubscriptionSample.js deleted file mode 100644 index 2dd076d2a0cb..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListBySubscriptionSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance - * - * @summary Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListBySubscription.json - */ -async function listAppliancesBySubscription() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.appliances.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAppliancesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterUserCredentialSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterUserCredentialSample.js deleted file mode 100644 index e498901dd7fc..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterUserCredentialSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the cluster user credentials for the dedicated appliance. - * - * @summary Returns the cluster user credentials for the dedicated appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListClusterUserCredential.json - */ -async function listClusterUserCredentialAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const result = await client.appliances.listClusterUserCredential(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - listClusterUserCredentialAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListKeysSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListKeysSample.js deleted file mode 100644 index 4b9673f30e87..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListKeysSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns the cluster customer credentials for the dedicated appliance. - * - * @summary Returns the cluster customer credentials for the dedicated appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListKeys.json - */ -async function listKeysAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const result = await client.appliances.listKeys(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - listKeysAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListOperationsSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListOperationsSample.js deleted file mode 100644 index a719052e76e7..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListOperationsSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all available Appliances operations. - * - * @summary Lists all available Appliances operations. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListOperations.json - */ -async function listAppliancesOperations() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.appliances.listOperations()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAppliancesOperations(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesUpdateSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesUpdateSample.js deleted file mode 100644 index 73cc0d22d12a..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesUpdateSample.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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. - * - * @summary Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesPatch.json - */ -async function updateAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const tags = { key: "value" }; - const options = { tags }; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const result = await client.appliances.update(resourceGroupName, resourceName, options); - console.log(result); -} - -async function main() { - updateAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/package.json b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/package.json deleted file mode 100644 index 20b01423812e..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-resourceconnector-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=14.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/resourceconnector/arm-resourceconnector" - }, - "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/resourceconnector/arm-resourceconnector", - "dependencies": { - "@azure/arm-resourceconnector": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/sample.env b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/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/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/README.md b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/README.md deleted file mode 100644 index 96271deaf3eb..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [appliancesCreateOrUpdateSample.ts][appliancescreateorupdatesample] | Creates or updates an Appliance in the specified Subscription and Resource Group. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesCreate_Update.json | -| [appliancesDeleteSample.ts][appliancesdeletesample] | Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesDelete.json | -| [appliancesGetSample.ts][appliancesgetsample] | Gets the details of an Appliance with a specified resource group and name. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesGet.json | -| [appliancesGetTelemetryConfigSample.ts][appliancesgettelemetryconfigsample] | Gets the telemetry config. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/TelemetryConfig.json | -| [appliancesGetUpgradeGraphSample.ts][appliancesgetupgradegraphsample] | Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/UpgradeGraph.json | -| [appliancesListByResourceGroupSample.ts][applianceslistbyresourcegroupsample] | Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListByResourceGroup.json | -| [appliancesListBySubscriptionSample.ts][applianceslistbysubscriptionsample] | Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListBySubscription.json | -| [appliancesListClusterUserCredentialSample.ts][applianceslistclusterusercredentialsample] | Returns the cluster user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListClusterUserCredential.json | -| [appliancesListKeysSample.ts][applianceslistkeyssample] | Returns the cluster customer credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListKeys.json | -| [appliancesListOperationsSample.ts][applianceslistoperationssample] | Lists all available Appliances operations. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListOperations.json | -| [appliancesUpdateSample.ts][appliancesupdatesample] | Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesPatch.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/appliancesCreateOrUpdateSample.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 RESOURCECONNECTOR_SUBSCRIPTION_ID="" RESOURCECONNECTOR_RESOURCE_GROUP="" node dist/appliancesCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[appliancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesCreateOrUpdateSample.ts -[appliancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesDeleteSample.ts -[appliancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetSample.ts -[appliancesgettelemetryconfigsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetTelemetryConfigSample.ts -[appliancesgetupgradegraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetUpgradeGraphSample.ts -[applianceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListByResourceGroupSample.ts -[applianceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListBySubscriptionSample.ts -[applianceslistclusterusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterUserCredentialSample.ts -[applianceslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListKeysSample.ts -[applianceslistoperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListOperationsSample.ts -[appliancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesUpdateSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourceconnector/arm-resourceconnector/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/package.json b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/package.json deleted file mode 100644 index b8636a640124..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-resourceconnector-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "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/resourceconnector/arm-resourceconnector" - }, - "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/resourceconnector/arm-resourceconnector", - "dependencies": { - "@azure/arm-resourceconnector": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~5.0.0", - "rimraf": "latest" - } -} diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/sample.env b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/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/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesCreateOrUpdateSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesCreateOrUpdateSample.ts deleted file mode 100644 index 45e36832e16a..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesCreateOrUpdateSample.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 { - Appliance, - ResourceConnectorManagementClient -} from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates or updates an Appliance in the specified Subscription and Resource Group. - * - * @summary Creates or updates an Appliance in the specified Subscription and Resource Group. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesCreate_Update.json - */ -async function createOrUpdateAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const parameters: Appliance = { - distro: "AKSEdge", - infrastructureConfig: { provider: "VMWare" }, - location: "West US" - }; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.beginCreateOrUpdateAndWait( - resourceGroupName, - resourceName, - parameters - ); - console.log(result); -} - -async function main() { - createOrUpdateAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesDeleteSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesDeleteSample.ts deleted file mode 100644 index 14e8bf8b0dd5..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesDeleteSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. - * - * @summary Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesDelete.json - */ -async function deleteAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.beginDeleteAndWait( - resourceGroupName, - resourceName - ); - console.log(result); -} - -async function main() { - deleteAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetSample.ts deleted file mode 100644 index 1db5023285b4..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the details of an Appliance with a specified resource group and name. - * - * @summary Gets the details of an Appliance with a specified resource group and name. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesGet.json - */ -async function getAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.get(resourceGroupName, resourceName); - console.log(result); -} - -async function main() { - getAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetTelemetryConfigSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetTelemetryConfigSample.ts deleted file mode 100644 index 935614e86059..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetTelemetryConfigSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the telemetry config. - * - * @summary Gets the telemetry config. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/TelemetryConfig.json - */ -async function getTelemetryConfigAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.getTelemetryConfig(); - console.log(result); -} - -async function main() { - getTelemetryConfigAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetUpgradeGraphSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetUpgradeGraphSample.ts deleted file mode 100644 index f2eaa5f71573..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetUpgradeGraphSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. - * - * @summary Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/UpgradeGraph.json - */ -async function getApplianceUpgradeGraph() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const upgradeGraph = "stable"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.getUpgradeGraph( - resourceGroupName, - resourceName, - upgradeGraph - ); - console.log(result); -} - -async function main() { - getApplianceUpgradeGraph(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListByResourceGroupSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListByResourceGroupSample.ts deleted file mode 100644 index 01e243098d0b..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListByResourceGroupSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. - * - * @summary Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListByResourceGroup.json - */ -async function listAppliancesByResourceGroup() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.appliances.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAppliancesByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListBySubscriptionSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListBySubscriptionSample.ts deleted file mode 100644 index 88bfe33b101b..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListBySubscriptionSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance - * - * @summary Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListBySubscription.json - */ -async function listAppliancesBySubscription() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.appliances.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAppliancesBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterUserCredentialSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterUserCredentialSample.ts deleted file mode 100644 index f80d0ab6b56a..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterUserCredentialSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the cluster user credentials for the dedicated appliance. - * - * @summary Returns the cluster user credentials for the dedicated appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListClusterUserCredential.json - */ -async function listClusterUserCredentialAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.listClusterUserCredential( - resourceGroupName, - resourceName - ); - console.log(result); -} - -async function main() { - listClusterUserCredentialAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListKeysSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListKeysSample.ts deleted file mode 100644 index 571853eb1602..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListKeysSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Returns the cluster customer credentials for the dedicated appliance. - * - * @summary Returns the cluster customer credentials for the dedicated appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListKeys.json - */ -async function listKeysAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.listKeys( - resourceGroupName, - resourceName - ); - console.log(result); -} - -async function main() { - listKeysAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListOperationsSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListOperationsSample.ts deleted file mode 100644 index 3ce6674d3884..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListOperationsSample.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 { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all available Appliances operations. - * - * @summary Lists all available Appliances operations. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesListOperations.json - */ -async function listAppliancesOperations() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const resArray = new Array(); - for await (let item of client.appliances.listOperations()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAppliancesOperations(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesUpdateSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesUpdateSample.ts deleted file mode 100644 index fe1146574296..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesUpdateSample.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 { - AppliancesUpdateOptionalParams, - ResourceConnectorManagementClient -} from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. - * - * @summary Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/stable/2022-10-27/examples/AppliancesPatch.json - */ -async function updateAppliance() { - const subscriptionId = - process.env["RESOURCECONNECTOR_SUBSCRIPTION_ID"] || - "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = - process.env["RESOURCECONNECTOR_RESOURCE_GROUP"] || "testresourcegroup"; - const resourceName = "appliance01"; - const tags = { key: "value" }; - const options: AppliancesUpdateOptionalParams = { tags }; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.update( - resourceGroupName, - resourceName, - options - ); - console.log(result); -} - -async function main() { - updateAppliance(); -} - -main().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/tsconfig.json b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/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/resourceconnector/arm-resourceconnector/src/models/index.ts b/sdk/resourceconnector/arm-resourceconnector/src/models/index.ts index 2e89be634b67..a36864fd64fa 100644 --- a/sdk/resourceconnector/arm-resourceconnector/src/models/index.ts +++ b/sdk/resourceconnector/arm-resourceconnector/src/models/index.ts @@ -472,11 +472,7 @@ export enum KnownProvider { /** HCI */ HCI = "HCI", /** Scvmm */ - Scvmm = "SCVMM", - /** KubeVirt */ - KubeVirt = "KubeVirt", - /** OpenStack */ - OpenStack = "OpenStack" + Scvmm = "SCVMM" } /** @@ -486,9 +482,7 @@ export enum KnownProvider { * ### Known values supported by the service * **VMWare** \ * **HCI** \ - * **SCVMM** \ - * **KubeVirt** \ - * **OpenStack** + * **SCVMM** */ export type Provider = string; @@ -506,8 +500,18 @@ export enum KnownStatus { Running = "Running", /** PreparingForUpgrade */ PreparingForUpgrade = "PreparingForUpgrade", + /** EtcdSnapshotFailed */ + EtcdSnapshotFailed = "ETCDSnapshotFailed", /** UpgradePrerequisitesCompleted */ UpgradePrerequisitesCompleted = "UpgradePrerequisitesCompleted", + /** ValidatingSFSConnectivity */ + ValidatingSFSConnectivity = "ValidatingSFSConnectivity", + /** ValidatingImageDownload */ + ValidatingImageDownload = "ValidatingImageDownload", + /** ValidatingImageUpload */ + ValidatingImageUpload = "ValidatingImageUpload", + /** ValidatingEtcdHealth */ + ValidatingEtcdHealth = "ValidatingETCDHealth", /** PreUpgrade */ PreUpgrade = "PreUpgrade", /** UpgradingKvaio */ @@ -561,7 +565,12 @@ export enum KnownStatus { * **Connected** \ * **Running** \ * **PreparingForUpgrade** \ + * **ETCDSnapshotFailed** \ * **UpgradePrerequisitesCompleted** \ + * **ValidatingSFSConnectivity** \ + * **ValidatingImageDownload** \ + * **ValidatingImageUpload** \ + * **ValidatingETCDHealth** \ * **PreUpgrade** \ * **UpgradingKVAIO** \ * **WaitingForKVAIO** \ diff --git a/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts b/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts index 4242a8409119..207d663fd36f 100644 --- a/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts +++ b/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts @@ -21,7 +21,7 @@ import { ResourceConnectorManagementClientOptionalParams } from "./models"; export class ResourceConnectorManagementClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the ResourceConnectorManagementClient class. @@ -33,12 +33,28 @@ export class ResourceConnectorManagementClient extends coreClient.ServiceClient credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ResourceConnectorManagementClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: ResourceConnectorManagementClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: + | ResourceConnectorManagementClientOptionalParams + | string, + options?: ResourceConnectorManagementClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -50,7 +66,7 @@ export class ResourceConnectorManagementClient extends coreClient.ServiceClient credential: credentials }; - const packageDetails = `azsdk-js-arm-resourceconnector/1.0.0-beta.4`; + const packageDetails = `azsdk-js-arm-resourceconnector/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/resourceconnector/arm-resourceconnector/test/resourceconnnector__operations_test.spec.ts b/sdk/resourceconnector/arm-resourceconnector/test/resourceconnnector__operations_test.spec.ts deleted file mode 100644 index c9d12b687194..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/test/resourceconnnector__operations_test.spec.ts +++ /dev/null @@ -1,100 +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 { ResourceConnectorManagementClient } from "../src/resourceConnectorManagementClient"; - -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("ResourceConnector test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: ResourceConnectorManagementClient; - let location: string; - let resourceGroup: string; - let resourcename: 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 ResourceConnectorManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "czwjstest"; - resourcename = "resourcetest"; - - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("appliances create test", async function () { - const res = await client.appliances.beginCreateOrUpdateAndWait( - resourceGroup, - resourcename, - { - identity: { type: "SystemAssigned" }, - distro: "AKSEdge", - infrastructureConfig: { provider: "VMWare" }, - location - }, - testPollingOptions); - assert.equal(res.name, resourcename); - }); - - it("appliances get test", async function () { - const res = await client.appliances.get( - resourceGroup, - resourcename - ); - assert.equal(res.name, resourcename); - }); - - it("appliances list test", async function () { - const resArray = new Array(); - for await (let item of client.appliances.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("appliances delete test", async function () { - const resArray = new Array(); - const res = await client.appliances.beginDeleteAndWait(resourceGroup, resourcename - ) - for await (let item of client.appliances.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); -}) diff --git a/sdk/resourceconnector/arm-resourceconnector/test/sampleTest.ts b/sdk/resourceconnector/arm-resourceconnector/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/resourceconnector/arm-resourceconnector/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/resourceconnector/arm-resourceconnector/tsconfig.json b/sdk/resourceconnector/arm-resourceconnector/tsconfig.json index 680d60e04904..3e6ae96443f3 100644 --- a/sdk/resourceconnector/arm-resourceconnector/tsconfig.json +++ b/sdk/resourceconnector/arm-resourceconnector/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-resourceconnector": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"