From c41731fa15d02dd958e574b4a29766609e962997 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 29 Aug 2023 09:44:09 +0000 Subject: [PATCH] CodeGen from PR 25574 in Azure/azure-rest-api-specs Merge d870e299c87a66a5af723190ee27627b54102dac into 0762e82bcccef4a032e29dda5e4c07fd7cc822a6 --- .../arm-recoveryservicesbackup/CHANGELOG.md | 32 +++-- .../arm-recoveryservicesbackup/_meta.json | 8 +- .../arm-recoveryservicesbackup/package.json | 23 +--- .../review/arm-recoveryservicesbackup.api.md | 32 ++++- .../src/models/index.ts | 85 +++++++++--- .../src/models/mappers.ts | 129 +++++++++++++----- .../src/models/parameters.ts | 2 +- .../src/recoveryServicesBackupClient.ts | 4 +- .../test/sampleTest.ts | 43 ++++++ .../arm-recoveryservicesbackup/tsconfig.json | 10 +- 10 files changed, 266 insertions(+), 102 deletions(-) create mode 100644 sdk/recoveryservicesbackup/arm-recoveryservicesbackup/test/sampleTest.ts diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/CHANGELOG.md b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/CHANGELOG.md index 27071178c437..d0469e4faa8d 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/CHANGELOG.md +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/CHANGELOG.md @@ -1,15 +1,31 @@ # Release History + +## 11.0.0 (2023-08-29) + +**Features** -## 10.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added Interface AzureVmWorkloadSAPHanaHSRProtectableItem + - Added Type Alias VaultSubResourceType + - Interface AzureVmWorkloadProtectableItem has a new optional parameter isProtectable + - Interface AzureVmWorkloadProtectedItem has a new optional parameter nodesList + - Interface AzureVmWorkloadSQLAvailabilityGroupProtectableItem has a new optional parameter nodesList + - Interface BackupResourceVaultConfig has a new optional parameter softDeleteRetentionPeriodInDays + - Interface DistributedNodesInfo has a new optional parameter sourceResourceId + - Interface InquiryValidation has a new optional parameter protectableItemCount + - Interface PrivateEndpointConnection has a new optional parameter groupIds + - Interface PrivateLinkServiceConnectionState has a new optional parameter actionsRequired + - Interface ProtectedItem has a new optional parameter softDeleteRetentionPeriodInDays + - Added Enum KnownVaultSubResourceType + - Enum KnownSoftDeleteFeatureState has a new value AlwaysON -### Other Changes +**Breaking Changes** + - Interface PrivateLinkServiceConnectionState no longer has parameter actionRequired + - Interface ProtectedItem no longer has parameter softDeleteRetentionPeriod + - Type of parameter protectableItemType of interface AzureVmWorkloadProtectableItem is changed from "AzureVmWorkloadProtectableItem" | "SAPAseSystem" | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" | "SAPHanaHSR" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance" to "AzureVmWorkloadProtectableItem" | "SAPAseSystem" | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" | "HanaHSRContainer" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance" + - Type of parameter protectableItemType of interface WorkloadProtectableItem is changed from "AzureFileShare" | "IaaSVMProtectableItem" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines" | "AzureVmWorkloadProtectableItem" | "SAPAseSystem" | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" | "SAPHanaHSR" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance" to "AzureFileShare" | "IaaSVMProtectableItem" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines" | "AzureVmWorkloadProtectableItem" | "SAPAseSystem" | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" | "HanaHSRContainer" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance" + + ## 10.1.0 (2023-03-10) **Features** diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/_meta.json b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/_meta.json index 01e3867d7224..208a5308cad6 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/_meta.json +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/_meta.json @@ -1,8 +1,8 @@ { - "commit": "4f4044394791773e6e7e82a9bd90d3935caaca1b", + "commit": "6d88f13f86c5d474571cc876572152fc67bcbad1", "readme": "specification/recoveryservicesbackup/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\recoveryservicesbackup\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.9 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --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/recoveryservicesbackup/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.9" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/package.json b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/package.json index 2059655bb91e..8d0741f12ed6 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/package.json +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for RecoveryServicesBackupClient.", - "version": "10.1.1", + "version": "11.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -48,9 +48,8 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-recoveryservices": "^5.2.0", - "ts-node": "^10.0.0" + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -113,13 +112,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/recoveryservicesbackup/arm-recoveryservicesbackup", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-recoveryservicesbackup?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/recoveryservicesbackup/arm-recoveryservicesbackup" +} \ 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 04ca9974b8e0..6ea563464896 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/review/arm-recoveryservicesbackup.api.md +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/review/arm-recoveryservicesbackup.api.md @@ -377,17 +377,18 @@ export type AzureVmWorkloadItemUnion = AzureVmWorkloadItem | AzureVmWorkloadSAPA export interface AzureVmWorkloadProtectableItem extends WorkloadProtectableItem { isAutoProtectable?: boolean; isAutoProtected?: boolean; + isProtectable?: boolean; parentName?: string; parentUniqueName?: string; prebackupvalidation?: PreBackupValidation; - protectableItemType: "AzureVmWorkloadProtectableItem" | "SAPAseSystem" | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" | "SAPHanaHSR" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance"; + protectableItemType: "AzureVmWorkloadProtectableItem" | "SAPAseSystem" | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" | "HanaHSRContainer" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance"; serverName?: string; subinquireditemcount?: number; subprotectableitemcount?: number; } // @public (undocumented) -export type AzureVmWorkloadProtectableItemUnion = AzureVmWorkloadProtectableItem | AzureVmWorkloadSAPAseSystemProtectableItem | AzureVmWorkloadSAPHanaDatabaseProtectableItem | AzureVmWorkloadSAPHanaSystemProtectableItem | AzureVmWorkloadSAPHanaDBInstance | AzureVmWorkloadSAPHanaHSR | AzureVmWorkloadSQLAvailabilityGroupProtectableItem | AzureVmWorkloadSQLDatabaseProtectableItem | AzureVmWorkloadSQLInstanceProtectableItem; +export type AzureVmWorkloadProtectableItemUnion = AzureVmWorkloadProtectableItem | AzureVmWorkloadSAPAseSystemProtectableItem | AzureVmWorkloadSAPHanaDatabaseProtectableItem | AzureVmWorkloadSAPHanaSystemProtectableItem | AzureVmWorkloadSAPHanaDBInstance | AzureVmWorkloadSAPHanaHSRProtectableItem | AzureVmWorkloadSQLAvailabilityGroupProtectableItem | AzureVmWorkloadSQLDatabaseProtectableItem | AzureVmWorkloadSQLInstanceProtectableItem; // @public export interface AzureVmWorkloadProtectedItem extends ProtectedItem { @@ -399,6 +400,7 @@ export interface AzureVmWorkloadProtectedItem extends ProtectedItem { lastBackupErrorDetail?: ErrorDetail; lastBackupStatus?: LastBackupStatus; lastBackupTime?: Date; + nodesList?: DistributedNodesInfo[]; parentName?: string; parentType?: string; protectedItemDataSourceId?: string; @@ -478,8 +480,8 @@ export interface AzureVmWorkloadSAPHanaDBInstanceProtectedItem extends AzureVmWo } // @public -export interface AzureVmWorkloadSAPHanaHSR extends AzureVmWorkloadProtectableItem { - protectableItemType: "SAPHanaHSR"; +export interface AzureVmWorkloadSAPHanaHSRProtectableItem extends AzureVmWorkloadProtectableItem { + protectableItemType: "HanaHSRContainer"; } // @public @@ -494,6 +496,7 @@ export interface AzureVmWorkloadSAPHanaSystemWorkloadItem extends AzureVmWorkloa // @public export interface AzureVmWorkloadSQLAvailabilityGroupProtectableItem extends AzureVmWorkloadProtectableItem { + nodesList?: DistributedNodesInfo[]; protectableItemType: "SQLAvailabilityGroupContainer"; } @@ -1087,6 +1090,7 @@ export interface BackupResourceVaultConfig { isSoftDeleteFeatureStateEditable?: boolean; resourceGuardOperationRequests?: string[]; softDeleteFeatureState?: SoftDeleteFeatureState; + softDeleteRetentionPeriodInDays?: number; storageModelType?: StorageType; storageType?: StorageType; storageTypeState?: StorageTypeState; @@ -1451,6 +1455,7 @@ export interface DiskInformation { export interface DistributedNodesInfo { errorDetail?: ErrorDetail; nodeName?: string; + sourceResourceId?: string; status?: string; } @@ -1852,6 +1857,7 @@ export type InquiryStatus = string; export interface InquiryValidation { readonly additionalDetail?: string; errorDetail?: ErrorDetail; + readonly protectableItemCount?: Record; status?: string; } @@ -2437,6 +2443,7 @@ export enum KnownScheduleRunType { // @public export enum KnownSoftDeleteFeatureState { + AlwaysON = "AlwaysON", Disabled = "Disabled", Enabled = "Enabled", Invalid = "Invalid" @@ -2506,6 +2513,13 @@ export enum KnownValidationStatus { Succeeded = "Succeeded" } +// @public +export enum KnownVaultSubResourceType { + AzureBackup = "AzureBackup", + AzureBackupSecondary = "AzureBackup_secondary", + AzureSiteRecovery = "AzureSiteRecovery" +} + // @public export enum KnownWorkloadItemType { Invalid = "Invalid", @@ -2900,6 +2914,7 @@ export interface PrivateEndpoint { // @public export interface PrivateEndpointConnection { + groupIds?: VaultSubResourceType[]; privateEndpoint?: PrivateEndpoint; privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; provisioningState?: ProvisioningState; @@ -2958,7 +2973,7 @@ export interface PrivateEndpointOperations { // @public export interface PrivateLinkServiceConnectionState { - actionRequired?: string; + actionsRequired?: string; description?: string; status?: PrivateEndpointConnectionStatus; } @@ -3025,7 +3040,7 @@ export interface ProtectedItem { policyName?: string; protectedItemType: "AzureFileShareProtectedItem" | "AzureIaaSVMProtectedItem" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines" | "Microsoft.Sql/servers/databases" | "AzureVmWorkloadProtectedItem" | "AzureVmWorkloadSAPAseDatabase" | "AzureVmWorkloadSAPHanaDatabase" | "AzureVmWorkloadSAPHanaDBInstance" | "AzureVmWorkloadSQLDatabase" | "DPMProtectedItem" | "GenericProtectedItem" | "MabFileFolderProtectedItem"; resourceGuardOperationRequests?: string[]; - softDeleteRetentionPeriod?: number; + softDeleteRetentionPeriodInDays?: number; sourceResourceId?: string; readonly workloadType?: DataSourceType; } @@ -4041,6 +4056,9 @@ export interface VaultStorageConfigOperationResultResponse { // @public (undocumented) export type VaultStorageConfigOperationResultResponseUnion = VaultStorageConfigOperationResultResponse | PrepareDataMoveResponse; +// @public +export type VaultSubResourceType = string; + // @public export interface WeeklyRetentionFormat { daysOfTheWeek?: DayOfWeek[]; @@ -4100,7 +4118,7 @@ export type WorkloadItemUnion = WorkloadItem | AzureVmWorkloadItemUnion; export interface WorkloadProtectableItem { backupManagementType?: string; friendlyName?: string; - protectableItemType: "AzureFileShare" | "IaaSVMProtectableItem" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines" | "AzureVmWorkloadProtectableItem" | "SAPAseSystem" | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" | "SAPHanaHSR" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance"; + protectableItemType: "AzureFileShare" | "IaaSVMProtectableItem" | "Microsoft.ClassicCompute/virtualMachines" | "Microsoft.Compute/virtualMachines" | "AzureVmWorkloadProtectableItem" | "SAPAseSystem" | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" | "HanaHSRContainer" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance"; protectionState?: ProtectionStatus; workloadType?: string; } diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/index.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/index.ts index 599628f304d7..10f305f27b8c 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/index.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/index.ts @@ -168,7 +168,7 @@ export type AzureVmWorkloadProtectableItemUnion = | AzureVmWorkloadSAPHanaDatabaseProtectableItem | AzureVmWorkloadSAPHanaSystemProtectableItem | AzureVmWorkloadSAPHanaDBInstance - | AzureVmWorkloadSAPHanaHSR + | AzureVmWorkloadSAPHanaHSRProtectableItem | AzureVmWorkloadSQLAvailabilityGroupProtectableItem | AzureVmWorkloadSQLDatabaseProtectableItem | AzureVmWorkloadSQLInstanceProtectableItem; @@ -490,9 +490,11 @@ export interface BackupResourceVaultConfig { enhancedSecurityState?: EnhancedSecurityState; /** Soft Delete feature state */ softDeleteFeatureState?: SoftDeleteFeatureState; + /** Soft delete retention period in days */ + softDeleteRetentionPeriodInDays?: number; /** ResourceGuard Operation Requests */ resourceGuardOperationRequests?: string[]; - /** Is soft delete feature state editable */ + /** This flag is no longer in use. Please use 'softDeleteFeatureState' to set the soft delete state for the vault */ isSoftDeleteFeatureStateEditable?: boolean; } @@ -513,6 +515,8 @@ export interface PrivateEndpointConnection { provisioningState?: ProvisioningState; /** Gets or sets private endpoint associated with the private endpoint connection */ privateEndpoint?: PrivateEndpoint; + /** Group Ids for the Private Endpoint */ + groupIds?: VaultSubResourceType[]; /** Gets or sets private link service connection state */ privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; } @@ -530,7 +534,7 @@ export interface PrivateLinkServiceConnectionState { /** Gets or sets description */ description?: string; /** Gets or sets actions required */ - actionRequired?: string; + actionsRequired?: string; } /** An error response from the Container Instance service. */ @@ -699,7 +703,7 @@ export interface ProtectedItem { /** Name of the policy used for protection */ policyName?: string; /** Soft delete retention period in days */ - softDeleteRetentionPeriod?: number; + softDeleteRetentionPeriodInDays?: number; } /** Base class for backup copies. Workload-specific backup copies are derived from this class. */ @@ -974,7 +978,7 @@ export interface WorkloadProtectableItem { | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" - | "SAPHanaHSR" + | "HanaHSRContainer" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance"; @@ -1349,6 +1353,21 @@ export interface AzureVmWorkloadProtectedItemExtendedInfo { recoveryModel?: string; } +/** This is used to represent the various nodes of the distributed container. */ +export interface DistributedNodesInfo { + /** Name of the node under a distributed container. */ + nodeName?: string; + /** + * Status of this Node. + * Failed | Succeeded + */ + status?: string; + /** Error Details if the Status is non-success. */ + errorDetail?: ErrorDetail; + /** ARM resource id of the node */ + sourceResourceId?: string; +} + /** Azure storage specific error information */ export interface AzureWorkloadErrorInfo { /** Error code. */ @@ -1912,19 +1931,11 @@ export interface InquiryValidation { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly additionalDetail?: string; -} - -/** This is used to represent the various nodes of the distributed container. */ -export interface DistributedNodesInfo { - /** Name of the node under a distributed container. */ - nodeName?: string; /** - * Status of this Node. - * Failed | Succeeded + * Dictionary to store the count of ProtectableItems with key POType. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: string; - /** Error Details if the Status is non-success. */ - errorDetail?: ErrorDetail; + readonly protectableItemCount?: Record; } /** Pre-backup validation for Azure VM Workload provider. */ @@ -2508,6 +2519,8 @@ export interface AzureVmWorkloadProtectedItem extends ProtectedItem { extendedInfo?: AzureVmWorkloadProtectedItemExtendedInfo; /** Health details of different KPIs */ kpisHealths?: { [propertyName: string]: KPIResourceHealthDetails }; + /** List of the nodes in case of distributed container. */ + nodesList?: DistributedNodesInfo[]; } /** Additional information on Backup engine specific backup item. */ @@ -3280,7 +3293,7 @@ export interface AzureVmWorkloadProtectableItem | "SAPHanaDatabase" | "SAPHanaSystem" | "SAPHanaDBInstance" - | "SAPHanaHSR" + | "HanaHSRContainer" | "SQLAvailabilityGroupContainer" | "SQLDataBase" | "SQLInstance"; @@ -3303,6 +3316,8 @@ export interface AzureVmWorkloadProtectableItem subprotectableitemcount?: number; /** Pre-backup validation for protectable objects */ prebackupvalidation?: PreBackupValidation; + /** Indicates if item is protectable */ + isProtectable?: boolean; } /** Azure IaaS VM workload-specific Health Details. */ @@ -3633,11 +3648,11 @@ export interface AzureVmWorkloadSAPHanaDBInstance protectableItemType: "SAPHanaDBInstance"; } -/** Azure VM workload-specific protectable item representing SAP HANA Dbinstance. */ -export interface AzureVmWorkloadSAPHanaHSR +/** Azure VM workload-specific protectable item representing HANA HSR. */ +export interface AzureVmWorkloadSAPHanaHSRProtectableItem extends AzureVmWorkloadProtectableItem { /** Polymorphic discriminator, which specifies the different types this object can be */ - protectableItemType: "SAPHanaHSR"; + protectableItemType: "HanaHSRContainer"; } /** Azure VM workload-specific protectable item representing SQL Availability Group. */ @@ -3645,6 +3660,8 @@ export interface AzureVmWorkloadSQLAvailabilityGroupProtectableItem extends AzureVmWorkloadProtectableItem { /** Polymorphic discriminator, which specifies the different types this object can be */ protectableItemType: "SQLAvailabilityGroupContainer"; + /** List of the nodes in case of distributed container. */ + nodesList?: DistributedNodesInfo[]; } /** Azure VM workload-specific protectable item representing SQL Database. */ @@ -4114,7 +4131,9 @@ export enum KnownSoftDeleteFeatureState { /** Enabled */ Enabled = "Enabled", /** Disabled */ - Disabled = "Disabled" + Disabled = "Disabled", + /** AlwaysON */ + AlwaysON = "AlwaysON" } /** @@ -4124,7 +4143,8 @@ export enum KnownSoftDeleteFeatureState { * ### Known values supported by the service * **Invalid** \ * **Enabled** \ - * **Disabled** + * **Disabled** \ + * **AlwaysON** */ export type SoftDeleteFeatureState = string; @@ -4230,6 +4250,27 @@ export enum KnownProvisioningState { */ export type ProvisioningState = string; +/** Known values of {@link VaultSubResourceType} that the service accepts. */ +export enum KnownVaultSubResourceType { + /** AzureBackup */ + AzureBackup = "AzureBackup", + /** AzureBackupSecondary */ + AzureBackupSecondary = "AzureBackup_secondary", + /** AzureSiteRecovery */ + AzureSiteRecovery = "AzureSiteRecovery" +} + +/** + * Defines values for VaultSubResourceType. \ + * {@link KnownVaultSubResourceType} can be used interchangeably with VaultSubResourceType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AzureBackup** \ + * **AzureBackup_secondary** \ + * **AzureSiteRecovery** + */ +export type VaultSubResourceType = string; + /** Known values of {@link PrivateEndpointConnectionStatus} that the service accepts. */ export enum KnownPrivateEndpointConnectionStatus { /** Pending */ diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/mappers.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/mappers.ts index 64e597009710..11e617379f2a 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/mappers.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/mappers.ts @@ -750,6 +750,12 @@ export const BackupResourceVaultConfig: coreClient.CompositeMapper = { name: "String" } }, + softDeleteRetentionPeriodInDays: { + serializedName: "softDeleteRetentionPeriodInDays", + type: { + name: "Number" + } + }, resourceGuardOperationRequests: { serializedName: "resourceGuardOperationRequests", type: { @@ -828,6 +834,17 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { className: "PrivateEndpoint" } }, + groupIds: { + serializedName: "groupIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, privateLinkServiceConnectionState: { serializedName: "privateLinkServiceConnectionState", type: { @@ -871,8 +888,8 @@ export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { name: "String" } }, - actionRequired: { - serializedName: "actionRequired", + actionsRequired: { + serializedName: "actionsRequired", type: { name: "String" } @@ -1290,8 +1307,8 @@ export const ProtectedItem: coreClient.CompositeMapper = { name: "String" } }, - softDeleteRetentionPeriod: { - serializedName: "softDeleteRetentionPeriod", + softDeleteRetentionPeriodInDays: { + serializedName: "softDeleteRetentionPeriodInDays", type: { name: "Number" } @@ -3000,6 +3017,40 @@ export const AzureVmWorkloadProtectedItemExtendedInfo: coreClient.CompositeMappe } }; +export const DistributedNodesInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DistributedNodesInfo", + modelProperties: { + nodeName: { + serializedName: "nodeName", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + errorDetail: { + serializedName: "errorDetail", + type: { + name: "Composite", + className: "ErrorDetail" + } + }, + sourceResourceId: { + serializedName: "sourceResourceId", + type: { + name: "String" + } + } + } + } +}; + export const AzureWorkloadErrorInfo: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4680,33 +4731,13 @@ export const InquiryValidation: coreClient.CompositeMapper = { type: { name: "String" } - } - } - } -}; - -export const DistributedNodesInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DistributedNodesInfo", - modelProperties: { - nodeName: { - serializedName: "nodeName", - type: { - name: "String" - } - }, - status: { - serializedName: "status", - type: { - name: "String" - } }, - errorDetail: { - serializedName: "errorDetail", + protectableItemCount: { + serializedName: "protectableItemCount", + readOnly: true, type: { - name: "Composite", - className: "ErrorDetail" + name: "Dictionary", + value: { type: { name: "any" } } } } } @@ -6296,6 +6327,18 @@ export const AzureVmWorkloadProtectedItem: coreClient.CompositeMapper = { type: { name: "Composite", className: "KPIResourceHealthDetails" } } } + }, + nodesList: { + serializedName: "nodesList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DistributedNodesInfo" + } + } + } } } } @@ -8440,6 +8483,12 @@ export const AzureVmWorkloadProtectableItem: coreClient.CompositeMapper = { name: "Composite", className: "PreBackupValidation" } + }, + isProtectable: { + serializedName: "isProtectable", + type: { + name: "Boolean" + } } } } @@ -9178,11 +9227,11 @@ export const AzureVmWorkloadSAPHanaDBInstance: coreClient.CompositeMapper = { } }; -export const AzureVmWorkloadSAPHanaHSR: coreClient.CompositeMapper = { - serializedName: "SAPHanaHSR", +export const AzureVmWorkloadSAPHanaHSRProtectableItem: coreClient.CompositeMapper = { + serializedName: "HanaHSRContainer", type: { name: "Composite", - className: "AzureVmWorkloadSAPHanaHSR", + className: "AzureVmWorkloadSAPHanaHSRProtectableItem", uberParent: "AzureVmWorkloadProtectableItem", polymorphicDiscriminator: AzureVmWorkloadProtectableItem.type.polymorphicDiscriminator, @@ -9201,7 +9250,19 @@ export const AzureVmWorkloadSQLAvailabilityGroupProtectableItem: coreClient.Comp polymorphicDiscriminator: AzureVmWorkloadProtectableItem.type.polymorphicDiscriminator, modelProperties: { - ...AzureVmWorkloadProtectableItem.type.modelProperties + ...AzureVmWorkloadProtectableItem.type.modelProperties, + nodesList: { + serializedName: "nodesList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DistributedNodesInfo" + } + } + } + } } } }; @@ -9542,7 +9603,7 @@ export let discriminators = { "AzureVmWorkloadProtectableItem.SAPHanaDatabase": AzureVmWorkloadSAPHanaDatabaseProtectableItem, "AzureVmWorkloadProtectableItem.SAPHanaSystem": AzureVmWorkloadSAPHanaSystemProtectableItem, "AzureVmWorkloadProtectableItem.SAPHanaDBInstance": AzureVmWorkloadSAPHanaDBInstance, - "AzureVmWorkloadProtectableItem.SAPHanaHSR": AzureVmWorkloadSAPHanaHSR, + "AzureVmWorkloadProtectableItem.HanaHSRContainer": AzureVmWorkloadSAPHanaHSRProtectableItem, "AzureVmWorkloadProtectableItem.SQLAvailabilityGroupContainer": AzureVmWorkloadSQLAvailabilityGroupProtectableItem, "AzureVmWorkloadProtectableItem.SQLDataBase": AzureVmWorkloadSQLDatabaseProtectableItem, "AzureVmWorkloadProtectableItem.SQLInstance": AzureVmWorkloadSQLInstanceProtectableItem, diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/parameters.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/parameters.ts index 20f56c8be745..1b3b73496e03 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/parameters.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/models/parameters.ts @@ -63,7 +63,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-02-01", + defaultValue: "2023-04-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/recoveryServicesBackupClient.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/recoveryServicesBackupClient.ts index ba8b326f1adb..89fedab880d2 100644 --- a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/recoveryServicesBackupClient.ts +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/src/recoveryServicesBackupClient.ts @@ -168,7 +168,7 @@ export class RecoveryServicesBackupClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-recoveryservicesbackup/10.1.1`; + const packageDetails = `azsdk-js-arm-recoveryservicesbackup/11.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -221,7 +221,7 @@ export class RecoveryServicesBackupClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-02-01"; + this.apiVersion = options.apiVersion || "2023-04-01"; this.backupResourceStorageConfigsNonCRR = new BackupResourceStorageConfigsNonCRRImpl( this ); diff --git a/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/test/sampleTest.ts b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/recoveryservicesbackup/arm-recoveryservicesbackup/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +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(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); 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"