From f1294ddaa90b43767f92adc4eb4f0a7cc921c51b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 9 Nov 2022 06:33:31 +0000 Subject: [PATCH] CodeGen from PR 20681 in Azure/azure-rest-api-specs Adding resourceconnector - Appliance GA API version (#20681) * Adding resourceconnector - appliance GA API verson * Update swagger PR to add ArtifactURL and Another SSHKey type - ScopesAccessKey * Commiting previous API Version 2022-04-15-preview * Commiting latest API Version 2022-10-27 * Update to v3 types: * Adding words to custom-words.txt * run prettier check * Use v3 for appliance resource type too * resolve merge conflicts in custom words.txt * add in readmes * Add blockchain to latest profile * Add additional types * track2 modify eventhub readme.go.md (#15338) * track2 modify operationalinsights readme.go.md (#15354) * track2 modify security readme.go.md (#15357) * track2 modify eventgrid readme.go.md (#15358) * [Hub Generated] Public private branch 'dev-azure-kusto-Microsoft.Kusto-2021-08-27' (#15905) * Adds base for updating Microsoft.Kusto from version stable/2021-01-01 to version 2021-08-27 * Updates readme * Updates API version in new specs and examples * Swagger changes * it1 * hh * it2 * it3 * it5 * it6 * it7 * readme * it10 * it11 * it11 * it 12 * it 13 * prettier * python * allowedIpRangeList - remove default * bassel changes * checkNameAvailability * fix lint * checkName * fix * managedPrivate check name * prettier * Update readme.python.md * add attached enum * Dor comments * fix description * readOnly Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * update the format to int64 for creationtimestamp and expirationtimestamp * Updating Delete example to include location header for 202 response * fix header in delete example Co-authored-by: Mark Cowlishaw Co-authored-by: JiahuiPeng <46921893+804873052@users.noreply.github.com> Co-authored-by: hila levi <88654259+hilalevi170@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Aditi Malladi --- common/config/rush/pnpm-lock.yaml | 4 +- .../arm-resourceconnector/CHANGELOG.md | 14 +- .../arm-resourceconnector/README.md | 2 +- .../arm-resourceconnector/_meta.json | 8 +- .../arm-resourceconnector/package.json | 16 +- .../node/my_test/recording_sample_test.json | 4 - .../review/arm-resourceconnector.api.md | 72 ++++-- .../appliancesCreateOrUpdateSample.ts | 45 ---- .../samples-dev/appliancesDeleteSample.ts | 36 --- .../samples-dev/appliancesGetSample.ts | 33 --- .../appliancesGetUpgradeGraphSample.ts | 38 ---- .../appliancesListByResourceGroupSample.ts | 37 --- .../appliancesListBySubscriptionSample.ts | 34 --- ...ListClusterCustomerUserCredentialSample.ts | 36 --- ...pliancesListClusterUserCredentialSample.ts | 36 --- .../appliancesListOperationsSample.ts | 34 --- .../samples-dev/appliancesUpdateSample.ts | 42 ---- .../samples/v1-beta/javascript/README.md | 68 ------ .../appliancesCreateOrUpdateSample.js | 39 ---- .../javascript/appliancesDeleteSample.js | 30 --- .../v1-beta/javascript/appliancesGetSample.js | 30 --- .../appliancesGetUpgradeGraphSample.js | 35 --- .../appliancesListByResourceGroupSample.js | 32 --- .../appliancesListBySubscriptionSample.js | 31 --- ...ListClusterCustomerUserCredentialSample.js | 33 --- ...pliancesListClusterUserCredentialSample.js | 30 --- .../appliancesListOperationsSample.js | 31 --- .../javascript/appliancesUpdateSample.js | 32 --- .../samples/v1-beta/javascript/package.json | 32 --- .../samples/v1-beta/javascript/sample.env | 4 - .../samples/v1-beta/typescript/README.md | 81 ------- .../samples/v1-beta/typescript/package.json | 41 ---- .../samples/v1-beta/typescript/sample.env | 4 - .../src/appliancesCreateOrUpdateSample.ts | 45 ---- .../typescript/src/appliancesDeleteSample.ts | 36 --- .../typescript/src/appliancesGetSample.ts | 33 --- .../src/appliancesGetUpgradeGraphSample.ts | 38 ---- .../appliancesListByResourceGroupSample.ts | 37 --- .../src/appliancesListBySubscriptionSample.ts | 34 --- ...ListClusterCustomerUserCredentialSample.ts | 36 --- ...pliancesListClusterUserCredentialSample.ts | 36 --- .../src/appliancesListOperationsSample.ts | 34 --- .../typescript/src/appliancesUpdateSample.ts | 42 ---- .../samples/v1-beta/typescript/tsconfig.json | 17 -- .../arm-resourceconnector/src/models/index.ts | 210 +++++++++++++----- .../src/models/mappers.ts | 191 ++++++++++------ .../src/models/parameters.ts | 2 +- .../src/operations/appliances.ts | 68 ++++-- .../src/operationsInterfaces/appliances.ts | 29 ++- .../src/resourceConnectorManagementClient.ts | 44 ++-- .../arm-resourceconnector/tsconfig.json | 10 +- 51 files changed, 453 insertions(+), 1533 deletions(-) delete mode 100644 sdk/resourceconnector/arm-resourceconnector/recordings/node/my_test/recording_sample_test.json delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesCreateOrUpdateSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesDeleteSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesGetUpgradeGraphSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListByResourceGroupSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListBySubscriptionSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListClusterCustomerUserCredentialSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListClusterUserCredentialSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesListOperationsSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples-dev/appliancesUpdateSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/README.md delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesCreateOrUpdateSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesDeleteSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetUpgradeGraphSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListByResourceGroupSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListBySubscriptionSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterCustomerUserCredentialSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterUserCredentialSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListOperationsSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesUpdateSample.js delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/package.json delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/sample.env delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/README.md delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/package.json delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/sample.env delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesCreateOrUpdateSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesDeleteSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetUpgradeGraphSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListByResourceGroupSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListBySubscriptionSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterCustomerUserCredentialSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterUserCredentialSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListOperationsSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesUpdateSample.ts delete mode 100644 sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index c14e15dfd3bf..cb6113f47ddd 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -14122,7 +14122,7 @@ packages: dev: false file:projects/arm-resourceconnector.tgz: - resolution: {integrity: sha512-z8Lyx1xdSk6nnnbXKSUadhp6tbY4jKso3vHjvvHbQcb5nI1Tt+tM2bBM22LvIAKG/Y8eNqtp66Yvymwd29vs2w==, tarball: file:projects/arm-resourceconnector.tgz} + resolution: {integrity: sha512-sypdA+uVOMIU2x1OPRF6Zl3wRIrHFUeHgc7a686K09WozeXUwKVSgbuIUSyhIEnZ2+rLy4qmTksSsK6c7RJOPg==, tarball: file:projects/arm-resourceconnector.tgz} name: '@rush-temp/arm-resourceconnector' version: 0.0.0 dependencies: @@ -14141,7 +14141,7 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' diff --git a/sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md b/sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md index 17ec56523d12..2b869f3c1e0b 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.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.1 (2022-06-28) + +## 1.0.0 (2022-11-09) 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/README.md b/sdk/resourceconnector/arm-resourceconnector/README.md index 1b2077fda729..0a8d8a33a9c2 100644 --- a/sdk/resourceconnector/arm-resourceconnector/README.md +++ b/sdk/resourceconnector/arm-resourceconnector/README.md @@ -6,7 +6,7 @@ The appliances Rest API spec. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourceconnector/arm-resourceconnector) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourceconnector) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/resourceconnector/arm-resourceconnector/_meta.json b/sdk/resourceconnector/arm-resourceconnector/_meta.json index 7824cc98c15b..72b3837e238d 100644 --- a/sdk/resourceconnector/arm-resourceconnector/_meta.json +++ b/sdk/resourceconnector/arm-resourceconnector/_meta.json @@ -1,8 +1,8 @@ { - "commit": "b8fc2b4ff626aab886f929e49926c6e836548e01", + "commit": "7d6c14d986a67dca3451d7d92d8f6b9416d61fbf", "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.2", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.2", - "use": "@autorest/typescript@6.0.0-rc.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.1", + "use": "@autorest/typescript@6.0.0-rc.2" } \ No newline at end of file diff --git a/sdk/resourceconnector/arm-resourceconnector/package.json b/sdk/resourceconnector/arm-resourceconnector/package.json index 3d4203900a03..6d427dd13e7f 100644 --- a/sdk/resourceconnector/arm-resourceconnector/package.json +++ b/sdk/resourceconnector/arm-resourceconnector/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ResourceConnectorManagementClient.", - "version": "1.0.0-beta.2", + "version": "1.0.0", "engines": { "node": ">=14.0.0" }, @@ -36,7 +36,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.6.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -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/review/arm-resourceconnector.api.md b/sdk/resourceconnector/arm-resourceconnector/review/arm-resourceconnector.api.md index e85310991509..a2e3c4e14941 100644 --- a/sdk/resourceconnector/arm-resourceconnector/review/arm-resourceconnector.api.md +++ b/sdk/resourceconnector/arm-resourceconnector/review/arm-resourceconnector.api.md @@ -21,7 +21,6 @@ export interface Appliance extends TrackedResource { readonly provisioningState?: string; publicKey?: string; readonly status?: Status; - readonly systemData?: SystemData; version?: string; } @@ -32,11 +31,8 @@ export interface ApplianceCredentialKubeconfig { } // @public -export interface ApplianceListClusterCustomerUserCredentialResults { - readonly kubeconfigs?: ApplianceCredentialKubeconfig[]; - readonly sshKeys?: { - [propertyName: string]: SSHKey; - }; +export interface ApplianceGetTelemetryConfigResult { + readonly telemetryInstrumentationKey?: string; } // @public @@ -45,6 +41,17 @@ export interface ApplianceListCredentialResults { readonly kubeconfigs?: ApplianceCredentialKubeconfig[]; } +// @public +export interface ApplianceListKeysResults { + readonly artifactProfiles?: { + [propertyName: string]: ArtifactProfile; + }; + readonly kubeconfigs?: ApplianceCredentialKubeconfig[]; + readonly sshKeys?: { + [propertyName: string]: SSHKey; + }; +} + // @public export interface ApplianceListResult { readonly nextLink?: string; @@ -80,11 +87,12 @@ export interface Appliances { beginDelete(resourceGroupName: string, resourceName: string, options?: AppliancesDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: AppliancesDeleteOptionalParams): Promise; get(resourceGroupName: string, resourceName: string, options?: AppliancesGetOptionalParams): Promise; + getTelemetryConfig(options?: AppliancesGetTelemetryConfigOptionalParams): Promise; getUpgradeGraph(resourceGroupName: string, resourceName: string, upgradeGraph: string, options?: AppliancesGetUpgradeGraphOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: AppliancesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: AppliancesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - listClusterCustomerUserCredential(resourceGroupName: string, resourceName: string, options?: AppliancesListClusterCustomerUserCredentialOptionalParams): Promise; listClusterUserCredential(resourceGroupName: string, resourceName: string, options?: AppliancesListClusterUserCredentialOptionalParams): Promise; + listKeys(resourceGroupName: string, resourceName: string, options?: AppliancesListKeysOptionalParams): Promise; listOperations(options?: AppliancesListOperationsOptionalParams): PagedAsyncIterableIterator; update(resourceGroupName: string, resourceName: string, options?: AppliancesUpdateOptionalParams): Promise; } @@ -111,6 +119,13 @@ export interface AppliancesGetOptionalParams extends coreClient.OperationOptions // @public export type AppliancesGetResponse = Appliance; +// @public +export interface AppliancesGetTelemetryConfigOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AppliancesGetTelemetryConfigResponse = ApplianceGetTelemetryConfigResult; + // @public export interface AppliancesGetUpgradeGraphOptionalParams extends coreClient.OperationOptions { } @@ -147,18 +162,18 @@ export interface AppliancesListBySubscriptionOptionalParams extends coreClient.O export type AppliancesListBySubscriptionResponse = ApplianceListResult; // @public -export interface AppliancesListClusterCustomerUserCredentialOptionalParams extends coreClient.OperationOptions { +export interface AppliancesListClusterUserCredentialOptionalParams extends coreClient.OperationOptions { } // @public -export type AppliancesListClusterCustomerUserCredentialResponse = ApplianceListClusterCustomerUserCredentialResults; +export type AppliancesListClusterUserCredentialResponse = ApplianceListCredentialResults; // @public -export interface AppliancesListClusterUserCredentialOptionalParams extends coreClient.OperationOptions { +export interface AppliancesListKeysOptionalParams extends coreClient.OperationOptions { } // @public -export type AppliancesListClusterUserCredentialResponse = ApplianceListCredentialResults; +export type AppliancesListKeysResponse = ApplianceListKeysResults; // @public export interface AppliancesListOperationsNextOptionalParams extends coreClient.OperationOptions { @@ -184,6 +199,14 @@ export interface AppliancesUpdateOptionalParams extends coreClient.OperationOpti // @public export type AppliancesUpdateResponse = Appliance; +// @public +export interface ArtifactProfile { + readonly endpoint?: string; +} + +// @public +export type ArtifactType = string; + // @public export type CreatedByType = string; @@ -231,6 +254,11 @@ export enum KnownAccessProfileType { ClusterUser = "clusterUser" } +// @public +export enum KnownArtifactType { + LogsArtifactType = "LogsArtifactType" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -261,6 +289,9 @@ export enum KnownResourceIdentityType { // @public export enum KnownSSHKeyType { + LogsKey = "LogsKey", + ManagementCAKey = "ManagementCAKey", + ScopedAccessKey = "ScopedAccessKey", SSHCustomerUser = "SSHCustomerUser" } @@ -268,6 +299,13 @@ export enum KnownSSHKeyType { export enum KnownStatus { Connected = "Connected", Connecting = "Connecting", + ImageDeprovisioning = "ImageDeprovisioning", + ImageDownloaded = "ImageDownloaded", + ImageDownloading = "ImageDownloading", + ImagePending = "ImagePending", + ImageProvisioned = "ImageProvisioned", + ImageProvisioning = "ImageProvisioning", + ImageUnknown = "ImageUnknown", None = "None", Offline = "Offline", PostUpgrade = "PostUpgrade", @@ -281,9 +319,11 @@ export enum KnownStatus { UpgradeComplete = "UpgradeComplete", UpgradeFailed = "UpgradeFailed", UpgradePrerequisitesCompleted = "UpgradePrerequisitesCompleted", + UpgradingKvaio = "UpgradingKVAIO", Validating = "Validating", WaitingForCloudOperator = "WaitingForCloudOperator", - WaitingForHeartbeat = "WaitingForHeartbeat" + WaitingForHeartbeat = "WaitingForHeartbeat", + WaitingForKvaio = "WaitingForKVAIO" } // @public @@ -300,6 +340,7 @@ export type Provider = string; export interface Resource { readonly id?: string; readonly name?: string; + readonly systemData?: SystemData; readonly type?: string; } @@ -328,8 +369,11 @@ export type ResourceIdentityType = string; // @public export interface SSHKey { - privateKey?: string; - publicKey?: string; + readonly certificate?: string; + readonly creationTimeStamp?: number; + readonly expirationTimeStamp?: number; + readonly privateKey?: string; + readonly publicKey?: 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 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 1993e466a0d0..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://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 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 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 3d185539f836..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://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 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 80d986bb986c..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": "~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/models/index.ts b/sdk/resourceconnector/arm-resourceconnector/src/models/index.ts index bbe33677d50a..2e89be634b67 100644 --- a/sdk/resourceconnector/arm-resourceconnector/src/models/index.ts +++ b/sdk/resourceconnector/arm-resourceconnector/src/models/index.ts @@ -140,6 +140,30 @@ export interface AppliancePropertiesInfrastructureConfig { provider?: Provider; } +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + /** Metadata pertaining to creation and last modification of the resource. */ export interface SystemData { /** The identity that created the resource. */ @@ -156,23 +180,13 @@ export interface SystemData { lastModifiedAt?: Date; } -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; +/** The Get Telemetry Config Result appliance. */ +export interface ApplianceGetTelemetryConfigResult { /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * Telemetry instrumentation key. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly telemetryInstrumentationKey?: string; } /** The Appliances patchable resource definition. */ @@ -181,18 +195,42 @@ export interface PatchableAppliance { tags?: { [propertyName: string]: string }; } -/** The List Cluster Customer User Credential Results appliance. */ -export interface ApplianceListClusterCustomerUserCredentialResults { +/** The List Cluster User Credential appliance. */ +export interface ApplianceListCredentialResults { + /** + * Contains the REP (rendezvous endpoint) and “Listener” access token from notification service (NS). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hybridConnectionConfig?: HybridConnectionConfig; /** * The list of appliance kubeconfigs. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly kubeconfigs?: ApplianceCredentialKubeconfig[]; +} + +/** Contains the REP (rendezvous endpoint) and “Listener” access token from notification service (NS). */ +export interface HybridConnectionConfig { /** - * Map of Customer User Public and Private SSH Keys + * Timestamp when this token will be expired. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sshKeys?: { [propertyName: string]: SSHKey }; + readonly expirationTime?: number; + /** + * Name of the connection + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly hybridConnectionName?: string; + /** + * Name of the notification service. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly relay?: string; + /** + * Listener access token + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly token?: string; } /** Cluster User Credential appliance. */ @@ -209,50 +247,61 @@ export interface ApplianceCredentialKubeconfig { readonly value?: string; } -/** Appliance SSHKey definition. */ -export interface SSHKey { - /** User Private Key. */ - privateKey?: string; - /** User Public Key. */ - publicKey?: string; -} - -/** The List Cluster User Credential appliance. */ -export interface ApplianceListCredentialResults { +/** The List Cluster Keys Results appliance. */ +export interface ApplianceListKeysResults { /** - * Contains the REP (rendezvous endpoint) and “Listener” access token from notification service (NS). + * Map of artifacts that contains a list of ArtifactProfile used to upload artifacts such as logs. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly hybridConnectionConfig?: HybridConnectionConfig; + readonly artifactProfiles?: { [propertyName: string]: ArtifactProfile }; /** * The list of appliance kubeconfigs. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly kubeconfigs?: ApplianceCredentialKubeconfig[]; + /** + * Map of Customer User Public, Private SSH Keys and Certificate when available. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sshKeys?: { [propertyName: string]: SSHKey }; } -/** Contains the REP (rendezvous endpoint) and “Listener” access token from notification service (NS). */ -export interface HybridConnectionConfig { +/** Appliance ArtifactProfile definition. */ +export interface ArtifactProfile { /** - * Timestamp when this token will be expired. + * Endpoint is the URL to upload artifacts to. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly expirationTime?: number; + readonly endpoint?: string; +} + +/** Appliance SSHKey definition. */ +export interface SSHKey { /** - * Name of the connection + * Certificate associated with the public key if the key is signed. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly hybridConnectionName?: string; + readonly certificate?: string; /** - * Name of the notification service. + * Certificate creation timestamp (Unix). * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly relay?: string; + readonly creationTimeStamp?: number; /** - * Listener access token + * Certificate expiration timestamp (Unix). * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly token?: string; + readonly expirationTimeStamp?: number; + /** + * Private Key. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateKey?: string; + /** + * Public Key. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publicKey?: string; } /** The Upgrade Graph for appliance. */ @@ -363,11 +412,6 @@ export interface TrackedResource extends Resource { export interface Appliance extends TrackedResource { /** Identity for the resource. */ identity?: Identity; - /** - * Metadata pertaining to creation and last modification of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; /** Represents a supported Fabric/Infra. (AKSEdge etc...). */ distro?: Distro; /** Contains infrastructure information about the Appliance */ @@ -377,7 +421,7 @@ export interface Appliance extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; - /** Certificates pair used to download MSI certificate from HIS */ + /** Certificates pair used to download MSI certificate from HIS. Can only be set once. */ publicKey?: string; /** * Appliance’s health and state of connection to on-prem @@ -466,6 +510,24 @@ export enum KnownStatus { UpgradePrerequisitesCompleted = "UpgradePrerequisitesCompleted", /** PreUpgrade */ PreUpgrade = "PreUpgrade", + /** UpgradingKvaio */ + UpgradingKvaio = "UpgradingKVAIO", + /** WaitingForKvaio */ + WaitingForKvaio = "WaitingForKVAIO", + /** ImagePending */ + ImagePending = "ImagePending", + /** ImageProvisioning */ + ImageProvisioning = "ImageProvisioning", + /** ImageProvisioned */ + ImageProvisioned = "ImageProvisioned", + /** ImageDownloading */ + ImageDownloading = "ImageDownloading", + /** ImageDownloaded */ + ImageDownloaded = "ImageDownloaded", + /** ImageDeprovisioning */ + ImageDeprovisioning = "ImageDeprovisioning", + /** ImageUnknown */ + ImageUnknown = "ImageUnknown", /** UpdatingCloudOperator */ UpdatingCloudOperator = "UpdatingCloudOperator", /** WaitingForCloudOperator */ @@ -501,6 +563,15 @@ export enum KnownStatus { * **PreparingForUpgrade** \ * **UpgradePrerequisitesCompleted** \ * **PreUpgrade** \ + * **UpgradingKVAIO** \ + * **WaitingForKVAIO** \ + * **ImagePending** \ + * **ImageProvisioning** \ + * **ImageProvisioned** \ + * **ImageDownloading** \ + * **ImageDownloaded** \ + * **ImageDeprovisioning** \ + * **ImageUnknown** \ * **UpdatingCloudOperator** \ * **WaitingForCloudOperator** \ * **UpdatingCAPI** \ @@ -556,10 +627,31 @@ export enum KnownAccessProfileType { */ export type AccessProfileType = string; +/** Known values of {@link ArtifactType} that the service accepts. */ +export enum KnownArtifactType { + /** LogsArtifactType */ + LogsArtifactType = "LogsArtifactType" +} + +/** + * Defines values for ArtifactType. \ + * {@link KnownArtifactType} can be used interchangeably with ArtifactType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **LogsArtifactType** + */ +export type ArtifactType = string; + /** Known values of {@link SSHKeyType} that the service accepts. */ export enum KnownSSHKeyType { /** SSHCustomerUser */ - SSHCustomerUser = "SSHCustomerUser" + SSHCustomerUser = "SSHCustomerUser", + /** ManagementCAKey */ + ManagementCAKey = "ManagementCAKey", + /** LogsKey */ + LogsKey = "LogsKey", + /** ScopedAccessKey */ + ScopedAccessKey = "ScopedAccessKey" } /** @@ -567,7 +659,10 @@ export enum KnownSSHKeyType { * {@link KnownSSHKeyType} can be used interchangeably with SSHKeyType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **SSHCustomerUser** + * **SSHCustomerUser** \ + * **ManagementCAKey** \ + * **LogsKey** \ + * **ScopedAccessKey** */ export type SSHKeyType = string; @@ -585,6 +680,13 @@ export interface AppliancesListBySubscriptionOptionalParams /** Contains response data for the listBySubscription operation. */ export type AppliancesListBySubscriptionResponse = ApplianceListResult; +/** Optional parameters. */ +export interface AppliancesGetTelemetryConfigOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getTelemetryConfig operation. */ +export type AppliancesGetTelemetryConfigResponse = ApplianceGetTelemetryConfigResult; + /** Optional parameters. */ export interface AppliancesListByResourceGroupOptionalParams extends coreClient.OperationOptions {} @@ -631,18 +733,18 @@ export interface AppliancesUpdateOptionalParams export type AppliancesUpdateResponse = Appliance; /** Optional parameters. */ -export interface AppliancesListClusterCustomerUserCredentialOptionalParams +export interface AppliancesListClusterUserCredentialOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listClusterCustomerUserCredential operation. */ -export type AppliancesListClusterCustomerUserCredentialResponse = ApplianceListClusterCustomerUserCredentialResults; +/** Contains response data for the listClusterUserCredential operation. */ +export type AppliancesListClusterUserCredentialResponse = ApplianceListCredentialResults; /** Optional parameters. */ -export interface AppliancesListClusterUserCredentialOptionalParams +export interface AppliancesListKeysOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listClusterUserCredential operation. */ -export type AppliancesListClusterUserCredentialResponse = ApplianceListCredentialResults; +/** Contains response data for the listKeys operation. */ +export type AppliancesListKeysResponse = ApplianceListKeysResults; /** Optional parameters. */ export interface AppliancesGetUpgradeGraphOptionalParams diff --git a/sdk/resourceconnector/arm-resourceconnector/src/models/mappers.ts b/sdk/resourceconnector/arm-resourceconnector/src/models/mappers.ts index ea946336724e..070c703e3ae0 100644 --- a/sdk/resourceconnector/arm-resourceconnector/src/models/mappers.ts +++ b/sdk/resourceconnector/arm-resourceconnector/src/models/mappers.ts @@ -263,6 +263,43 @@ export const AppliancePropertiesInfrastructureConfig: coreClient.CompositeMapper } }; +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", @@ -308,27 +345,13 @@ export const SystemData: coreClient.CompositeMapper = { } }; -export const Resource: coreClient.CompositeMapper = { +export const ApplianceGetTelemetryConfigResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ApplianceGetTelemetryConfigResult", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", + telemetryInstrumentationKey: { + serializedName: "telemetryInstrumentationKey", readOnly: true, type: { name: "String" @@ -354,11 +377,18 @@ export const PatchableAppliance: coreClient.CompositeMapper = { } }; -export const ApplianceListClusterCustomerUserCredentialResults: coreClient.CompositeMapper = { +export const ApplianceListCredentialResults: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplianceListClusterCustomerUserCredentialResults", + className: "ApplianceListCredentialResults", modelProperties: { + hybridConnectionConfig: { + serializedName: "hybridConnectionConfig", + type: { + name: "Composite", + className: "HybridConnectionConfig" + } + }, kubeconfigs: { serializedName: "kubeconfigs", readOnly: true, @@ -371,33 +401,39 @@ export const ApplianceListClusterCustomerUserCredentialResults: coreClient.Compo } } } - }, - sshKeys: { - serializedName: "sshKeys", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "Composite", className: "SSHKey" } } - } } } } }; -export const ApplianceCredentialKubeconfig: coreClient.CompositeMapper = { +export const HybridConnectionConfig: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplianceCredentialKubeconfig", + className: "HybridConnectionConfig", modelProperties: { - name: { - serializedName: "name", + expirationTime: { + serializedName: "expirationTime", + readOnly: true, + type: { + name: "Number" + } + }, + hybridConnectionName: { + serializedName: "hybridConnectionName", readOnly: true, type: { name: "String" } }, - value: { - serializedName: "value", + relay: { + serializedName: "relay", + readOnly: true, + type: { + name: "String" + } + }, + token: { + serializedName: "token", readOnly: true, type: { name: "String" @@ -407,19 +443,21 @@ export const ApplianceCredentialKubeconfig: coreClient.CompositeMapper = { } }; -export const SSHKey: coreClient.CompositeMapper = { +export const ApplianceCredentialKubeconfig: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SSHKey", + className: "ApplianceCredentialKubeconfig", modelProperties: { - privateKey: { - serializedName: "privateKey", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - publicKey: { - serializedName: "publicKey", + value: { + serializedName: "value", + readOnly: true, type: { name: "String" } @@ -428,16 +466,17 @@ export const SSHKey: coreClient.CompositeMapper = { } }; -export const ApplianceListCredentialResults: coreClient.CompositeMapper = { +export const ApplianceListKeysResults: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ApplianceListCredentialResults", + className: "ApplianceListKeysResults", modelProperties: { - hybridConnectionConfig: { - serializedName: "hybridConnectionConfig", + artifactProfiles: { + serializedName: "artifactProfiles", + readOnly: true, type: { - name: "Composite", - className: "HybridConnectionConfig" + name: "Dictionary", + value: { type: { name: "Composite", className: "ArtifactProfile" } } } }, kubeconfigs: { @@ -452,39 +491,70 @@ export const ApplianceListCredentialResults: coreClient.CompositeMapper = { } } } + }, + sshKeys: { + serializedName: "sshKeys", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "SSHKey" } } + } } } } }; -export const HybridConnectionConfig: coreClient.CompositeMapper = { +export const ArtifactProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "HybridConnectionConfig", + className: "ArtifactProfile", modelProperties: { - expirationTime: { - serializedName: "expirationTime", + endpoint: { + serializedName: "endpoint", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SSHKey: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SSHKey", + modelProperties: { + certificate: { + serializedName: "certificate", + readOnly: true, + type: { + name: "String" + } + }, + creationTimeStamp: { + serializedName: "creationTimeStamp", readOnly: true, type: { name: "Number" } }, - hybridConnectionName: { - serializedName: "hybridConnectionName", + expirationTimeStamp: { + serializedName: "expirationTimeStamp", readOnly: true, type: { - name: "String" + name: "Number" } }, - relay: { - serializedName: "relay", + privateKey: { + serializedName: "privateKey", readOnly: true, type: { name: "String" } }, - token: { - serializedName: "token", + publicKey: { + serializedName: "publicKey", readOnly: true, type: { name: "String" @@ -696,13 +766,6 @@ export const Appliance: coreClient.CompositeMapper = { className: "Identity" } }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - }, distro: { defaultValue: "AKSEdge", serializedName: "properties.distro", diff --git a/sdk/resourceconnector/arm-resourceconnector/src/models/parameters.ts b/sdk/resourceconnector/arm-resourceconnector/src/models/parameters.ts index 492603e90df5..6f6c9287f8c7 100644 --- a/sdk/resourceconnector/arm-resourceconnector/src/models/parameters.ts +++ b/sdk/resourceconnector/arm-resourceconnector/src/models/parameters.ts @@ -43,7 +43,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-04-15-preview", + defaultValue: "2022-10-27", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/resourceconnector/arm-resourceconnector/src/operations/appliances.ts b/sdk/resourceconnector/arm-resourceconnector/src/operations/appliances.ts index ec64b115b3e4..2a99ee1a8dc9 100644 --- a/sdk/resourceconnector/arm-resourceconnector/src/operations/appliances.ts +++ b/sdk/resourceconnector/arm-resourceconnector/src/operations/appliances.ts @@ -25,6 +25,8 @@ import { AppliancesListByResourceGroupOptionalParams, AppliancesListOperationsResponse, AppliancesListBySubscriptionResponse, + AppliancesGetTelemetryConfigOptionalParams, + AppliancesGetTelemetryConfigResponse, AppliancesListByResourceGroupResponse, AppliancesGetOptionalParams, AppliancesGetResponse, @@ -33,10 +35,10 @@ import { AppliancesDeleteOptionalParams, AppliancesUpdateOptionalParams, AppliancesUpdateResponse, - AppliancesListClusterCustomerUserCredentialOptionalParams, - AppliancesListClusterCustomerUserCredentialResponse, AppliancesListClusterUserCredentialOptionalParams, AppliancesListClusterUserCredentialResponse, + AppliancesListKeysOptionalParams, + AppliancesListKeysResponse, AppliancesGetUpgradeGraphOptionalParams, AppliancesGetUpgradeGraphResponse, AppliancesListOperationsNextResponse, @@ -223,6 +225,19 @@ export class AppliancesImpl implements Appliances { ); } + /** + * Gets the telemetry config. + * @param options The options parameters. + */ + getTelemetryConfig( + options?: AppliancesGetTelemetryConfigOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + getTelemetryConfigOperationSpec + ); + } + /** * Gets a list of Appliances in the specified subscription and resource group. The operation returns * properties of each Appliance. @@ -451,36 +466,36 @@ export class AppliancesImpl implements Appliances { } /** - * Returns the cluster customer user credentials for the dedicated appliance. + * Returns the cluster user credentials for the dedicated appliance. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName Appliances name. * @param options The options parameters. */ - listClusterCustomerUserCredential( + listClusterUserCredential( resourceGroupName: string, resourceName: string, - options?: AppliancesListClusterCustomerUserCredentialOptionalParams - ): Promise { + options?: AppliancesListClusterUserCredentialOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, options }, - listClusterCustomerUserCredentialOperationSpec + listClusterUserCredentialOperationSpec ); } /** - * Returns the cluster user credentials for the dedicated appliance. + * Returns the cluster customer credentials for the dedicated appliance. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName Appliances name. * @param options The options parameters. */ - listClusterUserCredential( + listKeys( resourceGroupName: string, resourceName: string, - options?: AppliancesListClusterUserCredentialOptionalParams - ): Promise { + options?: AppliancesListKeysOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, options }, - listClusterUserCredentialOperationSpec + listKeysOperationSpec ); } @@ -587,6 +602,23 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const getTelemetryConfigOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceConnector/telemetryconfig", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApplianceGetTelemetryConfigResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances", @@ -713,13 +745,13 @@ const updateOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; -const listClusterCustomerUserCredentialOperationSpec: coreClient.OperationSpec = { +const listClusterUserCredentialOperationSpec: coreClient.OperationSpec = { path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}/listClusterCustomerUserCredential", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}/listClusterUserCredential", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ApplianceListClusterCustomerUserCredentialResults + bodyMapper: Mappers.ApplianceListCredentialResults }, default: { bodyMapper: Mappers.ErrorResponse @@ -735,13 +767,13 @@ const listClusterCustomerUserCredentialOperationSpec: coreClient.OperationSpec = headerParameters: [Parameters.accept], serializer }; -const listClusterUserCredentialOperationSpec: coreClient.OperationSpec = { +const listKeysOperationSpec: coreClient.OperationSpec = { path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}/listClusterUserCredential", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}/listkeys", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.ApplianceListCredentialResults + bodyMapper: Mappers.ApplianceListKeysResults }, default: { bodyMapper: Mappers.ErrorResponse diff --git a/sdk/resourceconnector/arm-resourceconnector/src/operationsInterfaces/appliances.ts b/sdk/resourceconnector/arm-resourceconnector/src/operationsInterfaces/appliances.ts index 30b93c2f76ed..e47f3ec6fa30 100644 --- a/sdk/resourceconnector/arm-resourceconnector/src/operationsInterfaces/appliances.ts +++ b/sdk/resourceconnector/arm-resourceconnector/src/operationsInterfaces/appliances.ts @@ -14,6 +14,8 @@ import { Appliance, AppliancesListBySubscriptionOptionalParams, AppliancesListByResourceGroupOptionalParams, + AppliancesGetTelemetryConfigOptionalParams, + AppliancesGetTelemetryConfigResponse, AppliancesGetOptionalParams, AppliancesGetResponse, AppliancesCreateOrUpdateOptionalParams, @@ -21,10 +23,10 @@ import { AppliancesDeleteOptionalParams, AppliancesUpdateOptionalParams, AppliancesUpdateResponse, - AppliancesListClusterCustomerUserCredentialOptionalParams, - AppliancesListClusterCustomerUserCredentialResponse, AppliancesListClusterUserCredentialOptionalParams, AppliancesListClusterUserCredentialResponse, + AppliancesListKeysOptionalParams, + AppliancesListKeysResponse, AppliancesGetUpgradeGraphOptionalParams, AppliancesGetUpgradeGraphResponse } from "../models"; @@ -57,6 +59,13 @@ export interface Appliances { resourceGroupName: string, options?: AppliancesListByResourceGroupOptionalParams ): PagedAsyncIterableIterator; + /** + * Gets the telemetry config. + * @param options The options parameters. + */ + getTelemetryConfig( + options?: AppliancesGetTelemetryConfigOptionalParams + ): Promise; /** * Gets the details of an Appliance with a specified resource group and name. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -134,27 +143,27 @@ export interface Appliances { options?: AppliancesUpdateOptionalParams ): Promise; /** - * Returns the cluster customer user credentials for the dedicated appliance. + * Returns the cluster user credentials for the dedicated appliance. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName Appliances name. * @param options The options parameters. */ - listClusterCustomerUserCredential( + listClusterUserCredential( resourceGroupName: string, resourceName: string, - options?: AppliancesListClusterCustomerUserCredentialOptionalParams - ): Promise; + options?: AppliancesListClusterUserCredentialOptionalParams + ): Promise; /** - * Returns the cluster user credentials for the dedicated appliance. + * Returns the cluster customer credentials for the dedicated appliance. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName Appliances name. * @param options The options parameters. */ - listClusterUserCredential( + listKeys( resourceGroupName: string, resourceName: string, - options?: AppliancesListClusterUserCredentialOptionalParams - ): Promise; + options?: AppliancesListKeysOptionalParams + ): Promise; /** * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release * train. diff --git a/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts b/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts index 8ab7e6ae1a09..76e1ca9639ee 100644 --- a/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts +++ b/sdk/resourceconnector/arm-resourceconnector/src/resourceConnectorManagementClient.ts @@ -50,12 +50,15 @@ export class ResourceConnectorManagementClient extends coreClient.ServiceClient credential: credentials }; - const packageDetails = `azsdk-js-arm-resourceconnector/1.0.0-beta.2`; + const packageDetails = `azsdk-js-arm-resourceconnector/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } const optionsWithDefaults = { ...defaults, ...options, @@ -67,34 +70,41 @@ export class ResourceConnectorManagementClient extends coreClient.ServiceClient }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: `${optionsWithDefaults.credentialScopes}`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-04-15-preview"; + this.apiVersion = options.apiVersion || "2022-10-27"; this.appliances = new AppliancesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } 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"