From 696c4767085258c9d18c8c678534fc55d187906a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 10 May 2022 06:48:16 +0000 Subject: [PATCH] CodeGen from PR 18901 in Azure/azure-rest-api-specs Merge 2783869ac274ab2774ee5c781cedd6b02d9fa112 into 11830d3ce01db4f39a41dc37a86075b125c87fdc --- common/config/rush/pnpm-lock.yaml | 17 ++- .../arm-recoveryservicesbackup/CHANGELOG.md | 15 +++ .../arm-recoveryservicesbackup/README.md | 11 -- .../arm-recoveryservicesbackup/_meta.json | 10 +- .../arm-recoveryservicesbackup/package.json | 40 ++---- .../review/arm-recoveryservicesbackup.api.md | 38 +++++- .../rollup.config.js | 78 +++++++++++- .../src/models/index.ts | 120 ++++++++++++++---- .../src/models/mappers.ts | 81 +++++++++++- .../privateEndpointConnectionOperations.ts | 8 +- .../src/operations/protectionPolicies.ts | 4 +- .../src/operations/restores.ts | 4 +- .../src/operations/validateOperation.ts | 4 +- .../src/recoveryServicesBackupClient.ts | 41 +----- .../arm-recoveryservicesbackup/tsconfig.json | 10 +- 15 files changed, 333 insertions(+), 148 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3df37c100915..d082176a34b1 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -12712,28 +12712,27 @@ packages: dev: false file:projects/arm-recoveryservicesbackup.tgz: - resolution: {integrity: sha512-a1DTJE7Yj8+KnLOWV3gGGzBVoRo9L09N50EnLvjSlS4B/lrO8ibZbhSv5bPHGsqsiv9jxIWtAZRg5NE8uD21qA==, tarball: file:projects/arm-recoveryservicesbackup.tgz} + resolution: {integrity: sha512-DxQl5zbJq7Gn8mCQolbtr2OOhZBckX0cBA5O+gcA/ovSsvP0/1yjAG4T/gF38sWeBWrLAJ/NHKV5EUZoP+NR1A==, tarball: file:projects/arm-recoveryservicesbackup.tgz} name: '@rush-temp/arm-recoveryservicesbackup' 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.1.0_rollup@2.72.0 - '@rollup/plugin-json': 4.1.0_rollup@2.72.0 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.72.0 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.72.0 + '@microsoft/api-extractor': 7.23.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.72.0 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.72.0 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.4.0 typescript: 4.2.4 uglify-js: 3.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/CHANGELOG.md b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/CHANGELOG.md index 3e19b75a2ec8..e59fa10835b0 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/CHANGELOG.md +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History + +## 8.2.0 (2022-05-10) + +**Features** + - Added Interface TieringPolicy + - Added Type Alias TieringMode + - Interface AzureIaaSVMProtectedItemExtendedInfo has a new optional parameter newestRecoveryPointInArchive + - Interface AzureIaaSVMProtectedItemExtendedInfo has a new optional parameter oldestRecoveryPointInArchive + - Interface AzureIaaSVMProtectedItemExtendedInfo has a new optional parameter oldestRecoveryPointInVault + - Interface AzureVmWorkloadProtectedItemExtendedInfo has a new optional parameter newestRecoveryPointInArchive + - Interface AzureVmWorkloadProtectedItemExtendedInfo has a new optional parameter oldestRecoveryPointInArchive + - Interface AzureVmWorkloadProtectedItemExtendedInfo has a new optional parameter oldestRecoveryPointInVault + - Interface SubProtectionPolicy has a new optional parameter tieringPolicy + - Added Enum KnownTieringMode + ## 8.1.1 (2022-04-29) **Features** diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/README.md b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/README.md index fdfafbd7c8af..ce9b78595ffa 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/README.md +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/README.md @@ -16,8 +16,6 @@ Open API 2.0 Specs for Azure RecoveryServices Backup 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 { RecoveryServicesBackupClient } = require("@azure/arm-recoveryservicesbackup"); 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 RecoveryServicesBackupClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new RecoveryServicesBackupClient(credential, subscriptionId); ``` diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/_meta.json b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/_meta.json index 31c7126f95f9..0811f8704f54 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/_meta.json +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/_meta.json @@ -1,8 +1,8 @@ { - "commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf", - "readme": "specification\\recoveryservicesbackup\\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\\recoveryservicesbackup\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "395feffd968bd9c073bd575a4fc029b0adda57ec", + "readme": "specification/recoveryservicesbackup/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/recoveryservicesbackup/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", "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" -} + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" +} \ No newline at end of file diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/package.json b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/package.json index e72b23d61255..6df4e52345a7 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/package.json +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for RecoveryServicesBackupClient.", - "version": "8.1.1", + "version": "8.2.0", "engines": { "node": ">=12.0.0" }, @@ -11,9 +11,9 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.5.0", + "@azure/core-client": "^1.0.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.1.0", "tslib": "^2.2.0" }, "keywords": [ @@ -28,14 +28,14 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-recoveryservicesbackup.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/recoveryServicesBackupClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-recoveryservicesbackup?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/review/arm-recoveryservicesbackup.api.md b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/review/arm-recoveryservicesbackup.api.md index fd8808e3e403..44c33bc848b8 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/review/arm-recoveryservicesbackup.api.md +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/review/arm-recoveryservicesbackup.api.md @@ -215,7 +215,10 @@ export type AzureIaaSVMProtectedItem = ProtectedItem & { // @public export interface AzureIaaSVMProtectedItemExtendedInfo { + newestRecoveryPointInArchive?: Date; oldestRecoveryPoint?: Date; + oldestRecoveryPointInArchive?: Date; + oldestRecoveryPointInVault?: Date; policyInconsistent?: boolean; recoveryPointCount?: number; } @@ -229,6 +232,9 @@ export type AzureIaaSVMProtectionPolicy = ProtectionPolicy & { instantRPDetails?: InstantRPAdditionalDetails; schedulePolicy?: SchedulePolicyUnion; retentionPolicy?: RetentionPolicyUnion; + tieringPolicy?: { + [propertyName: string]: TieringPolicy; + }; instantRpRetentionRangeInDays?: number; timeZone?: string; policyType?: IaasvmPolicyType; @@ -401,7 +407,10 @@ export type AzureVmWorkloadProtectedItem = ProtectedItem & { // @public export interface AzureVmWorkloadProtectedItemExtendedInfo { + newestRecoveryPointInArchive?: Date; oldestRecoveryPoint?: Date; + oldestRecoveryPointInArchive?: Date; + oldestRecoveryPointInVault?: Date; policyState?: string; recoveryModel?: string; recoveryPointCount?: number; @@ -1670,7 +1679,7 @@ export type IaasVMBackupRequest = BackupRequest & { // @public export type IaaSVMContainer = ProtectionContainer & { - containerType: "IaaSVMContainer" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines"; + containerType: "IaasVMContainer" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines"; virtualMachineId?: string; virtualMachineVersion?: string; resourceGroup?: string; @@ -2685,6 +2694,18 @@ export enum KnownSupportStatus { Supported = "Supported" } +// @public +export enum KnownTieringMode { + // (undocumented) + DoNotTier = "DoNotTier", + // (undocumented) + Invalid = "Invalid", + // (undocumented) + TierAfter = "TierAfter", + // (undocumented) + TierRecommended = "TierRecommended" +} + // @public export enum KnownType { // (undocumented) @@ -3350,7 +3371,7 @@ export type ProtectedItemUnion = ProtectedItem | AzureFileshareProtectedItem | A // @public export interface ProtectionContainer { backupManagementType?: BackupManagementType; - containerType: "DPMContainer" | "AzureBackupServerContainer" | "IaaSVMContainer" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines" | "AzureWorkloadContainer" | "SQLAGWorkLoadContainer" | "AzureSqlContainer" | "StorageContainer" | "VMAppContainer" | "GenericContainer" | "Windows"; + containerType: "DPMContainer" | "AzureBackupServerContainer" | "IaasVMContainer" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines" | "AzureWorkloadContainer" | "SQLAGWorkLoadContainer" | "AzureSqlContainer" | "StorageContainer" | "VMAppContainer" | "GenericContainer" | "Windows"; friendlyName?: string; healthStatus?: string; protectableObjectType?: string; @@ -4083,6 +4104,9 @@ export interface SubProtectionPolicy { policyType?: PolicyType; retentionPolicy?: RetentionPolicyUnion; schedulePolicy?: SchedulePolicyUnion; + tieringPolicy?: { + [propertyName: string]: TieringPolicy; + }; } // @public @@ -4102,6 +4126,16 @@ export interface TargetRestoreInfo { targetDirectoryForFileRestore?: string; } +// @public +export type TieringMode = string; + +// @public +export interface TieringPolicy { + duration?: number; + durationType?: RetentionDurationType; + tieringMode?: TieringMode; +} + // @public export interface TokenInformation { expiryTimeInUtcTicks?: number; diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/rollup.config.js b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/rollup.config.js index 3f89d7309da5..9be1955eb7f1 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/rollup.config.js +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/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/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/index.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/index.ts index 28625af42dc6..f843f580fa10 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/index.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/index.ts @@ -889,7 +889,7 @@ export interface ProtectionContainer { containerType: | "DPMContainer" | "AzureBackupServerContainer" - | "IaaSVMContainer" + | "IaasVMContainer" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines" | "AzureWorkloadContainer" @@ -1122,6 +1122,12 @@ export interface SubProtectionPolicy { schedulePolicy?: SchedulePolicyUnion; /** Retention policy with the details on backup copy retention ranges. */ retentionPolicy?: RetentionPolicyUnion; + /** + * Tiering policy to automatically move RPs to another tier. + * Key is Target Tier, defined in RecoveryPointTierType enum. + * Tiering policy specifies the criteria to move RP to the target tier. + */ + tieringPolicy?: { [propertyName: string]: TieringPolicy }; } /** Base class for backup schedule. */ @@ -1140,10 +1146,40 @@ export interface RetentionPolicy { retentionPolicyType: "LongTermRetentionPolicy" | "SimpleRetentionPolicy"; } +/** + * Tiering Policy for a target tier. + * If the policy is not specified for a given target tier, service retains the existing configured tiering policy for that tier + */ +export interface TieringPolicy { + /** + * Tiering Mode to control automatic tiering of recovery points. Supported values are: + * 1. TierRecommended: Tier all recovery points recommended to be tiered + * 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. + * 3. DoNotTier: Do not tier any recovery points + */ + tieringMode?: TieringMode; + /** + * Number of days/weeks/months/years to retain backups in current tier before tiering. + * Used only if TieringMode is set to TierAfter + */ + duration?: number; + /** + * Retention duration type: days/weeks/months/years + * Used only if TieringMode is set to TierAfter + */ + durationType?: RetentionDurationType; +} + /** Additional information on Azure IaaS VM specific backup item. */ export interface AzureIaaSVMProtectedItemExtendedInfo { - /** The oldest backup copy available for this backup item. */ + /** The oldest backup copy available for this backup item across all tiers. */ oldestRecoveryPoint?: Date; + /** The oldest backup copy available for this backup item in vault tier */ + oldestRecoveryPointInVault?: Date; + /** The oldest backup copy available for this backup item in archive tier */ + oldestRecoveryPointInArchive?: Date; + /** The latest backup copy available for this backup item in archive tier */ + newestRecoveryPointInArchive?: Date; /** Number of backup copies available for this backup item. */ recoveryPointCount?: number; /** Specifies if backup policy associated with the backup item is inconsistent. */ @@ -1273,8 +1309,14 @@ export interface AzureStorageJobTaskDetails { /** Additional information on Azure Workload for SQL specific backup item. */ export interface AzureVmWorkloadProtectedItemExtendedInfo { - /** The oldest backup copy available for this backup item. */ + /** The oldest backup copy available for this backup item across all tiers. */ oldestRecoveryPoint?: Date; + /** The oldest backup copy available for this backup item in vault tier */ + oldestRecoveryPointInVault?: Date; + /** The oldest backup copy available for this backup item in archive tier */ + oldestRecoveryPointInArchive?: Date; + /** The latest backup copy available for this backup item in archive tier */ + newestRecoveryPointInArchive?: Date; /** Number of backup copies available for this backup item. */ recoveryPointCount?: number; /** Indicates consistency of policy object and policy applied to this backup item. */ @@ -2678,6 +2720,12 @@ export type AzureIaaSVMProtectionPolicy = ProtectionPolicy & { schedulePolicy?: SchedulePolicyUnion; /** Retention policy with the details on backup copy retention ranges. */ retentionPolicy?: RetentionPolicyUnion; + /** + * Tiering policy to automatically move RPs to another tier + * Key is Target Tier, defined in RecoveryPointTierType enum. + * Tiering policy specifies the criteria to move RP to the target tier. + */ + tieringPolicy?: { [propertyName: string]: TieringPolicy }; /** Instant RP retention policy range in days */ instantRpRetentionRangeInDays?: number; /** TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". */ @@ -2933,7 +2981,7 @@ export type DpmContainer = ProtectionContainer & { export type IaaSVMContainer = ProtectionContainer & { /** Polymorphic discriminator, which specifies the different types this object can be */ containerType: - | "IaaSVMContainer" + | "IaasVMContainer" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines"; /** Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. */ @@ -4241,6 +4289,48 @@ export enum KnownPolicyType { */ export type PolicyType = string; +/** Known values of {@link TieringMode} that the service accepts. */ +export enum KnownTieringMode { + Invalid = "Invalid", + TierRecommended = "TierRecommended", + TierAfter = "TierAfter", + DoNotTier = "DoNotTier" +} + +/** + * Defines values for TieringMode. \ + * {@link KnownTieringMode} can be used interchangeably with TieringMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **TierRecommended** \ + * **TierAfter** \ + * **DoNotTier** + */ +export type TieringMode = string; + +/** Known values of {@link RetentionDurationType} that the service accepts. */ +export enum KnownRetentionDurationType { + Invalid = "Invalid", + Days = "Days", + Weeks = "Weeks", + Months = "Months", + Years = "Years" +} + +/** + * Defines values for RetentionDurationType. \ + * {@link KnownRetentionDurationType} can be used interchangeably with RetentionDurationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Days** \ + * **Weeks** \ + * **Months** \ + * **Years** + */ +export type RetentionDurationType = string; + /** Known values of {@link HealthStatus} that the service accepts. */ export enum KnownHealthStatus { Passed = "Passed", @@ -4447,28 +4537,6 @@ export enum KnownRestorePointQueryType { */ export type RestorePointQueryType = string; -/** Known values of {@link RetentionDurationType} that the service accepts. */ -export enum KnownRetentionDurationType { - Invalid = "Invalid", - Days = "Days", - Weeks = "Weeks", - Months = "Months", - Years = "Years" -} - -/** - * Defines values for RetentionDurationType. \ - * {@link KnownRetentionDurationType} can be used interchangeably with RetentionDurationType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Invalid** \ - * **Days** \ - * **Weeks** \ - * **Months** \ - * **Years** - */ -export type RetentionDurationType = string; - /** Known values of {@link JobStatus} that the service accepts. */ export enum KnownJobStatus { Invalid = "Invalid", diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/mappers.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/mappers.ts index 191d7773b857..eb5dd0999ac7 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/mappers.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/mappers.ts @@ -2413,6 +2413,13 @@ export const SubProtectionPolicy: coreClient.CompositeMapper = { name: "Composite", className: "RetentionPolicy" } + }, + tieringPolicy: { + serializedName: "tieringPolicy", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "TieringPolicy" } } + } } } } @@ -2460,6 +2467,33 @@ export const RetentionPolicy: coreClient.CompositeMapper = { } }; +export const TieringPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TieringPolicy", + modelProperties: { + tieringMode: { + serializedName: "tieringMode", + type: { + name: "String" + } + }, + duration: { + serializedName: "duration", + type: { + name: "Number" + } + }, + durationType: { + serializedName: "durationType", + type: { + name: "String" + } + } + } + } +}; + export const AzureIaaSVMProtectedItemExtendedInfo: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2471,6 +2505,24 @@ export const AzureIaaSVMProtectedItemExtendedInfo: coreClient.CompositeMapper = name: "DateTime" } }, + oldestRecoveryPointInVault: { + serializedName: "oldestRecoveryPointInVault", + type: { + name: "DateTime" + } + }, + oldestRecoveryPointInArchive: { + serializedName: "oldestRecoveryPointInArchive", + type: { + name: "DateTime" + } + }, + newestRecoveryPointInArchive: { + serializedName: "newestRecoveryPointInArchive", + type: { + name: "DateTime" + } + }, recoveryPointCount: { serializedName: "recoveryPointCount", type: { @@ -2833,6 +2885,24 @@ export const AzureVmWorkloadProtectedItemExtendedInfo: coreClient.CompositeMappe name: "DateTime" } }, + oldestRecoveryPointInVault: { + serializedName: "oldestRecoveryPointInVault", + type: { + name: "DateTime" + } + }, + oldestRecoveryPointInArchive: { + serializedName: "oldestRecoveryPointInArchive", + type: { + name: "DateTime" + } + }, + newestRecoveryPointInArchive: { + serializedName: "newestRecoveryPointInArchive", + type: { + name: "DateTime" + } + }, recoveryPointCount: { serializedName: "recoveryPointCount", type: { @@ -6845,6 +6915,13 @@ export const AzureIaaSVMProtectionPolicy: coreClient.CompositeMapper = { className: "RetentionPolicy" } }, + tieringPolicy: { + serializedName: "tieringPolicy", + type: { + name: "Dictionary", + value: { type: { name: "Composite", className: "TieringPolicy" } } + } + }, instantRpRetentionRangeInDays: { serializedName: "instantRpRetentionRangeInDays", type: { @@ -7625,7 +7702,7 @@ export const DpmContainer: coreClient.CompositeMapper = { }; export const IaaSVMContainer: coreClient.CompositeMapper = { - serializedName: "IaaSVMContainer", + serializedName: "IaasVMContainer", type: { name: "Composite", className: "IaaSVMContainer", @@ -9141,7 +9218,7 @@ export let discriminators = { "ProtectableContainer.StorageContainer": AzureStorageProtectableContainer, "ProtectableContainer.VMAppContainer": AzureVMAppContainerProtectableContainer, "ProtectionContainer.DPMContainer": DpmContainer, - "ProtectionContainer.IaaSVMContainer": IaaSVMContainer, + "ProtectionContainer.IaasVMContainer": IaaSVMContainer, "ProtectionContainer.AzureWorkloadContainer": AzureWorkloadContainer, "ProtectionContainer.AzureSqlContainer": AzureSqlContainer, "ProtectionContainer.StorageContainer": AzureStorageContainer, diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/privateEndpointConnectionOperations.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/privateEndpointConnectionOperations.ts index 1b935ac98b73..bab91d07ed41 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/privateEndpointConnectionOperations.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/privateEndpointConnectionOperations.ts @@ -126,12 +126,10 @@ export class PrivateEndpointConnectionOperationsImpl }, putOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -218,12 +216,10 @@ export class PrivateEndpointConnectionOperationsImpl { vaultName, resourceGroupName, privateEndpointConnectionName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/protectionPolicies.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/protectionPolicies.ts index 0dd00cd52b76..2c2d88c2d851 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/protectionPolicies.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/protectionPolicies.ts @@ -140,12 +140,10 @@ export class ProtectionPoliciesImpl implements ProtectionPolicies { { vaultName, resourceGroupName, policyName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/restores.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/restores.ts index 3c2951e1a699..dd124b218dbf 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/restores.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/restores.ts @@ -107,12 +107,10 @@ export class RestoresImpl implements Restores { }, triggerOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/validateOperation.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/validateOperation.ts index 3805b219a39a..988aa8a819a2 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/validateOperation.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/operations/validateOperation.ts @@ -89,12 +89,10 @@ export class ValidateOperationImpl implements ValidateOperation { { vaultName, resourceGroupName, parameters, options }, triggerOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/recoveryServicesBackupClient.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/recoveryServicesBackupClient.ts index 2db6f7ec4cf3..cda39b477aa4 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/recoveryServicesBackupClient.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/recoveryServicesBackupClient.ts @@ -7,7 +7,6 @@ */ import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "./lroImpl"; @@ -157,7 +156,7 @@ export class RecoveryServicesBackupClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-recoveryservicesbackup/8.1.1`; + const packageDetails = `azsdk-js-arm-recoveryservicesbackup/8.2.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -172,33 +171,9 @@ export class RecoveryServicesBackupClient extends coreClient.ServiceClient { userAgentOptions: { userAgentPrefix }, - baseUri: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + baseUri: options.endpoint || "https://management.azure.com" }; super(optionsWithDefaults); - - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName - ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } - } // Parameter assignments this.subscriptionId = subscriptionId; @@ -357,12 +332,10 @@ export class RecoveryServicesBackupClient extends coreClient.ServiceClient { { vaultName, resourceGroupName, parameters, options }, bMSPrepareDataMoveOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -446,12 +419,10 @@ export class RecoveryServicesBackupClient extends coreClient.ServiceClient { { vaultName, resourceGroupName, parameters, options }, bMSTriggerDataMoveOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -552,12 +523,10 @@ export class RecoveryServicesBackupClient extends coreClient.ServiceClient { }, moveRecoveryPointOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/tsconfig.json b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/tsconfig.json index a7e9eaf1a49b..3e6ae96443f3 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/tsconfig.json +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-recoveryservicesbackup": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"