diff --git a/sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md b/sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md deleted file mode 100644 index 17ec56523d12..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Release History - -## 1.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.1 (2022-06-28) - -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 7824cc98c15b..bd1e861fb1b5 100644 --- a/sdk/resourceconnector/arm-resourceconnector/_meta.json +++ b/sdk/resourceconnector/arm-resourceconnector/_meta.json @@ -1,8 +1,8 @@ { - "commit": "b8fc2b4ff626aab886f929e49926c6e836548e01", + "commit": "e4c617d2ffa6e0baa472a2ef711265600aed5b1f", "readme": "specification/resourceconnector/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resourceconnector\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1 --generate-sample=true", + "autorest_command": "autorest --version=3.8.4 --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.0-rc.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.2", + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/resourceconnector/arm-resourceconnector/package.json b/sdk/resourceconnector/arm-resourceconnector/package.json index 0b8d7fdb8241..402aef2570b5 100644 --- a/sdk/resourceconnector/arm-resourceconnector/package.json +++ b/sdk/resourceconnector/arm-resourceconnector/package.json @@ -109,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/resourceconnector/arm-resourceconnector/recordings/node/my_test/recording_sample_test.json b/sdk/resourceconnector/arm-resourceconnector/recordings/node/my_test/recording_sample_test.json deleted file mode 100644 index f721723386d8..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/recordings/node/my_test/recording_sample_test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Entries": [], - "Variables": {} -} 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 99946a5d9a96..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesCreateOrUpdateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Appliance, - ResourceConnectorManagementClient -} from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json - */ -async function createOrUpdateAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -createOrUpdateAppliance().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 7b3f3faa0871..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesDelete.json - */ -async function deleteAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -deleteAppliance().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 fdd7de2f8453..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesGet.json - */ -async function getAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -getAppliance().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 e1041504793a..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetUpgradeGraphSample.ts +++ /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. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/UpgradeGraph.json - */ -async function getApplianceUpgradeGraph() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -getApplianceUpgradeGraph().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 23fc56b84965..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListByResourceGroupSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json - */ -async function listAppliancesByResourceGroup() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -listAppliancesByResourceGroup().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 297945f9cc3e..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json - */ -async function listAppliancesBySubscription() { - const subscriptionId = "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); -} - -listAppliancesBySubscription().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListClusterCustomerUserCredentialSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListClusterCustomerUserCredentialSample.ts deleted file mode 100644 index c771174b0e63..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListClusterCustomerUserCredentialSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns the cluster customer user credentials for the dedicated appliance. - * - * @summary Returns the cluster customer user credentials for the dedicated appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json - */ -async function listClusterCustomerUserCredentialAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.listClusterCustomerUserCredential( - resourceGroupName, - resourceName - ); - console.log(result); -} - -listClusterCustomerUserCredentialAppliance().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 78fa54a658df..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListClusterUserCredentialSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json - */ -async function listClusterUserCredentialAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -listClusterUserCredentialAppliance().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 d79569f7af3c..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListOperationsSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListOperations.json - */ -async function listAppliancesOperations() { - const subscriptionId = "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); -} - -listAppliancesOperations().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 6b92ca31d667..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesUpdateSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AppliancesUpdateOptionalParams, - ResourceConnectorManagementClient -} from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesPatch.json - */ -async function updateAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -updateAppliance().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 ecff989b517a..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,68 +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/preview/2022-04-15-preview/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/preview/2022-04-15-preview/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/preview/2022-04-15-preview/examples/AppliancesGet.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/preview/2022-04-15-preview/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/preview/2022-04-15-preview/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/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json | -| [appliancesListClusterCustomerUserCredentialSample.js][applianceslistclustercustomerusercredentialsample] | Returns the cluster customer user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json | -| [appliancesListClusterUserCredentialSample.js][applianceslistclusterusercredentialsample] | Returns the cluster user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json | -| [appliancesListOperationsSample.js][applianceslistoperationssample] | Lists all available Appliances operations. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/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/preview/2022-04-15-preview/examples/AppliancesPatch.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node 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 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 -[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 -[applianceslistclustercustomerusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterCustomerUserCredentialSample.js -[applianceslistclusterusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterUserCredentialSample.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 6394bcde54b2..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesCreateOrUpdateSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json - */ -async function createOrUpdateAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -createOrUpdateAppliance().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 2eeec35aecd4..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesDeleteSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesDelete.json - */ -async function deleteAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -deleteAppliance().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 de3c1f7a7541..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesGet.json - */ -async function getAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -getAppliance().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 0177557be7c1..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetUpgradeGraphSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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/preview/2022-04-15-preview/examples/UpgradeGraph.json - */ -async function getApplianceUpgradeGraph() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -getApplianceUpgradeGraph().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 0bab37984965..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListByResourceGroupSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json - */ -async function listAppliancesByResourceGroup() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -listAppliancesByResourceGroup().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 a45c68f803d0..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListBySubscriptionSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json - */ -async function listAppliancesBySubscription() { - const subscriptionId = "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); -} - -listAppliancesBySubscription().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterCustomerUserCredentialSample.js b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterCustomerUserCredentialSample.js deleted file mode 100644 index 2a108917b51c..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterCustomerUserCredentialSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Returns the cluster customer user credentials for the dedicated appliance. - * - * @summary Returns the cluster customer user credentials for the dedicated appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json - */ -async function listClusterCustomerUserCredentialAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient(credential, subscriptionId); - const result = await client.appliances.listClusterCustomerUserCredential( - resourceGroupName, - resourceName - ); - console.log(result); -} - -listClusterCustomerUserCredentialAppliance().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 f88df99b995f..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterUserCredentialSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json - */ -async function listClusterUserCredentialAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -listClusterUserCredentialAppliance().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 374f5f05a960..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListOperationsSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListOperations.json - */ -async function listAppliancesOperations() { - const subscriptionId = "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); -} - -listAppliancesOperations().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 5dc5448d148a..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesUpdateSample.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesPatch.json - */ -async function updateAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -updateAppliance().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 1c01e1fda08e..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": ">=12.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 27098ebab7d0..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,81 +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/preview/2022-04-15-preview/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/preview/2022-04-15-preview/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/preview/2022-04-15-preview/examples/AppliancesGet.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/preview/2022-04-15-preview/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/preview/2022-04-15-preview/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/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json | -| [appliancesListClusterCustomerUserCredentialSample.ts][applianceslistclustercustomerusercredentialsample] | Returns the cluster customer user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json | -| [appliancesListClusterUserCredentialSample.ts][applianceslistclusterusercredentialsample] | Returns the cluster user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json | -| [appliancesListOperationsSample.ts][applianceslistoperationssample] | Lists all available Appliances operations. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/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/preview/2022-04-15-preview/examples/AppliancesPatch.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/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 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 -[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 -[applianceslistclustercustomerusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterCustomerUserCredentialSample.ts -[applianceslistclusterusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterUserCredentialSample.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 a0e62dbad70c..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": ">=12.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/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": "^12.0.0", - "typescript": "~4.4.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 99946a5d9a96..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesCreateOrUpdateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - Appliance, - ResourceConnectorManagementClient -} from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json - */ -async function createOrUpdateAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -createOrUpdateAppliance().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 7b3f3faa0871..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesDelete.json - */ -async function deleteAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -deleteAppliance().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 fdd7de2f8453..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesGet.json - */ -async function getAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -getAppliance().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 e1041504793a..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetUpgradeGraphSample.ts +++ /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. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/UpgradeGraph.json - */ -async function getApplianceUpgradeGraph() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -getApplianceUpgradeGraph().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 23fc56b84965..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListByResourceGroupSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json - */ -async function listAppliancesByResourceGroup() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -listAppliancesByResourceGroup().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 297945f9cc3e..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListBySubscriptionSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json - */ -async function listAppliancesBySubscription() { - const subscriptionId = "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); -} - -listAppliancesBySubscription().catch(console.error); diff --git a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterCustomerUserCredentialSample.ts b/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterCustomerUserCredentialSample.ts deleted file mode 100644 index c771174b0e63..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterCustomerUserCredentialSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Returns the cluster customer user credentials for the dedicated appliance. - * - * @summary Returns the cluster customer user credentials for the dedicated appliance. - * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json - */ -async function listClusterCustomerUserCredentialAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "testresourcegroup"; - const resourceName = "appliance01"; - const credential = new DefaultAzureCredential(); - const client = new ResourceConnectorManagementClient( - credential, - subscriptionId - ); - const result = await client.appliances.listClusterCustomerUserCredential( - resourceGroupName, - resourceName - ); - console.log(result); -} - -listClusterCustomerUserCredentialAppliance().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 78fa54a658df..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterUserCredentialSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json - */ -async function listClusterUserCredentialAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -listClusterUserCredentialAppliance().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 d79569f7af3c..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListOperationsSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesListOperations.json - */ -async function listAppliancesOperations() { - const subscriptionId = "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); -} - -listAppliancesOperations().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 6b92ca31d667..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesUpdateSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AppliancesUpdateOptionalParams, - ResourceConnectorManagementClient -} from "@azure/arm-resourceconnector"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * 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/preview/2022-04-15-preview/examples/AppliancesPatch.json - */ -async function updateAppliance() { - const subscriptionId = "11111111-2222-3333-4444-555555555555"; - const resourceGroupName = "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); -} - -updateAppliance().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 416c2dd82e00..000000000000 --- a/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2018", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts b/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts index 8ab7e6ae1a09..674063d88cb1 100644 --- a/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts +++ b/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts @@ -56,6 +56,9 @@ export class ResourceConnectorManagementClient extends coreClient.ServiceClient ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } const optionsWithDefaults = { ...defaults, ...options, 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"