From e8316b684948a0d4673d85f5466e6de867d787be Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 2 Sep 2022 04:38:31 +0000 Subject: [PATCH] CodeGen from PR 20426 in Azure/azure-rest-api-specs Merge a404488b59bdf570f76bef678a406a3fcf9feb89 into 9efa37b1a42c4d03eff733d9863dcafbd75d7ee3 --- common/config/rush/pnpm-lock.yaml | 55 ++--- .../arm-azurestackhci/CHANGELOG.md | 36 ++- .../arm-azurestackhci/_meta.json | 8 +- .../arm-azurestackhci/package.json | 27 +-- .../review/arm-azurestackhci.api.md | 223 ++++++++---------- .../src/azureStackHCIClient.ts | 38 ++- .../arm-azurestackhci/src/models/index.ts | 197 +++++++++++++++- .../arm-azurestackhci/src/models/mappers.ts | 80 +++++++ .../src/models/parameters.ts | 8 +- .../src/operations/clusters.ts | 134 +++++++++++ .../src/operationsInterfaces/clusters.ts | 36 ++- .../arm-azurestackhci/test/sampleTest.ts | 39 ++- .../arm-azurestackhci/tsconfig.json | 10 +- 13 files changed, 670 insertions(+), 221 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index e12827431b43..801335319de7 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3122,7 +3122,7 @@ packages: dev: false /array-flatten/1.1.1: - resolution: {integrity: sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=} + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} dev: false /array-includes/3.1.5: @@ -3383,7 +3383,7 @@ packages: dev: false /buffer-equal-constant-time/1.0.1: - resolution: {integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=} + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} dev: false /buffer-from/1.1.2: @@ -3533,7 +3533,7 @@ packages: dev: false /charenc/0.0.2: - resolution: {integrity: sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=} + resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} dev: false /check-error/1.0.2: @@ -3671,7 +3671,7 @@ packages: dev: false /concat-map/0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: false /concurrently/6.5.1: @@ -3734,7 +3734,7 @@ packages: dev: false /cookie-signature/1.0.6: - resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} dev: false /cookie/0.4.2: @@ -3836,7 +3836,7 @@ packages: dev: false /crypt/0.0.2: - resolution: {integrity: sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=} + resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} dev: false /csv-parse/5.3.0: @@ -4090,7 +4090,7 @@ packages: dependencies: semver: 7.3.7 shelljs: 0.8.5 - typescript: 4.9.0-dev.20220831 + typescript: 4.9.0-dev.20220901 dev: false /downlevel-dts/0.4.0: @@ -4117,11 +4117,11 @@ packages: dev: false /edge-launcher/1.2.2: - resolution: {integrity: sha1-60Cq+9Bnpup27/+rBke81VCbN7I=} + resolution: {integrity: sha512-JcD5WBi3BHZXXVSSeEhl6sYO8g5cuynk/hifBzds2Bp4JdzCGLNMHgMCKu5DvrO1yatMgF0goFsxXRGus0yh1g==} dev: false /ee-first/1.1.1: - resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: false /electron-to-chromium/1.4.199: @@ -5003,7 +5003,7 @@ packages: dev: false /fresh/0.5.2: - resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=} + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} dev: false @@ -5143,7 +5143,7 @@ packages: dev: false /github-from-package/0.0.0: - resolution: {integrity: sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=} + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} dev: false /glob-parent/5.1.2: @@ -6584,7 +6584,7 @@ packages: dev: false /media-typer/0.3.0: - resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} dev: false @@ -6594,7 +6594,7 @@ packages: dev: false /merge-descriptors/1.0.1: - resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=} + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} dev: false /merge-source-map/1.1.0: @@ -7019,7 +7019,7 @@ packages: dev: false /noms/0.0.0: - resolution: {integrity: sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=} + resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} dependencies: inherits: 2.0.4 readable-stream: 1.0.34 @@ -9093,8 +9093,8 @@ packages: hasBin: true dev: false - /typescript/4.9.0-dev.20220831: - resolution: {integrity: sha512-FXVLQI/P9R7uT/I0ODGrIPmV9uDlQXufoe+RUcvZOvTtLzk2Kd1H9rr+e3l6hiSho6ikrnvews2LWF5AulwO/w==} + /typescript/4.9.0-dev.20220901: + resolution: {integrity: sha512-6nVAA+LnuU09b62zRKm0XRiLUv6h62UDfgVulk9kmBjZmc35qlh3p3bA4LulqJ/euCG3bzCksyhL0ZeOw/bO/A==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -9209,7 +9209,7 @@ packages: dev: false /utils-merge/1.0.1: - resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} dev: false @@ -10205,18 +10205,18 @@ packages: dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.1.0_rollup@2.77.2 - '@rollup/plugin-json': 4.1.0_rollup@2.77.2 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.77.2 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.0 + '@rollup/plugin-json': 4.1.0_rollup@2.79.0 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.0 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.0 '@types/chai': 4.3.1 chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.77.2 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.77.2 + rollup: 2.79.0 + rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.0 tslib: 2.4.0 typescript: 4.6.4 uglify-js: 3.16.3 @@ -10732,7 +10732,7 @@ packages: dev: false file:projects/arm-azurestackhci.tgz: - resolution: {integrity: sha512-WBA4KoUyVzSTUC51xxeLERAie8koBjbJZxohAvzCWtzNGmtVJ/BTDy8MvRZKyX7/eeID6MwEfNRBr/YyQHtqOg==, tarball: file:projects/arm-azurestackhci.tgz} + resolution: {integrity: sha512-gOjLa6Wkvjji6mdgzgkTvrv9USxVWwgKaTcN/Fiock0gEfc1PfZVDx0U7n8iTmUs8vJ8+DPduuePIEUCp/a+hA==, tarball: file:projects/arm-azurestackhci.tgz} name: '@rush-temp/arm-azurestackhci' version: 0.0.0 dependencies: @@ -10744,6 +10744,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.0 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.0 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.0 + '@types/chai': 4.3.1 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -10755,7 +10757,6 @@ packages: uglify-js: 3.16.3 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false @@ -16316,7 +16317,7 @@ packages: dev: false file:projects/core-lro.tgz: - resolution: {integrity: sha512-Iekt5Nq7NjJhqKxKQv5GMYYjJn4Ri/D9JJNxlNYwM1UQl1rIBkWSSKiRGu/7a6tjcxGqGN2bURJUFXfKqwxVxQ==, tarball: file:projects/core-lro.tgz} + resolution: {integrity: sha512-0KYl8Q3FwAcxMpjqDQLMU0lfU1egH97ni5xAs4FYUCak6717aFuR2DILHaGhYjsT9oTff5xBdlN0F2fdhGRA6g==, tarball: file:projects/core-lro.tgz} name: '@rush-temp/core-lro' version: 0.0.0 dependencies: @@ -18677,7 +18678,7 @@ packages: dev: false file:projects/service-bus.tgz: - resolution: {integrity: sha512-mgysdXDlJrHBAMoTgQjI2vcpvRi2H7hO52vyQQFotYdORKrBnxv/3S6+lz+y33ixYX3QJy4+fMk/AghCVa7KWw==, tarball: file:projects/service-bus.tgz} + resolution: {integrity: sha512-4BFDdUHII5PS39w2G8t9solKkyizGJmqFNPm8gXFwqRBmEt780G6ANxvnSGaexuT4ClIyombsIbfmV8fpSOlnQ==, tarball: file:projects/service-bus.tgz} name: '@rush-temp/service-bus' version: 0.0.0 dependencies: diff --git a/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md index 5341694396b6..45553bee6f32 100644 --- a/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/arm-azurestackhci/CHANGELOG.md @@ -1,15 +1,31 @@ # Release History + +## 3.1.0 (2022-09-02) + +**Features** -## 3.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation Clusters.beginExtendSoftwareAssuranceBenefit + - Added operation Clusters.beginExtendSoftwareAssuranceBenefitAndWait + - Added Interface ArcSetting + - Added Interface Cluster + - Added Interface ClustersExtendSoftwareAssuranceBenefitOptionalParams + - Added Interface Extension + - Added Interface ProxyResource + - Added Interface SoftwareAssuranceChangeRequest + - Added Interface SoftwareAssuranceChangeRequestProperties + - Added Interface SoftwareAssuranceProperties + - Added Interface TrackedResource + - Added Type Alias ClusterNodeType + - Added Type Alias ClustersExtendSoftwareAssuranceBenefitResponse + - Added Type Alias SoftwareAssuranceIntent + - Added Type Alias SoftwareAssuranceStatus + - Interface ClusterNode has a new optional parameter nodeType + - Interface ClusterNode has a new optional parameter osDisplayVersion + - Added Enum KnownClusterNodeType + - Added Enum KnownSoftwareAssuranceIntent + - Added Enum KnownSoftwareAssuranceStatus + + ## 3.0.0 (2022-05-17) **Features** diff --git a/sdk/azurestackhci/arm-azurestackhci/_meta.json b/sdk/azurestackhci/arm-azurestackhci/_meta.json index b293f9ef7255..23328e0842bb 100644 --- a/sdk/azurestackhci/arm-azurestackhci/_meta.json +++ b/sdk/azurestackhci/arm-azurestackhci/_meta.json @@ -1,8 +1,8 @@ { - "commit": "057c69f5ed2f893c34944e9bfba3e303d49f64bc", + "commit": "f20a3ebaf38f2e0ce103d796bd3a31c54c1590f4", "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:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\azurestackhci\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.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/azurestackhci/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/azurestackhci/arm-azurestackhci/package.json b/sdk/azurestackhci/arm-azurestackhci/package.json index e88c3ea17edb..ba52bd4b2395 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": "3.0.1", + "version": "3.1.0", "engines": { "node": ">=12.0.0" }, @@ -40,9 +40,13 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/azurestackhci/arm-azurestackhci", "repository": { @@ -93,9 +97,8 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -106,13 +109,5 @@ } ] }, - "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 a381027df484..465f22aba8ff 100644 --- a/sdk/azurestackhci/arm-azurestackhci/review/arm-azurestackhci.api.md +++ b/sdk/azurestackhci/arm-azurestackhci/review/arm-azurestackhci.api.md @@ -31,23 +31,23 @@ export interface ArcIdentityResponse { } // @public -export type ArcSetting = ProxyResource & { - readonly provisioningState?: ProvisioningState; - arcInstanceResourceGroup?: string; +export interface ArcSetting extends ProxyResource { + readonly aggregateState?: ArcSettingAggregateState; arcApplicationClientId?: string; + arcApplicationObjectId?: string; arcApplicationTenantId?: string; + arcInstanceResourceGroup?: string; arcServicePrincipalObjectId?: string; - arcApplicationObjectId?: string; - readonly aggregateState?: ArcSettingAggregateState; - readonly perNodeDetails?: PerNodeState[]; connectivityProperties?: Record; + createdAt?: Date; createdBy?: string; createdByType?: CreatedByType; - createdAt?: Date; + lastModifiedAt?: Date; lastModifiedBy?: string; lastModifiedByType?: CreatedByType; - lastModifiedAt?: Date; -}; + readonly perNodeDetails?: PerNodeState[]; + readonly provisioningState?: ProvisioningState; +} // @public export type ArcSettingAggregateState = string; @@ -163,30 +163,31 @@ export interface AzureStackHCIClientOptionalParams extends coreClient.ServiceCli } // @public -export type Cluster = TrackedResource & { - readonly provisioningState?: ProvisioningState; - readonly status?: Status; - readonly cloudId?: string; - cloudManagementEndpoint?: string; - aadClientId?: string; - aadTenantId?: string; +export interface Cluster extends TrackedResource { aadApplicationObjectId?: string; + aadClientId?: string; aadServicePrincipalObjectId?: string; - desiredProperties?: ClusterDesiredProperties; - readonly reportedProperties?: ClusterReportedProperties; - readonly trialDaysRemaining?: number; + aadTenantId?: string; readonly billingModel?: string; - readonly registrationTimestamp?: Date; - readonly lastSyncTimestamp?: Date; - readonly lastBillingTimestamp?: Date; - readonly serviceEndpoint?: string; + readonly cloudId?: string; + cloudManagementEndpoint?: string; + createdAt?: Date; createdBy?: string; createdByType?: CreatedByType; - createdAt?: Date; + desiredProperties?: ClusterDesiredProperties; + readonly lastBillingTimestamp?: Date; + lastModifiedAt?: Date; lastModifiedBy?: string; lastModifiedByType?: CreatedByType; - lastModifiedAt?: Date; -}; + readonly lastSyncTimestamp?: Date; + readonly provisioningState?: ProvisioningState; + readonly registrationTimestamp?: Date; + readonly reportedProperties?: ClusterReportedProperties; + readonly serviceEndpoint?: string; + softwareAssuranceProperties?: SoftwareAssuranceProperties; + readonly status?: Status; + readonly trialDaysRemaining?: number; +} // @public export interface ClusterDesiredProperties { @@ -220,12 +221,17 @@ export interface ClusterNode { readonly memoryInGiB?: number; readonly model?: string; readonly name?: string; + readonly nodeType?: ClusterNodeType; + readonly osDisplayVersion?: string; readonly osName?: string; readonly osVersion?: string; readonly serialNumber?: string; readonly windowsServerSubscription?: WindowsServerSubscription; } +// @public +export type ClusterNodeType = string; + // @public export interface ClusterPatch { aadClientId?: string; @@ -254,6 +260,8 @@ export interface Clusters { 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; + beginExtendSoftwareAssuranceBenefit(resourceGroupName: string, clusterName: string, softwareAssuranceChangeRequest: SoftwareAssuranceChangeRequest, options?: ClustersExtendSoftwareAssuranceBenefitOptionalParams): Promise, ClustersExtendSoftwareAssuranceBenefitResponse>>; + beginExtendSoftwareAssuranceBenefitAndWait(resourceGroupName: string, clusterName: string, softwareAssuranceChangeRequest: SoftwareAssuranceChangeRequest, options?: ClustersExtendSoftwareAssuranceBenefitOptionalParams): 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; @@ -285,6 +293,15 @@ export interface ClustersDeleteOptionalParams extends coreClient.OperationOption updateIntervalInMs?: number; } +// @public +export interface ClustersExtendSoftwareAssuranceBenefitOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ClustersExtendSoftwareAssuranceBenefitResponse = Cluster; + // @public export interface ClustersGetOptionalParams extends coreClient.OperationOptions { } @@ -360,24 +377,24 @@ export interface ErrorResponse { } // @public -export type Extension = ProxyResource & { - readonly provisioningState?: ProvisioningState; +export interface Extension extends ProxyResource { readonly aggregateState?: ExtensionAggregateState; - readonly perNodeExtensionDetails?: PerNodeExtensionState[]; - forceUpdateTag?: string; - publisher?: string; - typePropertiesExtensionParametersType?: string; - typeHandlerVersion?: string; autoUpgradeMinorVersion?: boolean; - settings?: Record; - protectedSettings?: Record; + createdAt?: Date; createdBy?: string; createdByType?: CreatedByType; - createdAt?: Date; + forceUpdateTag?: string; + lastModifiedAt?: Date; lastModifiedBy?: string; lastModifiedByType?: CreatedByType; - lastModifiedAt?: Date; -}; + readonly perNodeExtensionDetails?: PerNodeExtensionState[]; + protectedSettings?: Record; + readonly provisioningState?: ProvisioningState; + publisher?: string; + settings?: Record; + typeHandlerVersion?: string; + typePropertiesExtensionParametersType?: string; +} // @public export type ExtensionAggregateState = string; @@ -450,207 +467,146 @@ export type ImdsAttestation = string; // @public export enum KnownActionType { - // (undocumented) Internal = "Internal" } // @public export enum KnownArcSettingAggregateState { - // (undocumented) Canceled = "Canceled", - // (undocumented) Connected = "Connected", - // (undocumented) Creating = "Creating", - // (undocumented) Deleted = "Deleted", - // (undocumented) Deleting = "Deleting", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Error = "Error", - // (undocumented) Failed = "Failed", - // (undocumented) InProgress = "InProgress", - // (undocumented) Moving = "Moving", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) PartiallyConnected = "PartiallyConnected", - // (undocumented) PartiallySucceeded = "PartiallySucceeded", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } +// @public +export enum KnownClusterNodeType { + FirstParty = "FirstParty", + ThirdParty = "ThirdParty" +} + // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownDiagnosticLevel { - // (undocumented) Basic = "Basic", - // (undocumented) Enhanced = "Enhanced", - // (undocumented) Off = "Off" } // @public export enum KnownExtensionAggregateState { - // (undocumented) Canceled = "Canceled", - // (undocumented) Connected = "Connected", - // (undocumented) Creating = "Creating", - // (undocumented) Deleted = "Deleted", - // (undocumented) Deleting = "Deleting", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Error = "Error", - // (undocumented) Failed = "Failed", - // (undocumented) InProgress = "InProgress", - // (undocumented) Moving = "Moving", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) PartiallyConnected = "PartiallyConnected", - // (undocumented) PartiallySucceeded = "PartiallySucceeded", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } // @public export enum KnownImdsAttestation { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public export enum KnownNodeArcState { - // (undocumented) Canceled = "Canceled", - // (undocumented) Connected = "Connected", - // (undocumented) Creating = "Creating", - // (undocumented) Deleted = "Deleted", - // (undocumented) Deleting = "Deleting", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Error = "Error", - // (undocumented) Failed = "Failed", - // (undocumented) Moving = "Moving", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } // @public export enum KnownNodeExtensionState { - // (undocumented) Canceled = "Canceled", - // (undocumented) Connected = "Connected", - // (undocumented) Creating = "Creating", - // (undocumented) Deleted = "Deleted", - // (undocumented) Deleting = "Deleting", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Error = "Error", - // (undocumented) Failed = "Failed", - // (undocumented) Moving = "Moving", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } // @public export enum KnownOrigin { - // (undocumented) System = "system", - // (undocumented) User = "user", - // (undocumented) UserSystem = "user,system" } // @public export enum KnownProvisioningState { - // (undocumented) Accepted = "Accepted", - // (undocumented) Canceled = "Canceled", - // (undocumented) Failed = "Failed", - // (undocumented) Provisioning = "Provisioning", - // (undocumented) Succeeded = "Succeeded" } +// @public +export enum KnownSoftwareAssuranceIntent { + Disable = "Disable", + Enable = "Enable" +} + +// @public +export enum KnownSoftwareAssuranceStatus { + Disabled = "Disabled", + Enabled = "Enabled" +} + // @public export enum KnownStatus { - // (undocumented) ConnectedRecently = "ConnectedRecently", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Error = "Error", - // (undocumented) NotConnectedRecently = "NotConnectedRecently", - // (undocumented) NotYetRegistered = "NotYetRegistered" } // @public export enum KnownWindowsServerSubscription { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } @@ -728,7 +684,8 @@ export interface PerNodeState { export type ProvisioningState = string; // @public -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource { +} // @public (undocumented) export interface RawCertificateData { @@ -743,16 +700,40 @@ export interface Resource { readonly type?: string; } +// @public (undocumented) +export interface SoftwareAssuranceChangeRequest { + // (undocumented) + properties?: SoftwareAssuranceChangeRequestProperties; +} + +// @public (undocumented) +export interface SoftwareAssuranceChangeRequestProperties { + softwareAssuranceIntent?: SoftwareAssuranceIntent; +} + +// @public +export type SoftwareAssuranceIntent = string; + +// @public +export interface SoftwareAssuranceProperties { + readonly lastUpdated?: Date; + softwareAssuranceIntent?: SoftwareAssuranceIntent; + softwareAssuranceStatus?: SoftwareAssuranceStatus; +} + +// @public +export type SoftwareAssuranceStatus = string; + // @public export type Status = string; // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { + location: string; tags?: { [propertyName: string]: string; }; - location: string; -}; +} // @public (undocumented) export interface UploadCertificateRequest { diff --git a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts index 9e3e8c2dafdd..528ff4deaf16 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/azureStackHCIClient.ts @@ -8,6 +8,11 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { ArcSettingsImpl, @@ -55,7 +60,7 @@ export class AzureStackHCIClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-azurestackhci/3.0.1`; + const packageDetails = `azsdk-js-arm-azurestackhci/3.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -102,11 +107,40 @@ export class AzureStackHCIClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-05-01"; + this.apiVersion = options.apiVersion || "2022-09-01"; this.arcSettings = new ArcSettingsImpl(this); this.clusters = new ClustersImpl(this); this.extensions = new ExtensionsImpl(this); this.operations = new OperationsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } arcSettings: ArcSettings; diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts index 03c622d84d1b..373985255754 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/index.ts @@ -143,6 +143,19 @@ export interface ClusterList { readonly nextLink?: string; } +/** Software Assurance properties of the cluster. */ +export interface SoftwareAssuranceProperties { + /** Status of the Software Assurance for the cluster. */ + softwareAssuranceStatus?: SoftwareAssuranceStatus; + /** Customer Intent for Software Assurance Benefit. */ + softwareAssuranceIntent?: SoftwareAssuranceIntent; + /** + * TimeStamp denoting the latest SA benefit applicability is validated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastUpdated?: Date; +} + /** Desired properties of the cluster. */ export interface ClusterDesiredProperties { /** Desired state of Windows Server Subscription. */ @@ -204,6 +217,11 @@ export interface ClusterNode { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly windowsServerSubscription?: WindowsServerSubscription; + /** + * Type of the cluster node hardware. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nodeType?: ClusterNodeType; /** * Manufacturer of the cluster node hardware. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -224,6 +242,11 @@ export interface ClusterNode { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly osVersion?: string; + /** + * Display version of the operating system running on the cluster node. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osDisplayVersion?: string; /** * Immutable id of the cluster node. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -271,6 +294,15 @@ export interface ClusterIdentityResponse { aadApplicationObjectId?: string; } +export interface SoftwareAssuranceChangeRequest { + properties?: SoftwareAssuranceChangeRequestProperties; +} + +export interface SoftwareAssuranceChangeRequestProperties { + /** Customer Intent for Software Assurance Benefit. */ + softwareAssuranceIntent?: SoftwareAssuranceIntent; +} + /** List of Extensions in HCI cluster. */ export interface ExtensionList { /** @@ -375,18 +407,18 @@ export interface ArcConnectivityProperties { } /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource {} /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The geo-location where the resource lives */ location: string; -}; +} /** ArcSetting details. */ -export type ArcSetting = ProxyResource & { +export interface ArcSetting extends ProxyResource { /** * Provisioning state of the ArcSetting proxy resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -426,10 +458,10 @@ export type ArcSetting = ProxyResource & { lastModifiedByType?: CreatedByType; /** The timestamp of resource last modification (UTC) */ lastModifiedAt?: Date; -}; +} /** Details of a particular extension in HCI Cluster. */ -export type Extension = ProxyResource & { +export interface Extension extends ProxyResource { /** * Provisioning state of the Extension proxy resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -471,10 +503,10 @@ export type Extension = ProxyResource & { lastModifiedByType?: CreatedByType; /** The timestamp of resource last modification (UTC) */ lastModifiedAt?: Date; -}; +} /** Cluster details. */ -export type Cluster = TrackedResource & { +export interface Cluster extends TrackedResource { /** * Provisioning state. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -500,6 +532,8 @@ export type Cluster = TrackedResource & { aadApplicationObjectId?: string; /** Id of cluster identity service principal. */ aadServicePrincipalObjectId?: string; + /** Software Assurance properties of the cluster. */ + softwareAssuranceProperties?: SoftwareAssuranceProperties; /** Desired properties of the cluster. */ desiredProperties?: ClusterDesiredProperties; /** @@ -549,13 +583,17 @@ export type Cluster = TrackedResource & { lastModifiedByType?: CreatedByType; /** The timestamp of resource last modification (UTC) */ lastModifiedAt?: Date; -}; +} /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -573,10 +611,15 @@ export type CreatedByType = string; /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** Canceled */ Canceled = "Canceled", + /** Accepted */ Accepted = "Accepted", + /** Provisioning */ Provisioning = "Provisioning" } @@ -595,20 +638,35 @@ export type ProvisioningState = string; /** Known values of {@link ArcSettingAggregateState} that the service accepts. */ export enum KnownArcSettingAggregateState { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** Error */ Error = "Error", + /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ Canceled = "Canceled", + /** Failed */ Failed = "Failed", + /** Connected */ Connected = "Connected", + /** Disconnected */ Disconnected = "Disconnected", + /** Deleted */ Deleted = "Deleted", + /** Creating */ Creating = "Creating", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Moving */ Moving = "Moving", + /** PartiallySucceeded */ PartiallySucceeded = "PartiallySucceeded", + /** PartiallyConnected */ PartiallyConnected = "PartiallyConnected", + /** InProgress */ InProgress = "InProgress" } @@ -637,17 +695,29 @@ export type ArcSettingAggregateState = string; /** Known values of {@link NodeArcState} that the service accepts. */ export enum KnownNodeArcState { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** Error */ Error = "Error", + /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ Canceled = "Canceled", + /** Failed */ Failed = "Failed", + /** Connected */ Connected = "Connected", + /** Disconnected */ Disconnected = "Disconnected", + /** Deleted */ Deleted = "Deleted", + /** Creating */ Creating = "Creating", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Moving */ Moving = "Moving" } @@ -673,10 +743,15 @@ export type NodeArcState = string; /** Known values of {@link Status} that the service accepts. */ export enum KnownStatus { + /** NotYetRegistered */ NotYetRegistered = "NotYetRegistered", + /** ConnectedRecently */ ConnectedRecently = "ConnectedRecently", + /** NotConnectedRecently */ NotConnectedRecently = "NotConnectedRecently", + /** Disconnected */ Disconnected = "Disconnected", + /** Error */ Error = "Error" } @@ -693,9 +768,47 @@ export enum KnownStatus { */ export type Status = string; +/** Known values of {@link SoftwareAssuranceStatus} that the service accepts. */ +export enum KnownSoftwareAssuranceStatus { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled" +} + +/** + * Defines values for SoftwareAssuranceStatus. \ + * {@link KnownSoftwareAssuranceStatus} can be used interchangeably with SoftwareAssuranceStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type SoftwareAssuranceStatus = string; + +/** Known values of {@link SoftwareAssuranceIntent} that the service accepts. */ +export enum KnownSoftwareAssuranceIntent { + /** Enable */ + Enable = "Enable", + /** Disable */ + Disable = "Disable" +} + +/** + * Defines values for SoftwareAssuranceIntent. \ + * {@link KnownSoftwareAssuranceIntent} can be used interchangeably with SoftwareAssuranceIntent, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enable** \ + * **Disable** + */ +export type SoftwareAssuranceIntent = string; + /** Known values of {@link WindowsServerSubscription} that the service accepts. */ export enum KnownWindowsServerSubscription { + /** Disabled */ Disabled = "Disabled", + /** Enabled */ Enabled = "Enabled" } @@ -711,8 +824,11 @@ export type WindowsServerSubscription = string; /** Known values of {@link DiagnosticLevel} that the service accepts. */ export enum KnownDiagnosticLevel { + /** Off */ Off = "Off", + /** Basic */ Basic = "Basic", + /** Enhanced */ Enhanced = "Enhanced" } @@ -727,9 +843,29 @@ export enum KnownDiagnosticLevel { */ export type DiagnosticLevel = string; +/** Known values of {@link ClusterNodeType} that the service accepts. */ +export enum KnownClusterNodeType { + /** FirstParty */ + FirstParty = "FirstParty", + /** ThirdParty */ + ThirdParty = "ThirdParty" +} + +/** + * Defines values for ClusterNodeType. \ + * {@link KnownClusterNodeType} can be used interchangeably with ClusterNodeType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **FirstParty** \ + * **ThirdParty** + */ +export type ClusterNodeType = string; + /** Known values of {@link ImdsAttestation} that the service accepts. */ export enum KnownImdsAttestation { + /** Disabled */ Disabled = "Disabled", + /** Enabled */ Enabled = "Enabled" } @@ -745,20 +881,35 @@ export type ImdsAttestation = string; /** Known values of {@link ExtensionAggregateState} that the service accepts. */ export enum KnownExtensionAggregateState { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** Error */ Error = "Error", + /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ Canceled = "Canceled", + /** Failed */ Failed = "Failed", + /** Connected */ Connected = "Connected", + /** Disconnected */ Disconnected = "Disconnected", + /** Deleted */ Deleted = "Deleted", + /** Creating */ Creating = "Creating", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Moving */ Moving = "Moving", + /** PartiallySucceeded */ PartiallySucceeded = "PartiallySucceeded", + /** PartiallyConnected */ PartiallyConnected = "PartiallyConnected", + /** InProgress */ InProgress = "InProgress" } @@ -787,17 +938,29 @@ export type ExtensionAggregateState = string; /** Known values of {@link NodeExtensionState} that the service accepts. */ export enum KnownNodeExtensionState { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** Error */ Error = "Error", + /** Succeeded */ Succeeded = "Succeeded", + /** Canceled */ Canceled = "Canceled", + /** Failed */ Failed = "Failed", + /** Connected */ Connected = "Connected", + /** Disconnected */ Disconnected = "Disconnected", + /** Deleted */ Deleted = "Deleted", + /** Creating */ Creating = "Creating", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Moving */ Moving = "Moving" } @@ -823,8 +986,11 @@ export type NodeExtensionState = string; /** Known values of {@link Origin} that the service accepts. */ export enum KnownOrigin { + /** User */ User = "user", + /** System */ System = "system", + /** UserSystem */ UserSystem = "user,system" } @@ -841,6 +1007,7 @@ export type Origin = string; /** Known values of {@link ActionType} that the service accepts. */ export enum KnownActionType { + /** Internal */ Internal = "Internal" } @@ -981,6 +1148,18 @@ export interface ClustersCreateIdentityOptionalParams /** Contains response data for the createIdentity operation. */ export type ClustersCreateIdentityResponse = ClusterIdentityResponse; +/** Optional parameters. */ +export interface ClustersExtendSoftwareAssuranceBenefitOptionalParams + 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 extendSoftwareAssuranceBenefit operation. */ +export type ClustersExtendSoftwareAssuranceBenefitResponse = Cluster; + /** Optional parameters. */ export interface ClustersListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts index 46e33b41b623..6d0915784ad7 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/mappers.ts @@ -310,6 +310,34 @@ export const ClusterList: coreClient.CompositeMapper = { } }; +export const SoftwareAssuranceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SoftwareAssuranceProperties", + modelProperties: { + softwareAssuranceStatus: { + serializedName: "softwareAssuranceStatus", + type: { + name: "String" + } + }, + softwareAssuranceIntent: { + serializedName: "softwareAssuranceIntent", + type: { + name: "String" + } + }, + lastUpdated: { + serializedName: "lastUpdated", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + export const ClusterDesiredProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -420,6 +448,13 @@ export const ClusterNode: coreClient.CompositeMapper = { name: "String" } }, + nodeType: { + serializedName: "nodeType", + readOnly: true, + type: { + name: "String" + } + }, manufacturer: { serializedName: "manufacturer", readOnly: true, @@ -448,6 +483,13 @@ export const ClusterNode: coreClient.CompositeMapper = { name: "String" } }, + osDisplayVersion: { + serializedName: "osDisplayVersion", + readOnly: true, + type: { + name: "String" + } + }, serialNumber: { serializedName: "serialNumber", readOnly: true, @@ -583,6 +625,37 @@ export const ClusterIdentityResponse: coreClient.CompositeMapper = { } }; +export const SoftwareAssuranceChangeRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SoftwareAssuranceChangeRequest", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "SoftwareAssuranceChangeRequestProperties" + } + } + } + } +}; + +export const SoftwareAssuranceChangeRequestProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SoftwareAssuranceChangeRequestProperties", + modelProperties: { + softwareAssuranceIntent: { + serializedName: "softwareAssuranceIntent", + type: { + name: "String" + } + } + } + } +}; + export const ExtensionList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1086,6 +1159,13 @@ export const Cluster: coreClient.CompositeMapper = { name: "String" } }, + softwareAssuranceProperties: { + serializedName: "properties.softwareAssuranceProperties", + type: { + name: "Composite", + className: "SoftwareAssuranceProperties" + } + }, desiredProperties: { serializedName: "properties.desiredProperties", type: { diff --git a/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts b/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts index d14a11a57d80..cb0199f1d93b 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/models/parameters.ts @@ -17,6 +17,7 @@ import { Cluster as ClusterMapper, ClusterPatch as ClusterPatchMapper, UploadCertificateRequest as UploadCertificateRequestMapper, + SoftwareAssuranceChangeRequest as SoftwareAssuranceChangeRequestMapper, Extension as ExtensionMapper } from "../models/mappers"; @@ -87,7 +88,7 @@ export const clusterName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-05-01", + defaultValue: "2022-09-01", isConstant: true, serializedName: "api-version", type: { @@ -156,6 +157,11 @@ export const uploadCertificateRequest: OperationParameter = { mapper: UploadCertificateRequestMapper }; +export const softwareAssuranceChangeRequest: OperationParameter = { + parameterPath: "softwareAssuranceChangeRequest", + mapper: SoftwareAssuranceChangeRequestMapper +}; + export const extensionName: OperationURLParameter = { parameterPath: "extensionName", mapper: { diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts index fbc1ce5ecd43..0281c5cb38be 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operations/clusters.ts @@ -34,6 +34,9 @@ import { ClustersUploadCertificateOptionalParams, ClustersCreateIdentityOptionalParams, ClustersCreateIdentityResponse, + SoftwareAssuranceChangeRequest, + ClustersExtendSoftwareAssuranceBenefitOptionalParams, + ClustersExtendSoftwareAssuranceBenefitResponse, ClustersListBySubscriptionNextResponse, ClustersListByResourceGroupNextResponse } from "../models"; @@ -487,6 +490,104 @@ export class ClustersImpl implements Clusters { return poller.pollUntilDone(); } + /** + * Extends Software Assurance Benefit to a cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload + * @param options The options parameters. + */ + async beginExtendSoftwareAssuranceBenefit( + resourceGroupName: string, + clusterName: string, + softwareAssuranceChangeRequest: SoftwareAssuranceChangeRequest, + options?: ClustersExtendSoftwareAssuranceBenefitOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersExtendSoftwareAssuranceBenefitResponse + > + > { + 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, + softwareAssuranceChangeRequest, + options + }, + extendSoftwareAssuranceBenefitOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Extends Software Assurance Benefit to a cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload + * @param options The options parameters. + */ + async beginExtendSoftwareAssuranceBenefitAndWait( + resourceGroupName: string, + clusterName: string, + softwareAssuranceChangeRequest: SoftwareAssuranceChangeRequest, + options?: ClustersExtendSoftwareAssuranceBenefitOptionalParams + ): Promise { + const poller = await this.beginExtendSoftwareAssuranceBenefit( + resourceGroupName, + clusterName, + softwareAssuranceChangeRequest, + options + ); + return poller.pollUntilDone(); + } + /** * ListBySubscriptionNext * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. @@ -709,6 +810,39 @@ const createIdentityOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const extendSoftwareAssuranceBenefitOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/extendSoftwareAssuranceBenefit", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Cluster + }, + 201: { + bodyMapper: Mappers.Cluster + }, + 202: { + bodyMapper: Mappers.Cluster + }, + 204: { + bodyMapper: Mappers.Cluster + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.softwareAssuranceChangeRequest, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts index 572953e118c3..656f8a68f6d0 100644 --- a/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts +++ b/sdk/azurestackhci/arm-azurestackhci/src/operationsInterfaces/clusters.ts @@ -23,7 +23,10 @@ import { UploadCertificateRequest, ClustersUploadCertificateOptionalParams, ClustersCreateIdentityOptionalParams, - ClustersCreateIdentityResponse + ClustersCreateIdentityResponse, + SoftwareAssuranceChangeRequest, + ClustersExtendSoftwareAssuranceBenefitOptionalParams, + ClustersExtendSoftwareAssuranceBenefitResponse } from "../models"; /// @@ -157,4 +160,35 @@ export interface Clusters { clusterName: string, options?: ClustersCreateIdentityOptionalParams ): Promise; + /** + * Extends Software Assurance Benefit to a cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload + * @param options The options parameters. + */ + beginExtendSoftwareAssuranceBenefit( + resourceGroupName: string, + clusterName: string, + softwareAssuranceChangeRequest: SoftwareAssuranceChangeRequest, + options?: ClustersExtendSoftwareAssuranceBenefitOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ClustersExtendSoftwareAssuranceBenefitResponse + > + >; + /** + * Extends Software Assurance Benefit to a cluster + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param softwareAssuranceChangeRequest Software Assurance Change Request Payload + * @param options The options parameters. + */ + beginExtendSoftwareAssuranceBenefitAndWait( + resourceGroupName: string, + clusterName: string, + softwareAssuranceChangeRequest: SoftwareAssuranceChangeRequest, + options?: ClustersExtendSoftwareAssuranceBenefitOptionalParams + ): Promise; } diff --git a/sdk/azurestackhci/arm-azurestackhci/test/sampleTest.ts b/sdk/azurestackhci/arm-azurestackhci/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/azurestackhci/arm-azurestackhci/test/sampleTest.ts +++ b/sdk/azurestackhci/arm-azurestackhci/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { 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"