From b3add1b7e17419aab2ac8326676e81ede2c189a8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 28 Apr 2022 15:59:36 +0000 Subject: [PATCH] CodeGen from PR 18851 in Azure/azure-rest-api-specs Merge 3348793f2d2b8aa750001e5db3f8e57a2d25eeb0 into bfc629362a914f63133ec7ecdbe3c1bdd539512f --- common/config/rush/pnpm-lock.yaml | 28 +- .../arm-azurestackhci/CHANGELOG.md | 54 +++- sdk/azurestackhci/arm-azurestackhci/README.md | 13 +- .../arm-azurestackhci/_meta.json | 7 +- .../arm-azurestackhci/package.json | 36 +-- .../review/arm-azurestackhci.api.md | 112 ++++++- .../arm-azurestackhci/rollup.config.js | 78 ++++- .../src/azureStackHCIClient.ts | 4 +- .../arm-azurestackhci/src/models/index.ts | 110 ++++++- .../arm-azurestackhci/src/models/mappers.ts | 200 ++++++++++++ .../src/models/parameters.ts | 8 +- .../src/operations/arcSettings.ts | 217 +++++++++++++ .../src/operations/clusters.ts | 305 +++++++++++++++++- .../src/operationsInterfaces/arcSettings.ts | 67 +++- .../src/operationsInterfaces/clusters.ts | 73 ++++- .../arm-azurestackhci/tsconfig.json | 10 +- 16 files changed, 1232 insertions(+), 90 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3107e87cfcba..e23271687428 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9675,28 +9675,27 @@ packages: dev: false file:projects/arm-azurestackhci.tgz: - resolution: {integrity: sha512-TSGx37M5FrBpj32P3H7R10RnDRxB3VJFh63z5bTQDfeYWriQuuShK9KMuXf73PZGv8KVWBnt49cwNVwyhf/3mA==, tarball: file:projects/arm-azurestackhci.tgz} + resolution: {integrity: sha512-Qz46HMD7+A8Oyfgh/RBD1hZbQHOKG1Xb+kgNnRWkvM8EJC8bpy9aDikQPIJcb6o897FKe81hwKxBdWXYNXAY1w==, tarball: file:projects/arm-azurestackhci.tgz} name: '@rush-temp/arm-azurestackhci' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -10151,7 +10150,7 @@ packages: dev: false file:projects/arm-containerservice.tgz: - resolution: {integrity: sha512-MM6SBcyllKbFydeqZTykiHih27ja4Ioj7mavWtZ4NVj7nK88flo7uelRlLlu+uUpJ3ZQLpPARq+VQ3dulZKaMA==, tarball: file:projects/arm-containerservice.tgz} + resolution: {integrity: sha512-ydzxfNP0RKW/IMAJIOMPMAr38GWiOKPriHKATazJlcETiAn2mfHAXrPj/5YZTe7/Cvh4anicieTseoA2LUf7Nw==, tarball: file:projects/arm-containerservice.tgz} name: '@rush-temp/arm-containerservice' version: 0.0.0 dependencies: @@ -10571,13 +10570,13 @@ packages: dev: false file:projects/arm-deviceprovisioningservices.tgz: - resolution: {integrity: sha512-XDNuzgCr0FhdYtH89+GO1jX6nVV+XYLK+xEBUHTEEEGqleGxEOyrMQ1UOH/GCew95p2H7uEthsGm35KXlDB4Pg==, tarball: file:projects/arm-deviceprovisioningservices.tgz} + resolution: {integrity: sha512-b/2nLVG1BCHXMdqczl4C8sgqTEtn1zSsyxPEDS9G8aBEO8mfAtqzoTfoujkHDqBC/D5G+h0rIMs0k7otXq0smw==, tarball: file:projects/arm-deviceprovisioningservices.tgz} name: '@rush-temp/arm-deviceprovisioningservices' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 + '@microsoft/api-extractor': 7.22.1 '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 '@rollup/plugin-json': 4.1.0_rollup@2.70.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 @@ -12954,13 +12953,13 @@ packages: dev: false file:projects/arm-scvmm.tgz: - resolution: {integrity: sha512-UxsXUDg/IyZjymFE+00igvcHk68ldF8qbSaQDTq9XQcgCJv2fhD87zXQ+oFmKKISLs0B+Bnkb94w8WkUhyQiyw==, tarball: file:projects/arm-scvmm.tgz} + resolution: {integrity: sha512-euabf0ZQdg1xTwrymKa0uVVt3G4fF57azoFRGeKelxTmAFWtJKRxtwLHFQXO0M7mw9lXa64fvP7UoktVwmHwMQ==, tarball: file:projects/arm-scvmm.tgz} name: '@rush-temp/arm-scvmm' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 + '@microsoft/api-extractor': 7.22.1 '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 '@rollup/plugin-json': 4.1.0_rollup@2.70.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 @@ -12977,6 +12976,7 @@ packages: transitivePeerDependencies: - '@types/node' - debug + - encoding - supports-color dev: false diff --git a/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md index 573f4aaf034b..48ba54bf52d2 100644 --- a/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md @@ -1,15 +1,49 @@ # Release History + +## 3.0.0 (2022-04-28) + +**Features** -## 2.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation ArcSettings.beginCreateIdentity + - Added operation ArcSettings.beginCreateIdentityAndWait + - Added operation ArcSettings.generatePassword + - Added operation ArcSettings.update + - Added operation Clusters.beginCreateIdentity + - Added operation Clusters.beginCreateIdentityAndWait + - Added operation Clusters.beginDelete + - Added operation Clusters.beginDeleteAndWait + - Added operation Clusters.beginUploadCertificate + - Added operation Clusters.beginUploadCertificateAndWait + - Added Interface ArcConnectivityProperties + - Added Interface ArcIdentityResponse + - Added Interface ArcSettingsCreateIdentityOptionalParams + - Added Interface ArcSettingsGeneratePasswordOptionalParams + - Added Interface ArcSettingsUpdateOptionalParams + - Added Interface ClusterIdentityResponse + - Added Interface ClustersCreateIdentityOptionalParams + - Added Interface ClustersUploadCertificateOptionalParams + - Added Interface PasswordCredential + - Added Interface RawCertificateData + - Added Interface UploadCertificateRequest + - Added Type Alias ArcSettingsCreateIdentityResponse + - Added Type Alias ArcSettingsGeneratePasswordResponse + - Added Type Alias ArcSettingsUpdateResponse + - Added Type Alias ClustersCreateIdentityResponse + - Interface ClustersDeleteOptionalParams has a new optional parameter resumeFrom + - Interface ClustersDeleteOptionalParams has a new optional parameter updateIntervalInMs + - Type Alias ArcSetting has a new parameter arcApplicationClientId + - Type Alias ArcSetting has a new parameter arcApplicationTenantId + - Type Alias ArcSetting has a new parameter arcServicePrincipalObjectId + - Type Alias ArcSetting has a new parameter arcApplicationObjectId + - Type Alias ArcSetting has a new parameter connectivityProperties + - Type Alias Cluster has a new parameter aadApplicationObjectId + - Type Alias Cluster has a new parameter aadServicePrincipalObjectId + - Type Alias Cluster has a new parameter serviceEndpoint + +**Breaking Changes** + + - Removed operation Clusters.delete + ## 2.1.0 (2022-02-28) **Features** diff --git a/sdk/azurestackhci/arm-azurestackhci/README.md b/sdk/azurestackhci/arm-azurestackhci/README.md index 3ca16d6e28bb..521f29bb0537 100644 --- a/sdk/azurestackhci/arm-azurestackhci/README.md +++ b/sdk/azurestackhci/arm-azurestackhci/README.md @@ -6,7 +6,7 @@ Azure Stack HCI management service [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurestackhci/arm-azurestackhci) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-azurestackhci) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-azurestackhci?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-azurestackhci) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -16,8 +16,6 @@ Azure Stack HCI management service - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. - ### Prerequisites - An [Azure subscription][azure_sub]. @@ -51,17 +49,8 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { AzureStackHCIClient } = require("@azure/arm-azurestackhci"); const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new AzureStackHCIClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new AzureStackHCIClient(credential, subscriptionId); ``` diff --git a/sdk/azurestackhci/arm-azurestackhci/_meta.json b/sdk/azurestackhci/arm-azurestackhci/_meta.json index bc82b9f1193f..2b28f641016d 100644 --- a/sdk/azurestackhci/arm-azurestackhci/_meta.json +++ b/sdk/azurestackhci/arm-azurestackhci/_meta.json @@ -1,7 +1,8 @@ { - "commit": "20d333fa60a4a81acfd01a7bd56dd9c552301afe", + "commit": "0f0ca816d647dde10e6473cc9cbd05f64de19a33", "readme": "specification/azurestackhci/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:\\mydev\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\azurestackhci\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.16 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-beta.16" + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/azurestackhci/arm-azurestackhci/package.json b/sdk/azurestackhci/arm-azurestackhci/package.json index 7f3613ab6cfa..e89aad8a96c8 100644 --- a/sdk/azurestackhci/arm-azurestackhci/package.json +++ b/sdk/azurestackhci/arm-azurestackhci/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AzureStackHCIClient.", - "version": "2.1.1", + "version": "3.0.0", "engines": { "node": ">=12.0.0" }, @@ -28,14 +28,14 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-azurestackhci.d.ts", "devDependencies": { - "@microsoft/api-extractor": "7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-multi-entry": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.1.3", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.66.1", - "rollup-plugin-sourcemaps": "^0.6.3", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", @@ -98,21 +98,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/azureStackHCIClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-azurestackhci?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/azurestackhci/arm-azurestackhci/review/arm-azurestackhci.api.md b/sdk/azurestackhci/arm-azurestackhci/review/arm-azurestackhci.api.md index 70c6530d63aa..7dd098857441 100644 --- a/sdk/azurestackhci/arm-azurestackhci/review/arm-azurestackhci.api.md +++ b/sdk/azurestackhci/arm-azurestackhci/review/arm-azurestackhci.api.md @@ -13,12 +13,34 @@ import { PollOperationState } from '@azure/core-lro'; // @public export type ActionType = string; +// @public +export interface ArcConnectivityProperties { + enabled?: boolean; +} + +// @public +export interface ArcIdentityResponse { + // (undocumented) + arcApplicationClientId?: string; + // (undocumented) + arcApplicationObjectId?: string; + // (undocumented) + arcApplicationTenantId?: string; + // (undocumented) + arcServicePrincipalObjectId?: string; +} + // @public export type ArcSetting = ProxyResource & { readonly provisioningState?: ProvisioningState; arcInstanceResourceGroup?: string; + arcApplicationClientId?: string; + arcApplicationTenantId?: string; + arcServicePrincipalObjectId?: string; + arcApplicationObjectId?: string; readonly aggregateState?: ArcSettingAggregateState; readonly perNodeDetails?: PerNodeState[]; + connectivityProperties?: Record; createdBy?: string; createdByType?: CreatedByType; createdAt?: Date; @@ -38,13 +60,26 @@ export interface ArcSettingList { // @public export interface ArcSettings { + beginCreateIdentity(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ArcSettingsCreateIdentityOptionalParams): Promise, ArcSettingsCreateIdentityResponse>>; + beginCreateIdentityAndWait(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ArcSettingsCreateIdentityOptionalParams): Promise; beginDelete(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ArcSettingsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ArcSettingsDeleteOptionalParams): Promise; create(resourceGroupName: string, clusterName: string, arcSettingName: string, arcSetting: ArcSetting, options?: ArcSettingsCreateOptionalParams): Promise; + generatePassword(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ArcSettingsGeneratePasswordOptionalParams): Promise; get(resourceGroupName: string, clusterName: string, arcSettingName: string, options?: ArcSettingsGetOptionalParams): Promise; listByCluster(resourceGroupName: string, clusterName: string, options?: ArcSettingsListByClusterOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, clusterName: string, arcSettingName: string, arcSetting: ArcSetting, options?: ArcSettingsUpdateOptionalParams): Promise; +} + +// @public +export interface ArcSettingsCreateIdentityOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } +// @public +export type ArcSettingsCreateIdentityResponse = ArcIdentityResponse; + // @public export interface ArcSettingsCreateOptionalParams extends coreClient.OperationOptions { } @@ -58,6 +93,13 @@ export interface ArcSettingsDeleteOptionalParams extends coreClient.OperationOpt updateIntervalInMs?: number; } +// @public +export interface ArcSettingsGeneratePasswordOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ArcSettingsGeneratePasswordResponse = PasswordCredential; + // @public export interface ArcSettingsGetOptionalParams extends coreClient.OperationOptions { } @@ -79,6 +121,13 @@ export interface ArcSettingsListByClusterOptionalParams extends coreClient.Opera // @public export type ArcSettingsListByClusterResponse = ArcSettingList; +// @public +export interface ArcSettingsUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ArcSettingsUpdateResponse = ArcSetting; + // @public (undocumented) export class AzureStackHCIClient extends coreClient.ServiceClient { // (undocumented) @@ -113,6 +162,8 @@ export type Cluster = TrackedResource & { cloudManagementEndpoint?: string; aadClientId?: string; aadTenantId?: string; + aadApplicationObjectId?: string; + aadServicePrincipalObjectId?: string; desiredProperties?: ClusterDesiredProperties; readonly reportedProperties?: ClusterReportedProperties; readonly trialDaysRemaining?: number; @@ -120,6 +171,7 @@ export type Cluster = TrackedResource & { readonly registrationTimestamp?: Date; readonly lastSyncTimestamp?: Date; readonly lastBillingTimestamp?: Date; + readonly serviceEndpoint?: string; createdBy?: string; createdByType?: CreatedByType; createdAt?: Date; @@ -134,6 +186,18 @@ export interface ClusterDesiredProperties { windowsServerSubscription?: WindowsServerSubscription; } +// @public +export interface ClusterIdentityResponse { + // (undocumented) + aadApplicationObjectId?: string; + // (undocumented) + aadClientId?: string; + // (undocumented) + aadServicePrincipalObjectId?: string; + // (undocumented) + aadTenantId?: string; +} + // @public export interface ClusterList { readonly nextLink?: string; @@ -178,14 +242,28 @@ export interface ClusterReportedProperties { // @public export interface Clusters { + beginCreateIdentity(resourceGroupName: string, clusterName: string, options?: ClustersCreateIdentityOptionalParams): Promise, ClustersCreateIdentityResponse>>; + beginCreateIdentityAndWait(resourceGroupName: string, clusterName: string, options?: ClustersCreateIdentityOptionalParams): Promise; + beginDelete(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise; + beginUploadCertificate(resourceGroupName: string, clusterName: string, uploadCertificateRequest: UploadCertificateRequest, options?: ClustersUploadCertificateOptionalParams): Promise, void>>; + beginUploadCertificateAndWait(resourceGroupName: string, clusterName: string, uploadCertificateRequest: UploadCertificateRequest, options?: ClustersUploadCertificateOptionalParams): Promise; create(resourceGroupName: string, clusterName: string, cluster: Cluster, options?: ClustersCreateOptionalParams): Promise; - delete(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise; get(resourceGroupName: string, clusterName: string, options?: ClustersGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ClustersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: ClustersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; update(resourceGroupName: string, clusterName: string, cluster: ClusterPatch, options?: ClustersUpdateOptionalParams): Promise; } +// @public +export interface ClustersCreateIdentityOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClustersCreateIdentityResponse = ClusterIdentityResponse; + // @public export interface ClustersCreateOptionalParams extends coreClient.OperationOptions { } @@ -195,6 +273,8 @@ export type ClustersCreateResponse = Cluster; // @public export interface ClustersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -239,6 +319,12 @@ export interface ClustersUpdateOptionalParams extends coreClient.OperationOption // @public export type ClustersUpdateResponse = Cluster; +// @public +export interface ClustersUploadCertificateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + // @public export type CreatedByType = string; @@ -604,6 +690,18 @@ export type OperationsListResponse = OperationListResult; // @public export type Origin = string; +// @public (undocumented) +export interface PasswordCredential { + // (undocumented) + endDateTime?: Date; + // (undocumented) + keyId?: string; + // (undocumented) + secretText?: string; + // (undocumented) + startDateTime?: Date; +} + // @public export interface PerNodeExtensionState { readonly extension?: string; @@ -624,6 +722,12 @@ export type ProvisioningState = string; // @public export type ProxyResource = Resource & {}; +// @public (undocumented) +export interface RawCertificateData { + // (undocumented) + certificates?: string[]; +} + // @public export interface Resource { readonly id?: string; @@ -642,6 +746,12 @@ export type TrackedResource = Resource & { location: string; }; +// @public (undocumented) +export interface UploadCertificateRequest { + // (undocumented) + properties?: RawCertificateData; +} + // @public export type WindowsServerSubscription = string; diff --git a/sdk/azurestackhci/arm-azurestackhci/rollup.config.js b/sdk/azurestackhci/arm-azurestackhci/rollup.config.js index 3f89d7309da5..9be1955eb7f1 100644 --- a/sdk/azurestackhci/arm-azurestackhci/rollup.config.js +++ b/sdk/azurestackhci/arm-azurestackhci/rollup.config.js @@ -14,14 +14,62 @@ import json from "@rollup/plugin-json"; import nodeBuiltins from "builtin-modules"; +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + // #region Warning Handler /** - * A function that can determine whether a rollup warning should be ignored. If + * A function that can determine whether a rollupwarning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEval(warning) { +function ignoreNiseSinonEvalWarnings(warning) { return ( warning.code === "EVAL" && warning.id && @@ -30,14 +78,17 @@ function ignoreNiseSinonEval(warning) { ); } -function ignoreChaiCircularDependency(warning) { +function ignoreChaiCircularDependencyWarnings(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; /** * Construct a warning handler for the shared rollup configuration @@ -71,7 +122,22 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs(), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -107,7 +173,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve()] + plugins: [sourcemaps(), nodeResolve(), cjs()] }; const config = [baseConfig]; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts index 511c3d34ad9c..3cbadbb572f7 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts @@ -54,7 +54,7 @@ export class AzureStackHCIClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-azurestackhci/2.1.1`; + const packageDetails = `azsdk-js-arm-azurestackhci/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -77,7 +77,7 @@ export class AzureStackHCIClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-01-01"; + this.apiVersion = options.apiVersion || "2022-05-01"; this.arcSettings = new ArcSettingsImpl(this); this.clusters = new ClustersImpl(this); this.extensions = new ExtensionsImpl(this); diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts index d78b95910e18..0cef05b91620 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts @@ -109,6 +109,21 @@ export interface ErrorAdditionalInfo { readonly info?: Record; } +export interface PasswordCredential { + secretText?: string; + keyId?: string; + startDateTime?: Date; + endDateTime?: Date; +} + +/** ArcIdentity details. */ +export interface ArcIdentityResponse { + arcApplicationClientId?: string; + arcApplicationTenantId?: string; + arcServicePrincipalObjectId?: string; + arcApplicationObjectId?: string; +} + /** List of clusters. */ export interface ClusterList { /** List of clusters. */ @@ -232,6 +247,22 @@ export interface ClusterPatch { desiredProperties?: ClusterDesiredProperties; } +export interface UploadCertificateRequest { + properties?: RawCertificateData; +} + +export interface RawCertificateData { + certificates?: string[]; +} + +/** Cluster Identity details. */ +export interface ClusterIdentityResponse { + aadClientId?: string; + aadTenantId?: string; + aadServicePrincipalObjectId?: string; + aadApplicationObjectId?: string; +} + /** List of Extensions in HCI cluster. */ export interface ExtensionList { /** @@ -329,6 +360,12 @@ export interface OperationDisplay { readonly description?: string; } +/** Connectivity related configuration required by arc server. */ +export interface ArcConnectivityProperties { + /** True indicates ARC connectivity is enabled */ + enabled?: boolean; +} + /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export type ProxyResource = Resource & {}; @@ -349,6 +386,14 @@ export type ArcSetting = ProxyResource & { readonly provisioningState?: ProvisioningState; /** The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources. */ arcInstanceResourceGroup?: string; + /** App id of arc AAD identity. */ + arcApplicationClientId?: string; + /** Tenant id of arc AAD identity. */ + arcApplicationTenantId?: string; + /** Object id of arc AAD service principal. */ + arcServicePrincipalObjectId?: string; + /** Object id of arc AAD identity. */ + arcApplicationObjectId?: string; /** * Aggregate state of Arc agent across the nodes in this HCI cluster. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -359,6 +404,8 @@ export type ArcSetting = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly perNodeDetails?: PerNodeState[]; + /** contains connectivity related configuration for ARC resources */ + connectivityProperties?: Record; /** The identity that created the resource. */ createdBy?: string; /** The type of identity that created the resource. */ @@ -441,6 +488,10 @@ export type Cluster = TrackedResource & { aadClientId?: string; /** Tenant id of cluster AAD identity. */ aadTenantId?: string; + /** Object id of cluster AAD identity. */ + aadApplicationObjectId?: string; + /** Id of cluster identity service principal. */ + aadServicePrincipalObjectId?: string; /** Desired properties of the cluster. */ desiredProperties?: ClusterDesiredProperties; /** @@ -473,6 +524,11 @@ export type Cluster = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastBillingTimestamp?: Date; + /** + * Region specific DataPath Endpoint of the cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serviceEndpoint?: string; /** The identity that created the resource. */ createdBy?: string; /** The type of identity that created the resource. */ @@ -810,6 +866,13 @@ export interface ArcSettingsCreateOptionalParams /** Contains response data for the create operation. */ export type ArcSettingsCreateResponse = ArcSetting; +/** Optional parameters. */ +export interface ArcSettingsUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type ArcSettingsUpdateResponse = ArcSetting; + /** Optional parameters. */ export interface ArcSettingsDeleteOptionalParams extends coreClient.OperationOptions { @@ -819,6 +882,25 @@ export interface ArcSettingsDeleteOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface ArcSettingsGeneratePasswordOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the generatePassword operation. */ +export type ArcSettingsGeneratePasswordResponse = PasswordCredential; + +/** Optional parameters. */ +export interface ArcSettingsCreateIdentityOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createIdentity operation. */ +export type ArcSettingsCreateIdentityResponse = ArcIdentityResponse; + /** Optional parameters. */ export interface ArcSettingsListByClusterNextOptionalParams extends coreClient.OperationOptions {} @@ -863,7 +945,33 @@ export type ClustersUpdateResponse = Cluster; /** Optional parameters. */ export interface ClustersDeleteOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ClustersUploadCertificateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface ClustersCreateIdentityOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createIdentity operation. */ +export type ClustersCreateIdentityResponse = ClusterIdentityResponse; /** Optional parameters. */ export interface ClustersListBySubscriptionNextOptionalParams diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts index c64c554c6e72..b69644523c4a 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts @@ -193,6 +193,72 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { } }; +export const PasswordCredential: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PasswordCredential", + modelProperties: { + secretText: { + serializedName: "secretText", + type: { + name: "String" + } + }, + keyId: { + serializedName: "keyId", + type: { + name: "String" + } + }, + startDateTime: { + serializedName: "startDateTime", + type: { + name: "DateTime" + } + }, + endDateTime: { + serializedName: "endDateTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ArcIdentityResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ArcIdentityResponse", + modelProperties: { + arcApplicationClientId: { + serializedName: "properties.arcApplicationClientId", + type: { + name: "String" + } + }, + arcApplicationTenantId: { + serializedName: "properties.arcApplicationTenantId", + type: { + name: "String" + } + }, + arcServicePrincipalObjectId: { + serializedName: "properties.arcServicePrincipalObjectId", + type: { + name: "String" + } + }, + arcApplicationObjectId: { + serializedName: "properties.arcApplicationObjectId", + type: { + name: "String" + } + } + } + } +}; + export const ClusterList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -425,6 +491,75 @@ export const ClusterPatch: coreClient.CompositeMapper = { } }; +export const UploadCertificateRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UploadCertificateRequest", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "RawCertificateData" + } + } + } + } +}; + +export const RawCertificateData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RawCertificateData", + modelProperties: { + certificates: { + serializedName: "certificates", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ClusterIdentityResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterIdentityResponse", + modelProperties: { + aadClientId: { + serializedName: "properties.aadClientId", + type: { + name: "String" + } + }, + aadTenantId: { + serializedName: "properties.aadTenantId", + type: { + name: "String" + } + }, + aadServicePrincipalObjectId: { + serializedName: "properties.aadServicePrincipalObjectId", + type: { + name: "String" + } + }, + aadApplicationObjectId: { + serializedName: "properties.aadApplicationObjectId", + type: { + name: "String" + } + } + } + } +}; + export const ExtensionList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -594,6 +729,21 @@ export const OperationDisplay: coreClient.CompositeMapper = { } }; +export const ArcConnectivityProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ArcConnectivityProperties", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -647,6 +797,30 @@ export const ArcSetting: coreClient.CompositeMapper = { name: "String" } }, + arcApplicationClientId: { + serializedName: "properties.arcApplicationClientId", + type: { + name: "String" + } + }, + arcApplicationTenantId: { + serializedName: "properties.arcApplicationTenantId", + type: { + name: "String" + } + }, + arcServicePrincipalObjectId: { + serializedName: "properties.arcServicePrincipalObjectId", + type: { + name: "String" + } + }, + arcApplicationObjectId: { + serializedName: "properties.arcApplicationObjectId", + type: { + name: "String" + } + }, aggregateState: { serializedName: "properties.aggregateState", readOnly: true, @@ -667,6 +841,13 @@ export const ArcSetting: coreClient.CompositeMapper = { } } }, + connectivityProperties: { + serializedName: "properties.connectivityProperties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, createdBy: { serializedName: "systemData.createdBy", type: { @@ -870,6 +1051,18 @@ export const Cluster: coreClient.CompositeMapper = { name: "String" } }, + aadApplicationObjectId: { + serializedName: "properties.aadApplicationObjectId", + type: { + name: "String" + } + }, + aadServicePrincipalObjectId: { + serializedName: "properties.aadServicePrincipalObjectId", + type: { + name: "String" + } + }, desiredProperties: { serializedName: "properties.desiredProperties", type: { @@ -919,6 +1112,13 @@ export const Cluster: coreClient.CompositeMapper = { name: "DateTime" } }, + serviceEndpoint: { + serializedName: "properties.serviceEndpoint", + readOnly: true, + type: { + name: "String" + } + }, createdBy: { serializedName: "systemData.createdBy", type: { diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts index 60a1521159de..178e00e3f1f7 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts @@ -15,6 +15,7 @@ import { ArcSetting as ArcSettingMapper, Cluster as ClusterMapper, ClusterPatch as ClusterPatchMapper, + UploadCertificateRequest as UploadCertificateRequestMapper, Extension as ExtensionMapper } from "../models/mappers"; @@ -85,7 +86,7 @@ export const clusterName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-01-01", + defaultValue: "2022-05-01", isConstant: true, serializedName: "api-version", type: { @@ -144,6 +145,11 @@ export const cluster1: OperationParameter = { mapper: ClusterPatchMapper }; +export const uploadCertificateRequest: OperationParameter = { + parameterPath: "uploadCertificateRequest", + mapper: UploadCertificateRequestMapper +}; + export const extensionName: OperationURLParameter = { parameterPath: "extensionName", mapper: { diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/arcSettings.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/arcSettings.ts index 90c049668791..ca8de178d0b2 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/arcSettings.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/arcSettings.ts @@ -23,7 +23,13 @@ import { ArcSettingsGetResponse, ArcSettingsCreateOptionalParams, ArcSettingsCreateResponse, + ArcSettingsUpdateOptionalParams, + ArcSettingsUpdateResponse, ArcSettingsDeleteOptionalParams, + ArcSettingsGeneratePasswordOptionalParams, + ArcSettingsGeneratePasswordResponse, + ArcSettingsCreateIdentityOptionalParams, + ArcSettingsCreateIdentityResponse, ArcSettingsListByClusterNextResponse } from "../models"; @@ -168,6 +174,27 @@ export class ArcSettingsImpl implements ArcSettings { ); } + /** + * Update ArcSettings for HCI cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated + * @param options The options parameters. + */ + update( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + arcSetting: ArcSetting, + options?: ArcSettingsUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, arcSettingName, arcSetting, options }, + updateOperationSpec + ); + } + /** * Delete ArcSetting resource details of HCI Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -254,6 +281,116 @@ export class ArcSettingsImpl implements ArcSettings { return poller.pollUntilDone(); } + /** + * Generate password for arc settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param options The options parameters. + */ + generatePassword( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsGeneratePasswordOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, arcSettingName, options }, + generatePasswordOperationSpec + ); + } + + /** + * Create Aad identity for arc settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param options The options parameters. + */ + async beginCreateIdentity( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsCreateIdentityOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ArcSettingsCreateIdentityResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, clusterName, arcSettingName, options }, + createIdentityOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Create Aad identity for arc settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param options The options parameters. + */ + async beginCreateIdentityAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsCreateIdentityOptionalParams + ): Promise { + const poller = await this.beginCreateIdentity( + resourceGroupName, + clusterName, + arcSettingName, + options + ); + return poller.pollUntilDone(); + } + /** * ListByClusterNext * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -346,6 +483,31 @@ const createOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ArcSetting + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.arcSetting, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const deleteOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", @@ -370,6 +532,61 @@ const deleteOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const generatePasswordOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PasswordCredential + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createIdentityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ArcIdentityResponse + }, + 201: { + bodyMapper: Mappers.ArcIdentityResponse + }, + 202: { + bodyMapper: Mappers.ArcIdentityResponse + }, + 204: { + bodyMapper: Mappers.ArcIdentityResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.arcSettingName + ], + headerParameters: [Parameters.accept], + serializer +}; const listByClusterNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts index 382b1bffb34a..a3e32b85730f 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts @@ -12,6 +12,8 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureStackHCIClient } from "../azureStackHCIClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; import { Cluster, ClustersListBySubscriptionNextOptionalParams, @@ -28,6 +30,10 @@ import { ClustersUpdateOptionalParams, ClustersUpdateResponse, ClustersDeleteOptionalParams, + UploadCertificateRequest, + ClustersUploadCertificateOptionalParams, + ClustersCreateIdentityOptionalParams, + ClustersCreateIdentityResponse, ClustersListBySubscriptionNextResponse, ClustersListByResourceGroupNextResponse } from "../models"; @@ -229,15 +235,250 @@ export class ClustersImpl implements Clusters { * @param clusterName The name of the cluster. * @param options The options parameters. */ - delete( + async beginDelete( resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, clusterName, options }, deleteOperationSpec ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Delete an HCI cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Upload certificate. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param options The options parameters. + */ + async beginUploadCertificate( + resourceGroupName: string, + clusterName: string, + uploadCertificateRequest: UploadCertificateRequest, + options?: ClustersUploadCertificateOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, clusterName, uploadCertificateRequest, options }, + uploadCertificateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Upload certificate. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param options The options parameters. + */ + async beginUploadCertificateAndWait( + resourceGroupName: string, + clusterName: string, + uploadCertificateRequest: UploadCertificateRequest, + options?: ClustersUploadCertificateOptionalParams + ): Promise { + const poller = await this.beginUploadCertificate( + resourceGroupName, + clusterName, + uploadCertificateRequest, + options + ); + return poller.pollUntilDone(); + } + + /** + * Create cluster identity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param options The options parameters. + */ + async beginCreateIdentity( + resourceGroupName: string, + clusterName: string, + options?: ClustersCreateIdentityOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersCreateIdentityResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, clusterName, options }, + createIdentityOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + } + + /** + * Create cluster identity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param options The options parameters. + */ + async beginCreateIdentityAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersCreateIdentityOptionalParams + ): Promise { + const poller = await this.beginCreateIdentity( + resourceGroupName, + clusterName, + options + ); + return poller.pollUntilDone(); } /** @@ -389,11 +630,69 @@ const deleteOperationSpec: coreClient.OperationSpec = { httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const uploadCertificateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, + requestBody: Parameters.uploadCertificateRequest, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const createIdentityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ClusterIdentityResponse + }, + 201: { + bodyMapper: Mappers.ClusterIdentityResponse + }, + 202: { + bodyMapper: Mappers.ClusterIdentityResponse + }, + 204: { + bodyMapper: Mappers.ClusterIdentityResponse + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/arcSettings.ts b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/arcSettings.ts index b8541458da21..4f3f22f9d443 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/arcSettings.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/arcSettings.ts @@ -15,7 +15,13 @@ import { ArcSettingsGetResponse, ArcSettingsCreateOptionalParams, ArcSettingsCreateResponse, - ArcSettingsDeleteOptionalParams + ArcSettingsUpdateOptionalParams, + ArcSettingsUpdateResponse, + ArcSettingsDeleteOptionalParams, + ArcSettingsGeneratePasswordOptionalParams, + ArcSettingsGeneratePasswordResponse, + ArcSettingsCreateIdentityOptionalParams, + ArcSettingsCreateIdentityResponse } from "../models"; /// @@ -60,6 +66,21 @@ export interface ArcSettings { arcSetting: ArcSetting, options?: ArcSettingsCreateOptionalParams ): Promise; + /** + * Update ArcSettings for HCI cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated + * @param options The options parameters. + */ + update( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + arcSetting: ArcSetting, + options?: ArcSettingsUpdateOptionalParams + ): Promise; /** * Delete ArcSetting resource details of HCI Cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -86,4 +107,48 @@ export interface ArcSettings { arcSettingName: string, options?: ArcSettingsDeleteOptionalParams ): Promise; + /** + * Generate password for arc settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param options The options parameters. + */ + generatePassword( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsGeneratePasswordOptionalParams + ): Promise; + /** + * Create Aad identity for arc settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param options The options parameters. + */ + beginCreateIdentity( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsCreateIdentityOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ArcSettingsCreateIdentityResponse + > + >; + /** + * Create Aad identity for arc settings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param options The options parameters. + */ + beginCreateIdentityAndWait( + resourceGroupName: string, + clusterName: string, + arcSettingName: string, + options?: ArcSettingsCreateIdentityOptionalParams + ): Promise; } diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts index 44fdb94966e9..572953e118c3 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts @@ -7,6 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; import { Cluster, ClustersListBySubscriptionOptionalParams, @@ -18,7 +19,11 @@ import { ClusterPatch, ClustersUpdateOptionalParams, ClustersUpdateResponse, - ClustersDeleteOptionalParams + ClustersDeleteOptionalParams, + UploadCertificateRequest, + ClustersUploadCertificateOptionalParams, + ClustersCreateIdentityOptionalParams, + ClustersCreateIdentityResponse } from "../models"; /// @@ -83,9 +88,73 @@ export interface Clusters { * @param clusterName The name of the cluster. * @param options The options parameters. */ - delete( + beginDelete( resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams + ): Promise, void>>; + /** + * Delete an HCI cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersDeleteOptionalParams + ): Promise; + /** + * Upload certificate. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param options The options parameters. + */ + beginUploadCertificate( + resourceGroupName: string, + clusterName: string, + uploadCertificateRequest: UploadCertificateRequest, + options?: ClustersUploadCertificateOptionalParams + ): Promise, void>>; + /** + * Upload certificate. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @param options The options parameters. + */ + beginUploadCertificateAndWait( + resourceGroupName: string, + clusterName: string, + uploadCertificateRequest: UploadCertificateRequest, + options?: ClustersUploadCertificateOptionalParams ): Promise; + /** + * Create cluster identity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param options The options parameters. + */ + beginCreateIdentity( + resourceGroupName: string, + clusterName: string, + options?: ClustersCreateIdentityOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersCreateIdentityResponse + > + >; + /** + * Create cluster identity. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param options The options parameters. + */ + beginCreateIdentityAndWait( + resourceGroupName: string, + clusterName: string, + options?: ClustersCreateIdentityOptionalParams + ): Promise; } diff --git a/sdk/azurestackhci/arm-azurestackhci/tsconfig.json b/sdk/azurestackhci/arm-azurestackhci/tsconfig.json index ebe661af00c2..3e6ae96443f3 100644 --- a/sdk/azurestackhci/arm-azurestackhci/tsconfig.json +++ b/sdk/azurestackhci/arm-azurestackhci/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-azurestackhci": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"