diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7e6cff6b6145..a6fee95a968f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2879,7 +2879,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.6: @@ -3118,7 +3118,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: @@ -3260,7 +3260,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: @@ -3404,7 +3404,7 @@ packages: dev: false /concat-map/0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: false /concurrently/6.5.1: @@ -3465,7 +3465,7 @@ packages: dev: false /cookie-signature/1.0.6: - resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} dev: false /cookie/0.4.2: @@ -3560,7 +3560,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.3: @@ -3803,11 +3803,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.284: @@ -4667,7 +4667,7 @@ packages: dev: false /fresh/0.5.2: - resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=} + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} dev: false @@ -4803,7 +4803,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: @@ -6120,7 +6120,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 @@ -6130,7 +6130,7 @@ packages: dev: false /merge-descriptors/1.0.1: - resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=} + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} dev: false /merge-stream/2.0.0: @@ -6477,7 +6477,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 @@ -8600,7 +8600,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 @@ -13568,28 +13568,30 @@ packages: dev: false file:projects/arm-recoveryservices-siterecovery.tgz: - resolution: {integrity: sha512-OMD3ghzpcA4UhqCKXTEoG6liATiq2Nu9YNLRW/KrslIhzHcXfxbNdNWjnWacgiWydGDHJ2ly1I0cnevipRNsBA==, tarball: file:projects/arm-recoveryservices-siterecovery.tgz} + resolution: {integrity: sha512-372llRwsqzWIJejFJ6Z6pQ2QUzAIG7SUInqHtZ0NRMS0o5sg7TRbw37pmiXmFcfIze6WQ/W0wHutXhgu+5tkTw==, tarball: file:projects/arm-recoveryservices-siterecovery.tgz} name: '@rush-temp/arm-recoveryservices-siterecovery' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.33.6 - '@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 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.4 + '@types/node': 14.18.33 + chai: 4.3.7 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 1.32.1 - rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + rollup: 2.79.1 + rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - - encoding - supports-color dev: false diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/CHANGELOG.md b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/CHANGELOG.md index 26d2af4b7cc0..6caa8c33d2ae 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/CHANGELOG.md +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/CHANGELOG.md @@ -1,5 +1,468 @@ # Release History +## 5.0.0 (2022-12-08) + +**Features** + + - Added operation ReplicationMigrationItems.beginPauseReplication + - Added operation ReplicationMigrationItems.beginPauseReplicationAndWait + - Added operation ReplicationMigrationItems.beginResumeReplication + - Added operation ReplicationMigrationItems.beginResumeReplicationAndWait + - Added Interface A2AAddDisksInput + - Added Interface A2AApplyRecoveryPointInput + - Added Interface A2AContainerCreationInput + - Added Interface A2AContainerMappingInput + - Added Interface A2ACreateProtectionIntentInput + - Added Interface A2ACrossClusterMigrationApplyRecoveryPointInput + - Added Interface A2ACrossClusterMigrationContainerCreationInput + - Added Interface A2ACrossClusterMigrationEnableProtectionInput + - Added Interface A2ACrossClusterMigrationPolicyCreationInput + - Added Interface A2ACrossClusterMigrationReplicationDetails + - Added Interface A2AEnableProtectionInput + - Added Interface A2AEventDetails + - Added Interface A2AExtendedLocationDetails + - Added Interface A2APolicyCreationInput + - Added Interface A2APolicyDetails + - Added Interface A2AProtectionContainerMappingDetails + - Added Interface A2ARecoveryPointDetails + - Added Interface A2ARemoveDisksInput + - Added Interface A2AReplicationDetails + - Added Interface A2AReplicationIntentDetails + - Added Interface A2AReprotectInput + - Added Interface A2ASwitchProtectionInput + - Added Interface A2ATestFailoverInput + - Added Interface A2AUnplannedFailoverInput + - Added Interface A2AUpdateContainerMappingInput + - Added Interface A2AUpdateReplicationProtectedItemInput + - Added Interface Alert + - Added Interface AsrJobDetails + - Added Interface AutomationRunbookTaskDetails + - Added Interface AzureFabricCreationInput + - Added Interface AzureFabricSpecificDetails + - Added Interface AzureToAzureCreateNetworkMappingInput + - Added Interface AzureToAzureNetworkMappingSettings + - Added Interface AzureToAzureUpdateNetworkMappingInput + - Added Interface ConsistencyCheckTaskDetails + - Added Interface CriticalJobHistoryDetails + - Added Interface Event_2 + - Added Interface ExistingProtectionProfile + - Added Interface ExistingRecoveryAvailabilitySet + - Added Interface ExistingRecoveryProximityPlacementGroup + - Added Interface ExistingRecoveryResourceGroup + - Added Interface ExistingRecoveryVirtualNetwork + - Added Interface ExistingStorageAccount + - Added Interface ExportJobDetails + - Added Interface Fabric + - Added Interface FabricReplicationGroupTaskDetails + - Added Interface FailoverJobDetails + - Added Interface HyperVReplica2012EventDetails + - Added Interface HyperVReplica2012R2EventDetails + - Added Interface HyperVReplicaAzureApplyRecoveryPointInput + - Added Interface HyperVReplicaAzureEnableProtectionInput + - Added Interface HyperVReplicaAzureEventDetails + - Added Interface HyperVReplicaAzureFailbackProviderInput + - Added Interface HyperVReplicaAzurePlannedFailoverProviderInput + - Added Interface HyperVReplicaAzurePolicyDetails + - Added Interface HyperVReplicaAzurePolicyInput + - Added Interface HyperVReplicaAzureReplicationDetails + - Added Interface HyperVReplicaAzureReprotectInput + - Added Interface HyperVReplicaAzureTestFailoverInput + - Added Interface HyperVReplicaAzureUnplannedFailoverInput + - Added Interface HyperVReplicaAzureUpdateReplicationProtectedItemInput + - Added Interface HyperVReplicaBaseEventDetails + - Added Interface HyperVReplicaBasePolicyDetails + - Added Interface HyperVReplicaBaseReplicationDetails + - Added Interface HyperVReplicaBluePolicyDetails + - Added Interface HyperVReplicaBluePolicyInput + - Added Interface HyperVReplicaBlueReplicationDetails + - Added Interface HyperVReplicaPolicyDetails + - Added Interface HyperVReplicaPolicyInput + - Added Interface HyperVReplicaReplicationDetails + - Added Interface HyperVSiteDetails + - Added Interface HyperVVirtualMachineDetails + - Added Interface InlineWorkflowTaskDetails + - Added Interface InMageAzureV2ApplyRecoveryPointInput + - Added Interface InMageAzureV2EnableProtectionInput + - Added Interface InMageAzureV2EventDetails + - Added Interface InMageAzureV2PolicyDetails + - Added Interface InMageAzureV2PolicyInput + - Added Interface InMageAzureV2RecoveryPointDetails + - Added Interface InMageAzureV2ReplicationDetails + - Added Interface InMageAzureV2ReprotectInput + - Added Interface InMageAzureV2SwitchProviderInput + - Added Interface InMageAzureV2TestFailoverInput + - Added Interface InMageAzureV2UnplannedFailoverInput + - Added Interface InMageAzureV2UpdateReplicationProtectedItemInput + - Added Interface InMageBasePolicyDetails + - Added Interface InMageDisableProtectionProviderSpecificInput + - Added Interface InMageEnableProtectionInput + - Added Interface InMagePolicyDetails + - Added Interface InMagePolicyInput + - Added Interface InMageRcmApplianceSpecificDetails + - Added Interface InMageRcmApplyRecoveryPointInput + - Added Interface InMageRcmEnableProtectionInput + - Added Interface InMageRcmEventDetails + - Added Interface InMageRcmFabricCreationInput + - Added Interface InMageRcmFabricSpecificDetails + - Added Interface InMageRcmFailbackEventDetails + - Added Interface InMageRcmFailbackPlannedFailoverProviderInput + - Added Interface InMageRcmFailbackPolicyCreationInput + - Added Interface InMageRcmFailbackPolicyDetails + - Added Interface InMageRcmFailbackReplicationDetails + - Added Interface InMageRcmFailbackReprotectInput + - Added Interface InMageRcmPolicyCreationInput + - Added Interface InMageRcmPolicyDetails + - Added Interface InMageRcmProtectionContainerMappingDetails + - Added Interface InMageRcmRecoveryPointDetails + - Added Interface InMageRcmReplicationDetails + - Added Interface InMageRcmReprotectInput + - Added Interface InMageRcmTestFailoverInput + - Added Interface InMageRcmUnplannedFailoverInput + - Added Interface InMageRcmUpdateApplianceForReplicationProtectedItemInput + - Added Interface InMageRcmUpdateContainerMappingInput + - Added Interface InMageRcmUpdateReplicationProtectedItemInput + - Added Interface InMageReplicationDetails + - Added Interface InMageReprotectInput + - Added Interface InMageTestFailoverInput + - Added Interface InMageUnplannedFailoverInput + - Added Interface Job + - Added Interface JobStatusEventDetails + - Added Interface JobTaskDetails + - Added Interface LogicalNetwork + - Added Interface ManualActionTaskDetails + - Added Interface MigrationItem + - Added Interface MigrationRecoveryPoint + - Added Interface Network + - Added Interface NetworkMapping + - Added Interface NewProtectionProfile + - Added Interface NewRecoveryVirtualNetwork + - Added Interface PauseReplicationInput + - Added Interface PauseReplicationInputProperties + - Added Interface Policy + - Added Interface ProtectableItem + - Added Interface ProtectionContainer + - Added Interface ProtectionContainerMapping + - Added Interface RecoveryPlan + - Added Interface RecoveryPlanA2ADetails + - Added Interface RecoveryPlanA2AFailoverInput + - Added Interface RecoveryPlanA2AInput + - Added Interface RecoveryPlanAutomationRunbookActionDetails + - Added Interface RecoveryPlanGroupTaskDetails + - Added Interface RecoveryPlanHyperVReplicaAzureFailbackInput + - Added Interface RecoveryPlanHyperVReplicaAzureFailoverInput + - Added Interface RecoveryPlanInMageAzureV2FailoverInput + - Added Interface RecoveryPlanInMageFailoverInput + - Added Interface RecoveryPlanInMageRcmFailbackFailoverInput + - Added Interface RecoveryPlanInMageRcmFailoverInput + - Added Interface RecoveryPlanManualActionDetails + - Added Interface RecoveryPlanScriptActionDetails + - Added Interface RecoveryPlanShutdownGroupTaskDetails + - Added Interface RecoveryPoint + - Added Interface RecoveryServicesProvider + - Added Interface ReplicationGroupDetails + - Added Interface ReplicationMigrationItemsPauseReplicationOptionalParams + - Added Interface ReplicationMigrationItemsResumeReplicationOptionalParams + - Added Interface ReplicationProtectedItem + - Added Interface ReplicationProtectedItemsUpdateMobilityServiceHeaders + - Added Interface ReplicationProtectionIntent + - Added Interface ResumeReplicationInput + - Added Interface ResumeReplicationInputProperties + - Added Interface ResumeReplicationProviderSpecificInput + - Added Interface ScriptActionTaskDetails + - Added Interface StorageClassification + - Added Interface StorageClassificationMapping + - Added Interface SupportedOperatingSystems + - Added Interface SwitchProtectionJobDetails + - Added Interface TestFailoverJobDetails + - Added Interface VaultHealthDetails + - Added Interface VaultSetting + - Added Interface VCenter + - Added Interface VirtualMachineTaskDetails + - Added Interface VmmDetails + - Added Interface VmmToAzureCreateNetworkMappingInput + - Added Interface VmmToAzureNetworkMappingSettings + - Added Interface VmmToAzureUpdateNetworkMappingInput + - Added Interface VmmToVmmCreateNetworkMappingInput + - Added Interface VmmToVmmNetworkMappingSettings + - Added Interface VmmToVmmUpdateNetworkMappingInput + - Added Interface VmmVirtualMachineDetails + - Added Interface VmNicUpdatesTaskDetails + - Added Interface VMwareCbtContainerCreationInput + - Added Interface VMwareCbtContainerMappingInput + - Added Interface VMwareCbtEnableMigrationInput + - Added Interface VMwareCbtEventDetails + - Added Interface VMwareCbtMigrateInput + - Added Interface VMwareCbtMigrationDetails + - Added Interface VMwareCbtPolicyCreationInput + - Added Interface VmwareCbtPolicyDetails + - Added Interface VMwareCbtProtectionContainerMappingDetails + - Added Interface VMwareCbtResumeReplicationInput + - Added Interface VMwareCbtResyncInput + - Added Interface VMwareCbtTestMigrateInput + - Added Interface VMwareCbtUpdateMigrationItemInput + - Added Interface VMwareDetails + - Added Interface VMwareV2FabricCreationInput + - Added Interface VMwareV2FabricSpecificDetails + - Added Interface VMwareVirtualMachineDetails + - Added Type Alias ReplicationMigrationItemsPauseReplicationResponse + - Added Type Alias ReplicationMigrationItemsResumeReplicationResponse + - Added Type Alias ResumeReplicationProviderSpecificInputUnion + - Interface InMageRcmProtectedDiskDetails has a new optional parameter seedBlobUri + - Interface MigrationItemProperties has a new optional parameter criticalJobHistory + - Interface MigrationItemProperties has a new optional parameter lastMigrationStatus + - Interface MigrationItemProperties has a new optional parameter lastMigrationTime + - Interface MigrationItemProperties has a new optional parameter recoveryServicesProviderId + - Interface MigrationItemProperties has a new optional parameter replicationStatus + - Interface VMwareCbtNicDetails has a new optional parameter testIPAddress + - Interface VMwareCbtNicDetails has a new optional parameter testIPAddressType + - Interface VMwareCbtNicDetails has a new optional parameter testNetworkId + - Interface VMwareCbtNicDetails has a new optional parameter testSubnetName + - Interface VMwareCbtNicInput has a new optional parameter testStaticIPAddress + - Interface VMwareCbtNicInput has a new optional parameter testSubnetName + - Interface VMwareCbtProtectedDiskDetails has a new optional parameter seedBlobUri + - Interface VMwareCbtProtectedDiskDetails has a new optional parameter targetBlobUri + - Interface VMwareCbtUpdateDiskInput has a new optional parameter isOSDisk + - Enum KnownMigrationItemOperation has a new value PauseReplication + - Enum KnownMigrationItemOperation has a new value ResumeReplication + - Enum KnownMigrationState has a new value MigrationCompletedWithInformation + - Enum KnownMigrationState has a new value MigrationPartiallySucceeded + - Enum KnownMigrationState has a new value ProtectionSuspended + - Enum KnownMigrationState has a new value ResumeInitiated + - Enum KnownMigrationState has a new value ResumeInProgress + - Enum KnownMigrationState has a new value SuspendingProtection + - Enum KnownTestMigrationState has a new value TestMigrationCompletedWithInformation + - Enum KnownTestMigrationState has a new value TestMigrationPartiallySucceeded + +**Breaking Changes** + + - Operation MigrationRecoveryPoints.get has a new signature + - Operation MigrationRecoveryPoints.listByReplicationMigrationItems has a new signature + - Operation Operations.list has a new signature + - Operation RecoveryPoints.get has a new signature + - Operation RecoveryPoints.listByReplicationProtectedItems has a new signature + - Operation ReplicationAlertSettings.create has a new signature + - Operation ReplicationAlertSettings.get has a new signature + - Operation ReplicationAlertSettings.list has a new signature + - Operation ReplicationAppliances.list has a new signature + - Operation ReplicationEligibilityResultsOperations.get has a new signature + - Operation ReplicationEligibilityResultsOperations.list has a new signature + - Operation ReplicationEvents.get has a new signature + - Operation ReplicationEvents.list has a new signature + - Operation ReplicationFabrics.beginCheckConsistency has a new signature + - Operation ReplicationFabrics.beginCheckConsistencyAndWait has a new signature + - Operation ReplicationFabrics.beginCreate has a new signature + - Operation ReplicationFabrics.beginCreateAndWait has a new signature + - Operation ReplicationFabrics.beginDelete has a new signature + - Operation ReplicationFabrics.beginDeleteAndWait has a new signature + - Operation ReplicationFabrics.beginMigrateToAad has a new signature + - Operation ReplicationFabrics.beginMigrateToAadAndWait has a new signature + - Operation ReplicationFabrics.beginPurge has a new signature + - Operation ReplicationFabrics.beginPurgeAndWait has a new signature + - Operation ReplicationFabrics.beginReassociateGateway has a new signature + - Operation ReplicationFabrics.beginReassociateGatewayAndWait has a new signature + - Operation ReplicationFabrics.beginRenewCertificate has a new signature + - Operation ReplicationFabrics.beginRenewCertificateAndWait has a new signature + - Operation ReplicationFabrics.get has a new signature + - Operation ReplicationFabrics.list has a new signature + - Operation ReplicationJobs.beginCancel has a new signature + - Operation ReplicationJobs.beginCancelAndWait has a new signature + - Operation ReplicationJobs.beginExport has a new signature + - Operation ReplicationJobs.beginExportAndWait has a new signature + - Operation ReplicationJobs.beginRestart has a new signature + - Operation ReplicationJobs.beginRestartAndWait has a new signature + - Operation ReplicationJobs.beginResume has a new signature + - Operation ReplicationJobs.beginResumeAndWait has a new signature + - Operation ReplicationJobs.get has a new signature + - Operation ReplicationJobs.list has a new signature + - Operation ReplicationLogicalNetworks.get has a new signature + - Operation ReplicationLogicalNetworks.listByReplicationFabrics has a new signature + - Operation ReplicationMigrationItems.beginCreate has a new signature + - Operation ReplicationMigrationItems.beginCreateAndWait has a new signature + - Operation ReplicationMigrationItems.beginDelete has a new signature + - Operation ReplicationMigrationItems.beginDeleteAndWait has a new signature + - Operation ReplicationMigrationItems.beginMigrate has a new signature + - Operation ReplicationMigrationItems.beginMigrateAndWait has a new signature + - Operation ReplicationMigrationItems.beginResync has a new signature + - Operation ReplicationMigrationItems.beginResyncAndWait has a new signature + - Operation ReplicationMigrationItems.beginTestMigrate has a new signature + - Operation ReplicationMigrationItems.beginTestMigrateAndWait has a new signature + - Operation ReplicationMigrationItems.beginTestMigrateCleanup has a new signature + - Operation ReplicationMigrationItems.beginTestMigrateCleanupAndWait has a new signature + - Operation ReplicationMigrationItems.beginUpdate has a new signature + - Operation ReplicationMigrationItems.beginUpdateAndWait has a new signature + - Operation ReplicationMigrationItems.get has a new signature + - Operation ReplicationMigrationItems.list has a new signature + - Operation ReplicationMigrationItems.listByReplicationProtectionContainers has a new signature + - Operation ReplicationNetworkMappings.beginCreate has a new signature + - Operation ReplicationNetworkMappings.beginCreateAndWait has a new signature + - Operation ReplicationNetworkMappings.beginDelete has a new signature + - Operation ReplicationNetworkMappings.beginDeleteAndWait has a new signature + - Operation ReplicationNetworkMappings.beginUpdate has a new signature + - Operation ReplicationNetworkMappings.beginUpdateAndWait has a new signature + - Operation ReplicationNetworkMappings.get has a new signature + - Operation ReplicationNetworkMappings.list has a new signature + - Operation ReplicationNetworkMappings.listByReplicationNetworks has a new signature + - Operation ReplicationNetworks.get has a new signature + - Operation ReplicationNetworks.list has a new signature + - Operation ReplicationNetworks.listByReplicationFabrics has a new signature + - Operation ReplicationPolicies.beginCreate has a new signature + - Operation ReplicationPolicies.beginCreateAndWait has a new signature + - Operation ReplicationPolicies.beginDelete has a new signature + - Operation ReplicationPolicies.beginDeleteAndWait has a new signature + - Operation ReplicationPolicies.beginUpdate has a new signature + - Operation ReplicationPolicies.beginUpdateAndWait has a new signature + - Operation ReplicationPolicies.get has a new signature + - Operation ReplicationPolicies.list has a new signature + - Operation ReplicationProtectableItems.get has a new signature + - Operation ReplicationProtectableItems.listByReplicationProtectionContainers has a new signature + - Operation ReplicationProtectedItems.beginAddDisks has a new signature + - Operation ReplicationProtectedItems.beginAddDisksAndWait has a new signature + - Operation ReplicationProtectedItems.beginApplyRecoveryPoint has a new signature + - Operation ReplicationProtectedItems.beginApplyRecoveryPointAndWait has a new signature + - Operation ReplicationProtectedItems.beginCreate has a new signature + - Operation ReplicationProtectedItems.beginCreateAndWait has a new signature + - Operation ReplicationProtectedItems.beginDelete has a new signature + - Operation ReplicationProtectedItems.beginDeleteAndWait has a new signature + - Operation ReplicationProtectedItems.beginFailoverCancel has a new signature + - Operation ReplicationProtectedItems.beginFailoverCancelAndWait has a new signature + - Operation ReplicationProtectedItems.beginFailoverCommit has a new signature + - Operation ReplicationProtectedItems.beginFailoverCommitAndWait has a new signature + - Operation ReplicationProtectedItems.beginPlannedFailover has a new signature + - Operation ReplicationProtectedItems.beginPlannedFailoverAndWait has a new signature + - Operation ReplicationProtectedItems.beginPurge has a new signature + - Operation ReplicationProtectedItems.beginPurgeAndWait has a new signature + - Operation ReplicationProtectedItems.beginRemoveDisks has a new signature + - Operation ReplicationProtectedItems.beginRemoveDisksAndWait has a new signature + - Operation ReplicationProtectedItems.beginRepairReplication has a new signature + - Operation ReplicationProtectedItems.beginRepairReplicationAndWait has a new signature + - Operation ReplicationProtectedItems.beginReprotect has a new signature + - Operation ReplicationProtectedItems.beginReprotectAndWait has a new signature + - Operation ReplicationProtectedItems.beginResolveHealthErrors has a new signature + - Operation ReplicationProtectedItems.beginResolveHealthErrorsAndWait has a new signature + - Operation ReplicationProtectedItems.beginSwitchProvider has a new signature + - Operation ReplicationProtectedItems.beginSwitchProviderAndWait has a new signature + - Operation ReplicationProtectedItems.beginTestFailover has a new signature + - Operation ReplicationProtectedItems.beginTestFailoverAndWait has a new signature + - Operation ReplicationProtectedItems.beginTestFailoverCleanup has a new signature + - Operation ReplicationProtectedItems.beginTestFailoverCleanupAndWait has a new signature + - Operation ReplicationProtectedItems.beginUnplannedFailover has a new signature + - Operation ReplicationProtectedItems.beginUnplannedFailoverAndWait has a new signature + - Operation ReplicationProtectedItems.beginUpdate has a new signature + - Operation ReplicationProtectedItems.beginUpdateAndWait has a new signature + - Operation ReplicationProtectedItems.beginUpdateAppliance has a new signature + - Operation ReplicationProtectedItems.beginUpdateApplianceAndWait has a new signature + - Operation ReplicationProtectedItems.beginUpdateMobilityService has a new signature + - Operation ReplicationProtectedItems.beginUpdateMobilityServiceAndWait has a new signature + - Operation ReplicationProtectedItems.get has a new signature + - Operation ReplicationProtectedItems.list has a new signature + - Operation ReplicationProtectedItems.listByReplicationProtectionContainers has a new signature + - Operation ReplicationProtectionContainerMappings.beginCreate has a new signature + - Operation ReplicationProtectionContainerMappings.beginCreateAndWait has a new signature + - Operation ReplicationProtectionContainerMappings.beginDelete has a new signature + - Operation ReplicationProtectionContainerMappings.beginDeleteAndWait has a new signature + - Operation ReplicationProtectionContainerMappings.beginPurge has a new signature + - Operation ReplicationProtectionContainerMappings.beginPurgeAndWait has a new signature + - Operation ReplicationProtectionContainerMappings.beginUpdate has a new signature + - Operation ReplicationProtectionContainerMappings.beginUpdateAndWait has a new signature + - Operation ReplicationProtectionContainerMappings.get has a new signature + - Operation ReplicationProtectionContainerMappings.list has a new signature + - Operation ReplicationProtectionContainerMappings.listByReplicationProtectionContainers has a new signature + - Operation ReplicationProtectionContainers.beginCreate has a new signature + - Operation ReplicationProtectionContainers.beginCreateAndWait has a new signature + - Operation ReplicationProtectionContainers.beginDelete has a new signature + - Operation ReplicationProtectionContainers.beginDeleteAndWait has a new signature + - Operation ReplicationProtectionContainers.beginDiscoverProtectableItem has a new signature + - Operation ReplicationProtectionContainers.beginDiscoverProtectableItemAndWait has a new signature + - Operation ReplicationProtectionContainers.beginSwitchProtection has a new signature + - Operation ReplicationProtectionContainers.beginSwitchProtectionAndWait has a new signature + - Operation ReplicationProtectionContainers.get has a new signature + - Operation ReplicationProtectionContainers.list has a new signature + - Operation ReplicationProtectionContainers.listByReplicationFabrics has a new signature + - Operation ReplicationProtectionIntents.create has a new signature + - Operation ReplicationProtectionIntents.get has a new signature + - Operation ReplicationProtectionIntents.list has a new signature + - Operation ReplicationRecoveryPlans.beginCreate has a new signature + - Operation ReplicationRecoveryPlans.beginCreateAndWait has a new signature + - Operation ReplicationRecoveryPlans.beginDelete has a new signature + - Operation ReplicationRecoveryPlans.beginDeleteAndWait has a new signature + - Operation ReplicationRecoveryPlans.beginFailoverCancel has a new signature + - Operation ReplicationRecoveryPlans.beginFailoverCancelAndWait has a new signature + - Operation ReplicationRecoveryPlans.beginFailoverCommit has a new signature + - Operation ReplicationRecoveryPlans.beginFailoverCommitAndWait has a new signature + - Operation ReplicationRecoveryPlans.beginPlannedFailover has a new signature + - Operation ReplicationRecoveryPlans.beginPlannedFailoverAndWait has a new signature + - Operation ReplicationRecoveryPlans.beginReprotect has a new signature + - Operation ReplicationRecoveryPlans.beginReprotectAndWait has a new signature + - Operation ReplicationRecoveryPlans.beginTestFailover has a new signature + - Operation ReplicationRecoveryPlans.beginTestFailoverAndWait has a new signature + - Operation ReplicationRecoveryPlans.beginTestFailoverCleanup has a new signature + - Operation ReplicationRecoveryPlans.beginTestFailoverCleanupAndWait has a new signature + - Operation ReplicationRecoveryPlans.beginUnplannedFailover has a new signature + - Operation ReplicationRecoveryPlans.beginUnplannedFailoverAndWait has a new signature + - Operation ReplicationRecoveryPlans.beginUpdate has a new signature + - Operation ReplicationRecoveryPlans.beginUpdateAndWait has a new signature + - Operation ReplicationRecoveryPlans.get has a new signature + - Operation ReplicationRecoveryPlans.list has a new signature + - Operation ReplicationRecoveryServicesProviders.beginCreate has a new signature + - Operation ReplicationRecoveryServicesProviders.beginCreateAndWait has a new signature + - Operation ReplicationRecoveryServicesProviders.beginDelete has a new signature + - Operation ReplicationRecoveryServicesProviders.beginDeleteAndWait has a new signature + - Operation ReplicationRecoveryServicesProviders.beginPurge has a new signature + - Operation ReplicationRecoveryServicesProviders.beginPurgeAndWait has a new signature + - Operation ReplicationRecoveryServicesProviders.beginRefreshProvider has a new signature + - Operation ReplicationRecoveryServicesProviders.beginRefreshProviderAndWait has a new signature + - Operation ReplicationRecoveryServicesProviders.get has a new signature + - Operation ReplicationRecoveryServicesProviders.list has a new signature + - Operation ReplicationRecoveryServicesProviders.listByReplicationFabrics has a new signature + - Operation ReplicationStorageClassificationMappings.beginCreate has a new signature + - Operation ReplicationStorageClassificationMappings.beginCreateAndWait has a new signature + - Operation ReplicationStorageClassificationMappings.beginDelete has a new signature + - Operation ReplicationStorageClassificationMappings.beginDeleteAndWait has a new signature + - Operation ReplicationStorageClassificationMappings.get has a new signature + - Operation ReplicationStorageClassificationMappings.list has a new signature + - Operation ReplicationStorageClassificationMappings.listByReplicationStorageClassifications has a new signature + - Operation ReplicationStorageClassifications.get has a new signature + - Operation ReplicationStorageClassifications.list has a new signature + - Operation ReplicationStorageClassifications.listByReplicationFabrics has a new signature + - Operation ReplicationVaultHealth.beginRefresh has a new signature + - Operation ReplicationVaultHealth.beginRefreshAndWait has a new signature + - Operation ReplicationVaultHealth.get has a new signature + - Operation ReplicationVaultSetting.beginCreate has a new signature + - Operation ReplicationVaultSetting.beginCreateAndWait has a new signature + - Operation ReplicationVaultSetting.get has a new signature + - Operation ReplicationVaultSetting.list has a new signature + - Operation ReplicationvCenters.beginCreate has a new signature + - Operation ReplicationvCenters.beginCreateAndWait has a new signature + - Operation ReplicationvCenters.beginDelete has a new signature + - Operation ReplicationvCenters.beginDeleteAndWait has a new signature + - Operation ReplicationvCenters.beginUpdate has a new signature + - Operation ReplicationvCenters.beginUpdateAndWait has a new signature + - Operation ReplicationvCenters.get has a new signature + - Operation ReplicationvCenters.list has a new signature + - Operation ReplicationvCenters.listByReplicationFabrics has a new signature + - Operation SupportedOperatingSystemsOperations.get has a new signature + - Operation TargetComputeSizes.listByReplicationProtectedItems has a new signature + - Class SiteRecoveryManagementClient has a new signature + - Interface ReplicationAppliancesListNextOptionalParams no longer has parameter filter + - Interface ReplicationEventsListNextOptionalParams no longer has parameter filter + - Interface ReplicationJobsListNextOptionalParams no longer has parameter filter + - Interface ReplicationMigrationItemsListByReplicationProtectionContainersNextOptionalParams no longer has parameter filter + - Interface ReplicationMigrationItemsListByReplicationProtectionContainersNextOptionalParams no longer has parameter skipToken + - Interface ReplicationMigrationItemsListByReplicationProtectionContainersNextOptionalParams no longer has parameter takeToken + - Interface ReplicationMigrationItemsListNextOptionalParams no longer has parameter filter + - Interface ReplicationMigrationItemsListNextOptionalParams no longer has parameter skipToken + - Interface ReplicationMigrationItemsListNextOptionalParams no longer has parameter takeToken + - Interface ReplicationProtectableItemsListByReplicationProtectionContainersNextOptionalParams no longer has parameter filter + - Interface ReplicationProtectableItemsListByReplicationProtectionContainersNextOptionalParams no longer has parameter skipToken + - Interface ReplicationProtectableItemsListByReplicationProtectionContainersNextOptionalParams no longer has parameter take + - Interface ReplicationProtectedItemsListNextOptionalParams no longer has parameter filter + - Interface ReplicationProtectedItemsListNextOptionalParams no longer has parameter skipToken + - Interface ReplicationProtectionIntentsListNextOptionalParams no longer has parameter skipToken + - Interface ReplicationProtectionIntentsListNextOptionalParams no longer has parameter takeToken + - Class SiteRecoveryManagementClient no longer has parameter resourceGroupName + - Class SiteRecoveryManagementClient no longer has parameter resourceName + + ## 4.0.0 (2022-01-20) The package of @azure/arm-recoveryservices-siterecovery is using our next generation design principles since version 4.0.0, which contains breaking changes. diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/README.md b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/README.md index e6bbd551b2d0..385e82f9d86f 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/README.md +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/README.md @@ -16,6 +16,8 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f - [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) - 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]. @@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); 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 SiteRecoveryManagementClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new SiteRecoveryManagementClient(credential, subscriptionId); ``` diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/_meta.json b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/_meta.json index ca0400ff9859..904e9a13e3ad 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/_meta.json +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/_meta.json @@ -1,7 +1,8 @@ { - "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "commit": "1be09531e4c6edeafde41d6562371566d39669e8", "readme": "specification/recoveryservicessiterecovery/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1", + "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\\recoveryservicessiterecovery\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.4 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.2", + "use": "@autorest/typescript@6.0.0-rc.4" } \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/api-extractor.json b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/api-extractor.json index e50d71af3ac4..ec30fed98c5d 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/api-extractor.json +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-recoveryservices-siterecovery.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/package.json b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/package.json index 6ed4151fe939..d36ba8b83079 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/package.json +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for SiteRecoveryManagementClient.", - "version": "4.0.0", + "version": "5.0.0", "engines": { "node": ">=14.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.0.0", + "@azure/core-client": "^1.6.1", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" }, "keywords": [ @@ -29,20 +29,25 @@ "types": "./types/arm-recoveryservices-siterecovery.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "@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", + "@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", "mkdirp": "^1.0.4", - "rollup": "^1.16.3", - "rollup-plugin-sourcemaps": "^0.4.2", - "typescript": "~4.2.0", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", + "typescript": "~4.8.0", "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", + "@types/node": "^14.0.0", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery", "repository": { @@ -93,18 +98,25 @@ "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": { "constantPaths": [ { - "path": "src/SiteRecoveryManagementClient.ts", + "path": "src/siteRecoveryManagementClient.ts", "prefix": "packageDetails" } ] }, - "autoPublish": true + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-recoveryservices-siterecovery?view=azure-node-preview" + } } diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/recordings/node/my_test/recording_sample_test.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/recordings/node/my_test/recording_sample_test.js deleted file mode 100644 index 0f6ecb857acf..000000000000 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/recordings/node/my_test/recording_sample_test.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "7a6be38bb8cb644d64b4094802301751"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/recordings/node/recoveryservicessiterecovery_test/recording_operations_list_test.json b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/recordings/node/recoveryservicessiterecovery_test/recording_operations_list_test.json new file mode 100644 index 000000000000..20bd7e200f23 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/recordings/node/recoveryservicessiterecovery_test/recording_operations_list_test.json @@ -0,0 +1,40 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.RecoveryServices/operations?api-version=2022-10-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip,deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-js-arm-recoveryservices-siterecovery/5.0.0 core-rest-pipeline/1.10.1 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22621)", + "x-ms-client-request-id": "dcec939e-b20b-4e23-88e4-51e4adc11d20" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Encoding": "gzip", + "Content-Type": "application/json", + "Date": "Thu, 08 Dec 2022 03:08:57 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Server": "Microsoft-IIS/10.0", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "x-ms-client-request-id": "dcec939e-b20b-4e23-88e4-51e4adc11d20", + "x-ms-correlation-request-id": "05081d23-4345-45a7-b04a-a603b555b0e2", + "x-ms-ratelimit-remaining-subscription-reads": "11999", + "x-ms-request-id": "05081d23-4345-45a7-b04a-a603b555b0e2", + "x-ms-routing-request-id": "SOUTHEASTASIA:20221208T030858Z:05081d23-4345-45a7-b04a-a603b555b0e2" + }, + "ResponseBody": { + "value": [] + } + } + ], + "Variables": {} +} diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/review/arm-recoveryservices-siterecovery.api.md b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/review/arm-recoveryservices-siterecovery.api.md index 8a8d70b21d85..119a0fa21a78 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/review/arm-recoveryservices-siterecovery.api.md +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/review/arm-recoveryservices-siterecovery.api.md @@ -11,142 +11,148 @@ import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; // @public -export type A2AAddDisksInput = AddDisksProviderSpecificInput & { +export interface A2AAddDisksInput extends AddDisksProviderSpecificInput { instanceType: "A2A"; vmDisks?: A2AVmDiskInputDetails[]; vmManagedDisks?: A2AVmManagedDiskInputDetails[]; -}; +} // @public -export type A2AApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface A2AApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { instanceType: "A2A"; -}; +} // @public -export type A2AContainerCreationInput = ReplicationProviderSpecificContainerCreationInput & { +export interface A2AContainerCreationInput extends ReplicationProviderSpecificContainerCreationInput { instanceType: "A2A"; -}; +} // @public -export type A2AContainerMappingInput = ReplicationProviderSpecificContainerMappingInput & { - instanceType: "A2A"; +export interface A2AContainerMappingInput extends ReplicationProviderSpecificContainerMappingInput { agentAutoUpdateStatus?: AgentAutoUpdateStatus; automationAccountArmId?: string; automationAccountAuthenticationType?: AutomationAccountAuthenticationType; -}; + instanceType: "A2A"; +} // @public -export type A2ACreateProtectionIntentInput = CreateProtectionIntentProviderSpecificDetails & { - instanceType: "A2A"; +export interface A2ACreateProtectionIntentInput extends CreateProtectionIntentProviderSpecificDetails { + agentAutoUpdateStatus?: AgentAutoUpdateStatus; + automationAccountArmId?: string; + automationAccountAuthenticationType?: AutomationAccountAuthenticationType; + autoProtectionOfDataDisk?: AutoProtectionOfDataDisk; + diskEncryptionInfo?: DiskEncryptionInfo; fabricObjectId: string; + instanceType: "A2A"; + multiVmGroupId?: string; + multiVmGroupName?: string; primaryLocation: string; - recoveryLocation: string; - recoverySubscriptionId: string; - recoveryAvailabilityType: A2ARecoveryAvailabilityType; - protectionProfileCustomInput?: ProtectionProfileCustomDetailsUnion; - recoveryResourceGroupId: string; primaryStagingStorageAccountCustomInput?: StorageAccountCustomDetailsUnion; + protectionProfileCustomInput?: ProtectionProfileCustomDetailsUnion; recoveryAvailabilitySetCustomInput?: RecoveryAvailabilitySetCustomDetailsUnion; - recoveryVirtualNetworkCustomInput?: RecoveryVirtualNetworkCustomDetailsUnion; + recoveryAvailabilityType: A2ARecoveryAvailabilityType; + recoveryAvailabilityZone?: string; + recoveryBootDiagStorageAccount?: StorageAccountCustomDetailsUnion; + recoveryLocation: string; recoveryProximityPlacementGroupCustomInput?: RecoveryProximityPlacementGroupCustomDetailsUnion; - autoProtectionOfDataDisk?: AutoProtectionOfDataDisk; + recoveryResourceGroupId: string; + recoverySubscriptionId: string; + recoveryVirtualNetworkCustomInput?: RecoveryVirtualNetworkCustomDetailsUnion; vmDisks?: A2AProtectionIntentDiskInputDetails[]; vmManagedDisks?: A2AProtectionIntentManagedDiskInputDetails[]; - multiVmGroupName?: string; - multiVmGroupId?: string; - recoveryBootDiagStorageAccount?: StorageAccountCustomDetailsUnion; - diskEncryptionInfo?: DiskEncryptionInfo; - recoveryAvailabilityZone?: string; - agentAutoUpdateStatus?: AgentAutoUpdateStatus; - automationAccountAuthenticationType?: AutomationAccountAuthenticationType; - automationAccountArmId?: string; -}; +} // @public -export type A2ACrossClusterMigrationApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface A2ACrossClusterMigrationApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { instanceType: "A2ACrossClusterMigration"; -}; +} // @public -export type A2ACrossClusterMigrationContainerCreationInput = ReplicationProviderSpecificContainerCreationInput & { +export interface A2ACrossClusterMigrationContainerCreationInput extends ReplicationProviderSpecificContainerCreationInput { instanceType: "A2ACrossClusterMigration"; -}; +} // @public -export type A2ACrossClusterMigrationEnableProtectionInput = EnableProtectionProviderSpecificInput & { - instanceType: "A2ACrossClusterMigration"; +export interface A2ACrossClusterMigrationEnableProtectionInput extends EnableProtectionProviderSpecificInput { fabricObjectId?: string; + instanceType: "A2ACrossClusterMigration"; recoveryContainerId?: string; -}; +} // @public -export type A2ACrossClusterMigrationPolicyCreationInput = PolicyProviderSpecificInput & { +export interface A2ACrossClusterMigrationPolicyCreationInput extends PolicyProviderSpecificInput { instanceType: "A2ACrossClusterMigration"; -}; +} // @public -export type A2ACrossClusterMigrationReplicationDetails = ReplicationProviderSpecificSettings & { - instanceType: "A2ACrossClusterMigration"; +export interface A2ACrossClusterMigrationReplicationDetails extends ReplicationProviderSpecificSettings { fabricObjectId?: string; - primaryFabricLocation?: string; + instanceType: "A2ACrossClusterMigration"; + lifecycleId?: string; osType?: string; + primaryFabricLocation?: string; vmProtectionState?: string; vmProtectionStateDescription?: string; - lifecycleId?: string; -}; +} // @public -export type A2AEnableProtectionInput = EnableProtectionProviderSpecificInput & { - instanceType: "A2A"; +export interface A2AEnableProtectionInput extends EnableProtectionProviderSpecificInput { + diskEncryptionInfo?: DiskEncryptionInfo; fabricObjectId: string; - recoveryContainerId?: string; - recoveryResourceGroupId?: string; - recoveryCloudServiceId?: string; - recoveryAvailabilitySetId?: string; - recoveryProximityPlacementGroupId?: string; - vmDisks?: A2AVmDiskInputDetails[]; - vmManagedDisks?: A2AVmManagedDiskInputDetails[]; - multiVmGroupName?: string; + instanceType: "A2A"; multiVmGroupId?: string; - recoveryBootDiagStorageAccountId?: string; - diskEncryptionInfo?: DiskEncryptionInfo; + multiVmGroupName?: string; + recoveryAvailabilitySetId?: string; recoveryAvailabilityZone?: string; - recoveryExtendedLocation?: ExtendedLocation; recoveryAzureNetworkId?: string; + recoveryBootDiagStorageAccountId?: string; + recoveryCapacityReservationGroupId?: string; + recoveryCloudServiceId?: string; + recoveryContainerId?: string; + recoveryExtendedLocation?: ExtendedLocation; + recoveryProximityPlacementGroupId?: string; + recoveryResourceGroupId?: string; recoverySubnetName?: string; recoveryVirtualMachineScaleSetId?: string; - recoveryCapacityReservationGroupId?: string; -}; + vmDisks?: A2AVmDiskInputDetails[]; + vmManagedDisks?: A2AVmManagedDiskInputDetails[]; +} // @public -export type A2AEventDetails = EventProviderSpecificDetails & { +export interface A2AEventDetails extends EventProviderSpecificDetails { + fabricLocation?: string; + fabricName?: string; + fabricObjectId?: string; instanceType: "A2A"; protectedItemName?: string; - fabricObjectId?: string; - fabricName?: string; - fabricLocation?: string; - remoteFabricName?: string; remoteFabricLocation?: string; -}; + remoteFabricName?: string; +} // @public -export type A2APolicyCreationInput = PolicyProviderSpecificInput & { - instanceType: "A2A"; - recoveryPointHistory?: number; - crashConsistentFrequencyInMinutes?: number; - appConsistentFrequencyInMinutes?: number; - multiVmSyncStatus: SetMultiVmSyncStatus; -}; +export interface A2AExtendedLocationDetails { + primaryExtendedLocation?: ExtendedLocation; + recoveryExtendedLocation?: ExtendedLocation; +} // @public -export type A2APolicyDetails = PolicyProviderSpecificDetails & { +export interface A2APolicyCreationInput extends PolicyProviderSpecificInput { + appConsistentFrequencyInMinutes?: number; + crashConsistentFrequencyInMinutes?: number; instanceType: "A2A"; - recoveryPointThresholdInMinutes?: number; + multiVmSyncStatus: SetMultiVmSyncStatus; recoveryPointHistory?: number; +} + +// @public +export interface A2APolicyDetails extends PolicyProviderSpecificDetails { appConsistentFrequencyInMinutes?: number; - multiVmSyncStatus?: string; crashConsistentFrequencyInMinutes?: number; -}; + instanceType: "A2A"; + multiVmSyncStatus?: string; + recoveryPointHistory?: number; + recoveryPointThresholdInMinutes?: number; +} // @public export interface A2AProtectedDiskDetails { @@ -208,14 +214,14 @@ export interface A2AProtectedManagedDiskDetails { } // @public -export type A2AProtectionContainerMappingDetails = ProtectionContainerMappingProviderSpecificDetails & { - instanceType: "A2A"; +export interface A2AProtectionContainerMappingDetails extends ProtectionContainerMappingProviderSpecificDetails { agentAutoUpdateStatus?: AgentAutoUpdateStatus; automationAccountArmId?: string; automationAccountAuthenticationType?: AutomationAccountAuthenticationType; - scheduleName?: string; + instanceType: "A2A"; jobScheduleName?: string; -}; + scheduleName?: string; +} // @public export interface A2AProtectionIntentDiskInputDetails { @@ -239,149 +245,149 @@ export interface A2AProtectionIntentManagedDiskInputDetails { export type A2ARecoveryAvailabilityType = string; // @public -export type A2ARecoveryPointDetails = ProviderSpecificRecoveryPointDetails & { +export interface A2ARecoveryPointDetails extends ProviderSpecificRecoveryPointDetails { + disks?: string[]; instanceType: "A2A"; recoveryPointSyncType?: RecoveryPointSyncType; - disks?: string[]; -}; +} // @public -export type A2ARemoveDisksInput = RemoveDisksProviderSpecificInput & { +export interface A2ARemoveDisksInput extends RemoveDisksProviderSpecificInput { instanceType: "A2A"; vmDisksUris?: string[]; vmManagedDisksIds?: string[]; -}; +} // @public -export type A2AReplicationDetails = ReplicationProviderSpecificSettings & { - instanceType: "A2A"; +export interface A2AReplicationDetails extends ReplicationProviderSpecificSettings { + readonly agentCertificateExpiryDate?: Date; + agentExpiryDate?: Date; + agentVersion?: string; + autoProtectionOfDataDisk?: AutoProtectionOfDataDisk; fabricObjectId?: string; - readonly initialPrimaryZone?: string; - readonly initialPrimaryFabricLocation?: string; - readonly initialRecoveryZone?: string; initialPrimaryExtendedLocation?: ExtendedLocation; + readonly initialPrimaryFabricLocation?: string; + readonly initialPrimaryZone?: string; initialRecoveryExtendedLocation?: ExtendedLocation; readonly initialRecoveryFabricLocation?: string; + readonly initialRecoveryZone?: string; + instanceType: "A2A"; + isReplicationAgentCertificateUpdateRequired?: boolean; + isReplicationAgentUpdateRequired?: boolean; + lastHeartbeat?: Date; + lastRpoCalculatedTime?: Date; + lifecycleId?: string; + managementId?: string; + monitoringJobType?: string; + monitoringPercentageCompletion?: number; + multiVmGroupCreateOption?: MultiVmGroupCreateOption; multiVmGroupId?: string; multiVmGroupName?: string; - multiVmGroupCreateOption?: MultiVmGroupCreateOption; - managementId?: string; + osType?: string; + primaryAvailabilityZone?: string; + primaryExtendedLocation?: ExtendedLocation; + primaryFabricLocation?: string; protectedDisks?: A2AProtectedDiskDetails[]; - unprotectedDisks?: A2AUnprotectedDiskDetails[]; protectedManagedDisks?: A2AProtectedManagedDiskDetails[]; - recoveryBootDiagStorageAccountId?: string; - primaryFabricLocation?: string; - recoveryFabricLocation?: string; - osType?: string; - recoveryAzureVMSize?: string; - recoveryAzureVMName?: string; + recoveryAvailabilitySet?: string; + recoveryAvailabilityZone?: string; + readonly recoveryAzureGeneration?: string; recoveryAzureResourceGroupId?: string; + recoveryAzureVMName?: string; + recoveryAzureVMSize?: string; + recoveryBootDiagStorageAccountId?: string; + recoveryCapacityReservationGroupId?: string; recoveryCloudService?: string; - recoveryAvailabilitySet?: string; + recoveryExtendedLocation?: ExtendedLocation; + recoveryFabricLocation?: string; + recoveryFabricObjectId?: string; + recoveryProximityPlacementGroupId?: string; + recoveryVirtualMachineScaleSetId?: string; + rpoInSeconds?: number; selectedRecoveryAzureNetworkId?: string; selectedTfoAzureNetworkId?: string; + testFailoverRecoveryFabricObjectId?: string; + tfoAzureVMName?: string; + unprotectedDisks?: A2AUnprotectedDiskDetails[]; + readonly vmEncryptionType?: VmEncryptionType; vmNics?: VMNicDetails[]; - vmSyncedConfigDetails?: AzureToAzureVmSyncedConfigDetails; - monitoringPercentageCompletion?: number; - monitoringJobType?: string; - lastHeartbeat?: Date; - agentVersion?: string; - agentExpiryDate?: Date; - isReplicationAgentUpdateRequired?: boolean; - readonly agentCertificateExpiryDate?: Date; - isReplicationAgentCertificateUpdateRequired?: boolean; - recoveryFabricObjectId?: string; vmProtectionState?: string; vmProtectionStateDescription?: string; - lifecycleId?: string; - testFailoverRecoveryFabricObjectId?: string; - rpoInSeconds?: number; - lastRpoCalculatedTime?: Date; - primaryAvailabilityZone?: string; - recoveryAvailabilityZone?: string; - primaryExtendedLocation?: ExtendedLocation; - recoveryExtendedLocation?: ExtendedLocation; - readonly vmEncryptionType?: VmEncryptionType; - tfoAzureVMName?: string; - readonly recoveryAzureGeneration?: string; - recoveryProximityPlacementGroupId?: string; - autoProtectionOfDataDisk?: AutoProtectionOfDataDisk; - recoveryVirtualMachineScaleSetId?: string; - recoveryCapacityReservationGroupId?: string; -}; + vmSyncedConfigDetails?: AzureToAzureVmSyncedConfigDetails; +} // @public -export type A2AReplicationIntentDetails = ReplicationProtectionIntentProviderSpecificSettings & { - instanceType: "A2A"; +export interface A2AReplicationIntentDetails extends ReplicationProtectionIntentProviderSpecificSettings { + agentAutoUpdateStatus?: AgentAutoUpdateStatus; + automationAccountArmId?: string; + automationAccountAuthenticationType?: AutomationAccountAuthenticationType; + autoProtectionOfDataDisk?: AutoProtectionOfDataDisk; + diskEncryptionInfo?: DiskEncryptionInfo; fabricObjectId?: string; + instanceType: "A2A"; + multiVmGroupId?: string; + multiVmGroupName?: string; primaryLocation?: string; + primaryStagingStorageAccount?: StorageAccountCustomDetailsUnion; + protectionProfile?: ProtectionProfileCustomDetailsUnion; + recoveryAvailabilitySet?: RecoveryAvailabilitySetCustomDetailsUnion; + recoveryAvailabilityType: string; + recoveryAvailabilityZone?: string; + recoveryBootDiagStorageAccount?: StorageAccountCustomDetailsUnion; recoveryLocation?: string; + recoveryProximityPlacementGroup?: RecoveryProximityPlacementGroupCustomDetailsUnion; + recoveryResourceGroupId?: string; recoverySubscriptionId?: string; + recoveryVirtualNetwork?: RecoveryVirtualNetworkCustomDetailsUnion; vmDisks?: A2AProtectionIntentDiskInputDetails[]; vmManagedDisks?: A2AProtectionIntentManagedDiskInputDetails[]; - recoveryResourceGroupId?: string; - protectionProfile?: ProtectionProfileCustomDetailsUnion; - primaryStagingStorageAccount?: StorageAccountCustomDetailsUnion; - recoveryAvailabilitySet?: RecoveryAvailabilitySetCustomDetailsUnion; - recoveryVirtualNetwork?: RecoveryVirtualNetworkCustomDetailsUnion; - recoveryProximityPlacementGroup?: RecoveryProximityPlacementGroupCustomDetailsUnion; - autoProtectionOfDataDisk?: AutoProtectionOfDataDisk; - multiVmGroupName?: string; - multiVmGroupId?: string; - recoveryBootDiagStorageAccount?: StorageAccountCustomDetailsUnion; - diskEncryptionInfo?: DiskEncryptionInfo; - recoveryAvailabilityZone?: string; - recoveryAvailabilityType: string; - agentAutoUpdateStatus?: AgentAutoUpdateStatus; - automationAccountArmId?: string; - automationAccountAuthenticationType?: AutomationAccountAuthenticationType; -}; +} // @public -export type A2AReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface A2AReprotectInput extends ReverseReplicationProviderSpecificInput { instanceType: "A2A"; + policyId?: string; + recoveryAvailabilitySetId?: string; + recoveryCloudServiceId?: string; recoveryContainerId?: string; - vmDisks?: A2AVmDiskInputDetails[]; recoveryResourceGroupId?: string; - recoveryCloudServiceId?: string; - recoveryAvailabilitySetId?: string; - policyId?: string; -}; + vmDisks?: A2AVmDiskInputDetails[]; +} // @public export type A2ARpRecoveryPointType = string; // @public -export type A2ASwitchProtectionInput = SwitchProtectionProviderSpecificInput & { +export interface A2ASwitchProtectionInput extends SwitchProtectionProviderSpecificInput { + diskEncryptionInfo?: DiskEncryptionInfo; instanceType: "A2A"; - recoveryContainerId?: string; - vmDisks?: A2AVmDiskInputDetails[]; - vmManagedDisks?: A2AVmManagedDiskInputDetails[]; - recoveryResourceGroupId?: string; - recoveryCloudServiceId?: string; - recoveryAvailabilitySetId?: string; policyId?: string; - recoveryBootDiagStorageAccountId?: string; + recoveryAvailabilitySetId?: string; recoveryAvailabilityZone?: string; + recoveryBootDiagStorageAccountId?: string; + recoveryCapacityReservationGroupId?: string; + recoveryCloudServiceId?: string; + recoveryContainerId?: string; recoveryProximityPlacementGroupId?: string; + recoveryResourceGroupId?: string; recoveryVirtualMachineScaleSetId?: string; - recoveryCapacityReservationGroupId?: string; - diskEncryptionInfo?: DiskEncryptionInfo; -}; + vmDisks?: A2AVmDiskInputDetails[]; + vmManagedDisks?: A2AVmManagedDiskInputDetails[]; +} // @public -export type A2ATestFailoverInput = TestFailoverProviderSpecificInput & { +export interface A2ATestFailoverInput extends TestFailoverProviderSpecificInput { + cloudServiceCreationOption?: string; instanceType: "A2A"; recoveryPointId?: string; - cloudServiceCreationOption?: string; -}; +} // @public -export type A2AUnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface A2AUnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { + cloudServiceCreationOption?: string; instanceType: "A2A"; recoveryPointId?: string; - cloudServiceCreationOption?: string; -}; +} // @public export interface A2AUnprotectedDiskDetails { @@ -390,26 +396,26 @@ export interface A2AUnprotectedDiskDetails { } // @public -export type A2AUpdateContainerMappingInput = ReplicationProviderSpecificUpdateContainerMappingInput & { - instanceType: "A2A"; +export interface A2AUpdateContainerMappingInput extends ReplicationProviderSpecificUpdateContainerMappingInput { agentAutoUpdateStatus?: AgentAutoUpdateStatus; automationAccountArmId?: string; automationAccountAuthenticationType?: AutomationAccountAuthenticationType; -}; + instanceType: "A2A"; +} // @public -export type A2AUpdateReplicationProtectedItemInput = UpdateReplicationProtectedItemProviderInput & { +export interface A2AUpdateReplicationProtectedItemInput extends UpdateReplicationProtectedItemProviderInput { + diskEncryptionInfo?: DiskEncryptionInfo; instanceType: "A2A"; - recoveryCloudServiceId?: string; - recoveryResourceGroupId?: string; managedDiskUpdateDetails?: A2AVmManagedDiskUpdateDetails[]; recoveryBootDiagStorageAccountId?: string; - diskEncryptionInfo?: DiskEncryptionInfo; - tfoAzureVMName?: string; + recoveryCapacityReservationGroupId?: string; + recoveryCloudServiceId?: string; recoveryProximityPlacementGroupId?: string; + recoveryResourceGroupId?: string; recoveryVirtualMachineScaleSetId?: string; - recoveryCapacityReservationGroupId?: string; -}; + tfoAzureVMName?: string; +} // @public export interface A2AVmDiskInputDetails { @@ -520,9 +526,9 @@ export type AgentUpgradeBlockedReason = string; export type AgentVersionStatus = string; // @public -export type Alert = Resource & { +export interface Alert extends Resource { properties?: AlertProperties; -}; +} // @public export interface AlertCollection { @@ -579,9 +585,9 @@ export interface ApplyRecoveryPointProviderSpecificInput { export type ApplyRecoveryPointProviderSpecificInputUnion = ApplyRecoveryPointProviderSpecificInput | A2AApplyRecoveryPointInput | A2ACrossClusterMigrationApplyRecoveryPointInput | HyperVReplicaAzureApplyRecoveryPointInput | InMageAzureV2ApplyRecoveryPointInput | InMageRcmApplyRecoveryPointInput; // @public -export type AsrJobDetails = JobDetails & { +export interface AsrJobDetails extends JobDetails { instanceType: "AsrJobDetails"; -}; +} // @public export interface ASRTask { @@ -603,54 +609,55 @@ export interface ASRTask { export type AutomationAccountAuthenticationType = string; // @public -export type AutomationRunbookTaskDetails = TaskTypeDetails & { +export interface AutomationRunbookTaskDetails extends TaskTypeDetails { + accountName?: string; + cloudServiceName?: string; instanceType: "AutomationRunbookTaskDetails"; + isPrimarySideScript?: boolean; + jobId?: string; + jobOutput?: string; name?: string; - cloudServiceName?: string; - subscriptionId?: string; - accountName?: string; runbookId?: string; runbookName?: string; - jobId?: string; - jobOutput?: string; - isPrimarySideScript?: boolean; -}; + subscriptionId?: string; +} // @public export type AutoProtectionOfDataDisk = string; // @public -export type AzureFabricCreationInput = FabricSpecificCreationInput & { +export interface AzureFabricCreationInput extends FabricSpecificCreationInput { instanceType: "Azure"; location?: string; -}; +} // @public -export type AzureFabricSpecificDetails = FabricSpecificDetails & { +export interface AzureFabricSpecificDetails extends FabricSpecificDetails { + containerIds?: string[]; + extendedLocations?: A2AExtendedLocationDetails[]; instanceType: "Azure"; location?: string; - containerIds?: string[]; zones?: A2AZoneDetails[]; -}; +} // @public -export type AzureToAzureCreateNetworkMappingInput = FabricSpecificCreateNetworkMappingInput & { +export interface AzureToAzureCreateNetworkMappingInput extends FabricSpecificCreateNetworkMappingInput { instanceType: "AzureToAzure"; primaryNetworkId: string; -}; +} // @public -export type AzureToAzureNetworkMappingSettings = NetworkMappingFabricSpecificSettings & { +export interface AzureToAzureNetworkMappingSettings extends NetworkMappingFabricSpecificSettings { instanceType: "AzureToAzure"; primaryFabricLocation?: string; recoveryFabricLocation?: string; -}; +} // @public -export type AzureToAzureUpdateNetworkMappingInput = FabricSpecificUpdateNetworkMappingInput & { +export interface AzureToAzureUpdateNetworkMappingInput extends FabricSpecificUpdateNetworkMappingInput { instanceType: "AzureToAzure"; primaryNetworkId?: string; -}; +} // @public export interface AzureToAzureVmSyncedConfigDetails { @@ -701,10 +708,10 @@ export interface ConfigureAlertRequestProperties { } // @public -export type ConsistencyCheckTaskDetails = TaskTypeDetails & { +export interface ConsistencyCheckTaskDetails extends TaskTypeDetails { instanceType: "ConsistencyCheckTaskDetails"; vmDetails?: InconsistentVmDetails[]; -}; +} // @public export interface CreateNetworkMappingInput { @@ -782,6 +789,14 @@ export interface CreateRecoveryPlanInputProperties { recoveryFabricId: string; } +// @public +export interface CriticalJobHistoryDetails { + readonly jobId?: string; + readonly jobName?: string; + readonly jobStatus?: string; + readonly startTime?: Date; +} + // @public export interface CurrentJobDetails { readonly jobId?: string; @@ -945,9 +960,9 @@ export interface EncryptionDetails { export type EthernetAddressType = string; // @public -type Event_2 = Resource & { +interface Event_2 extends Resource { properties?: EventProperties; -}; +} export { Event_2 as Event } // @public @@ -1000,48 +1015,48 @@ export interface EventSpecificDetails { export type EventSpecificDetailsUnion = EventSpecificDetails | JobStatusEventDetails; // @public -export type ExistingProtectionProfile = ProtectionProfileCustomDetails & { - resourceType: "Existing"; +export interface ExistingProtectionProfile extends ProtectionProfileCustomDetails { protectionProfileId: string; -}; + resourceType: "Existing"; +} // @public -export type ExistingRecoveryAvailabilitySet = RecoveryAvailabilitySetCustomDetails & { - resourceType: "Existing"; +export interface ExistingRecoveryAvailabilitySet extends RecoveryAvailabilitySetCustomDetails { recoveryAvailabilitySetId?: string; -}; + resourceType: "Existing"; +} // @public -export type ExistingRecoveryProximityPlacementGroup = RecoveryProximityPlacementGroupCustomDetails & { - resourceType: "Existing"; +export interface ExistingRecoveryProximityPlacementGroup extends RecoveryProximityPlacementGroupCustomDetails { recoveryProximityPlacementGroupId?: string; -}; + resourceType: "Existing"; +} // @public -export type ExistingRecoveryResourceGroup = RecoveryResourceGroupCustomDetails & { - resourceType: "Existing"; +export interface ExistingRecoveryResourceGroup extends RecoveryResourceGroupCustomDetails { recoveryResourceGroupId?: string; -}; + resourceType: "Existing"; +} // @public -export type ExistingRecoveryVirtualNetwork = RecoveryVirtualNetworkCustomDetails & { - resourceType: "Existing"; - recoveryVirtualNetworkId: string; +export interface ExistingRecoveryVirtualNetwork extends RecoveryVirtualNetworkCustomDetails { recoverySubnetName?: string; -}; + recoveryVirtualNetworkId: string; + resourceType: "Existing"; +} // @public -export type ExistingStorageAccount = StorageAccountCustomDetails & { - resourceType: "Existing"; +export interface ExistingStorageAccount extends StorageAccountCustomDetails { azureStorageAccountId: string; -}; + resourceType: "Existing"; +} // @public -export type ExportJobDetails = JobDetails & { - instanceType: "ExportJobDetails"; +export interface ExportJobDetails extends JobDetails { blobUri?: string; + instanceType: "ExportJobDetails"; sasToken?: string; -}; +} // @public export type ExportJobOutputSerializationType = string; @@ -1056,9 +1071,9 @@ export interface ExtendedLocation { export type ExtendedLocationType = string; // @public -export type Fabric = Resource & { +export interface Fabric extends Resource { properties?: FabricProperties; -}; +} // @public export interface FabricCollection { @@ -1099,11 +1114,11 @@ export interface FabricQueryParameter { } // @public -export type FabricReplicationGroupTaskDetails = JobTaskDetails & { +export interface FabricReplicationGroupTaskDetails extends JobTaskDetails { instanceType: "FabricReplicationGroupTaskDetails"; skippedReason?: string; skippedReasonString?: string; -}; +} // @public export interface FabricSpecificCreateNetworkMappingInput { @@ -1141,10 +1156,10 @@ export type FabricSpecificUpdateNetworkMappingInputUnion = FabricSpecificUpdateN export type FailoverDeploymentModel = string; // @public -export type FailoverJobDetails = JobDetails & { +export interface FailoverJobDetails extends JobDetails { instanceType: "FailoverJobDetails"; protectedItemDetails?: FailoverReplicationProtectedItemDetails[]; -}; +} // @public export interface FailoverProcessServerRequest { @@ -1173,6 +1188,9 @@ export interface FailoverReplicationProtectedItemDetails { testVmName?: string; } +// @public +export function getContinuationToken(page: unknown): string | undefined; + // @public export interface GroupTaskDetails { childTasks?: ASRTask[]; @@ -1226,29 +1244,29 @@ export interface HyperVHostDetails { } // @public -export type HyperVReplica2012EventDetails = EventProviderSpecificDetails & { - instanceType: "HyperVReplica2012"; +export interface HyperVReplica2012EventDetails extends EventProviderSpecificDetails { containerName?: string; fabricName?: string; + instanceType: "HyperVReplica2012"; remoteContainerName?: string; remoteFabricName?: string; -}; +} // @public -export type HyperVReplica2012R2EventDetails = EventProviderSpecificDetails & { - instanceType: "HyperVReplica2012R2"; +export interface HyperVReplica2012R2EventDetails extends EventProviderSpecificDetails { containerName?: string; fabricName?: string; + instanceType: "HyperVReplica2012R2"; remoteContainerName?: string; remoteFabricName?: string; -}; +} // @public -export type HyperVReplicaAzureApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface HyperVReplicaAzureApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { instanceType: "HyperVReplicaAzure"; primaryKekCertificatePfx?: string; secondaryKekCertificatePfx?: string; -}; +} // @public export interface HyperVReplicaAzureDiskInputDetails { @@ -1259,61 +1277,61 @@ export interface HyperVReplicaAzureDiskInputDetails { } // @public -export type HyperVReplicaAzureEnableProtectionInput = EnableProtectionProviderSpecificInput & { - instanceType: "HyperVReplicaAzure"; +export interface HyperVReplicaAzureEnableProtectionInput extends EnableProtectionProviderSpecificInput { + diskEncryptionSetId?: string; + disksToInclude?: string[]; + disksToIncludeForManagedDisks?: HyperVReplicaAzureDiskInputDetails[]; + diskType?: DiskAccountType; + enableRdpOnTargetOption?: string; hvHostVmId?: string; - vmName?: string; + instanceType: "HyperVReplicaAzure"; + licenseType?: LicenseType; + logStorageAccountId?: string; osType?: string; - vhdId?: string; - targetStorageAccountId?: string; + seedManagedDiskTags?: { + [propertyName: string]: string; + }; + sqlServerLicenseType?: SqlServerLicenseType; + targetAvailabilitySetId?: string; + targetAvailabilityZone?: string; targetAzureNetworkId?: string; targetAzureSubnetId?: string; - enableRdpOnTargetOption?: string; - targetAzureVmName?: string; - logStorageAccountId?: string; - disksToInclude?: string[]; targetAzureV1ResourceGroupId?: string; targetAzureV2ResourceGroupId?: string; - useManagedDisks?: string; - targetAvailabilitySetId?: string; - targetAvailabilityZone?: string; - licenseType?: LicenseType; - sqlServerLicenseType?: SqlServerLicenseType; - targetVmSize?: string; - targetProximityPlacementGroupId?: string; - useManagedDisksForReplication?: string; - diskType?: DiskAccountType; - disksToIncludeForManagedDisks?: HyperVReplicaAzureDiskInputDetails[]; - diskEncryptionSetId?: string; - targetVmTags?: { - [propertyName: string]: string; - }; - seedManagedDiskTags?: { - [propertyName: string]: string; - }; + targetAzureVmName?: string; targetManagedDiskTags?: { [propertyName: string]: string; }; targetNicTags?: { [propertyName: string]: string; }; -}; + targetProximityPlacementGroupId?: string; + targetStorageAccountId?: string; + targetVmSize?: string; + targetVmTags?: { + [propertyName: string]: string; + }; + useManagedDisks?: string; + useManagedDisksForReplication?: string; + vhdId?: string; + vmName?: string; +} // @public -export type HyperVReplicaAzureEventDetails = EventProviderSpecificDetails & { - instanceType: "HyperVReplicaAzure"; +export interface HyperVReplicaAzureEventDetails extends EventProviderSpecificDetails { containerName?: string; fabricName?: string; + instanceType: "HyperVReplicaAzure"; remoteContainerName?: string; -}; +} // @public -export type HyperVReplicaAzureFailbackProviderInput = PlannedFailoverProviderSpecificFailoverInput & { - instanceType: "HyperVReplicaAzureFailback"; +export interface HyperVReplicaAzureFailbackProviderInput extends PlannedFailoverProviderSpecificFailoverInput { dataSyncOption?: string; - recoveryVmCreationOption?: string; + instanceType: "HyperVReplicaAzureFailback"; providerIdForAlternateRecovery?: string; -}; + recoveryVmCreationOption?: string; +} // @public export interface HyperVReplicaAzureManagedDiskDetails { @@ -1324,267 +1342,267 @@ export interface HyperVReplicaAzureManagedDiskDetails { } // @public -export type HyperVReplicaAzurePlannedFailoverProviderInput = PlannedFailoverProviderSpecificFailoverInput & { +export interface HyperVReplicaAzurePlannedFailoverProviderInput extends PlannedFailoverProviderSpecificFailoverInput { instanceType: "HyperVReplicaAzure"; primaryKekCertificatePfx?: string; - secondaryKekCertificatePfx?: string; recoveryPointId?: string; -}; + secondaryKekCertificatePfx?: string; +} // @public -export type HyperVReplicaAzurePolicyDetails = PolicyProviderSpecificDetails & { +export interface HyperVReplicaAzurePolicyDetails extends PolicyProviderSpecificDetails { + activeStorageAccountId?: string; + applicationConsistentSnapshotFrequencyInHours?: number; + encryption?: string; instanceType: "HyperVReplicaAzure"; + onlineReplicationStartTime?: string; recoveryPointHistoryDurationInHours?: number; - applicationConsistentSnapshotFrequencyInHours?: number; replicationInterval?: number; - onlineReplicationStartTime?: string; - encryption?: string; - activeStorageAccountId?: string; -}; +} // @public -export type HyperVReplicaAzurePolicyInput = PolicyProviderSpecificInput & { +export interface HyperVReplicaAzurePolicyInput extends PolicyProviderSpecificInput { + applicationConsistentSnapshotFrequencyInHours?: number; instanceType: "HyperVReplicaAzure"; + onlineReplicationStartTime?: string; recoveryPointHistoryDuration?: number; - applicationConsistentSnapshotFrequencyInHours?: number; replicationInterval?: number; - onlineReplicationStartTime?: string; storageAccounts?: string[]; -}; +} // @public -export type HyperVReplicaAzureReplicationDetails = ReplicationProviderSpecificSettings & { - instanceType: "HyperVReplicaAzure"; +export interface HyperVReplicaAzureReplicationDetails extends ReplicationProviderSpecificSettings { azureVmDiskDetails?: AzureVmDiskDetails[]; - recoveryAzureVmName?: string; - recoveryAzureVMSize?: string; - recoveryAzureStorageAccount?: string; - recoveryAzureLogStorageAccountId?: string; + enableRdpOnTargetOption?: string; + encryption?: string; + initialReplicationDetails?: InitialReplicationDetails; + instanceType: "HyperVReplicaAzure"; + readonly lastRecoveryPointReceived?: Date; lastReplicatedTime?: Date; - rpoInSeconds?: number; lastRpoCalculatedTime?: Date; - vmId?: string; - vmProtectionState?: string; - vmProtectionStateDescription?: string; - initialReplicationDetails?: InitialReplicationDetails; - vmNics?: VMNicDetails[]; - selectedRecoveryAzureNetworkId?: string; - selectedSourceNicId?: string; - encryption?: string; + licenseType?: string; oSDetails?: OSDetails; - sourceVmRamSizeInMB?: number; - sourceVmCpuCount?: number; - enableRdpOnTargetOption?: string; - recoveryAzureResourceGroupId?: string; + protectedManagedDisks?: HyperVReplicaAzureManagedDiskDetails[]; recoveryAvailabilitySetId?: string; - targetAvailabilityZone?: string; - targetProximityPlacementGroupId?: string; - useManagedDisks?: string; - licenseType?: string; - sqlServerLicenseType?: string; - readonly lastRecoveryPointReceived?: Date; - targetVmTags?: { - [propertyName: string]: string; - }; + recoveryAzureLogStorageAccountId?: string; + recoveryAzureResourceGroupId?: string; + recoveryAzureStorageAccount?: string; + recoveryAzureVmName?: string; + recoveryAzureVMSize?: string; + rpoInSeconds?: number; seedManagedDiskTags?: { [propertyName: string]: string; }; + selectedRecoveryAzureNetworkId?: string; + selectedSourceNicId?: string; + sourceVmCpuCount?: number; + sourceVmRamSizeInMB?: number; + sqlServerLicenseType?: string; + targetAvailabilityZone?: string; targetManagedDiskTags?: { [propertyName: string]: string; }; targetNicTags?: { [propertyName: string]: string; }; - protectedManagedDisks?: HyperVReplicaAzureManagedDiskDetails[]; -}; + targetProximityPlacementGroupId?: string; + targetVmTags?: { + [propertyName: string]: string; + }; + useManagedDisks?: string; + vmId?: string; + vmNics?: VMNicDetails[]; + vmProtectionState?: string; + vmProtectionStateDescription?: string; +} // @public -export type HyperVReplicaAzureReprotectInput = ReverseReplicationProviderSpecificInput & { - instanceType: "HyperVReplicaAzure"; +export interface HyperVReplicaAzureReprotectInput extends ReverseReplicationProviderSpecificInput { hvHostVmId?: string; - vmName?: string; + instanceType: "HyperVReplicaAzure"; + logStorageAccountId?: string; osType?: string; - vHDId?: string; storageAccountId?: string; - logStorageAccountId?: string; -}; + vHDId?: string; + vmName?: string; +} // @public export type HyperVReplicaAzureRpRecoveryPointType = string; // @public -export type HyperVReplicaAzureTestFailoverInput = TestFailoverProviderSpecificInput & { +export interface HyperVReplicaAzureTestFailoverInput extends TestFailoverProviderSpecificInput { instanceType: "HyperVReplicaAzure"; primaryKekCertificatePfx?: string; - secondaryKekCertificatePfx?: string; recoveryPointId?: string; -}; + secondaryKekCertificatePfx?: string; +} // @public -export type HyperVReplicaAzureUnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface HyperVReplicaAzureUnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { instanceType: "HyperVReplicaAzure"; primaryKekCertificatePfx?: string; - secondaryKekCertificatePfx?: string; recoveryPointId?: string; -}; + secondaryKekCertificatePfx?: string; +} // @public -export type HyperVReplicaAzureUpdateReplicationProtectedItemInput = UpdateReplicationProtectedItemProviderInput & { - instanceType: "HyperVReplicaAzure"; - recoveryAzureV1ResourceGroupId?: string; - recoveryAzureV2ResourceGroupId?: string; - useManagedDisks?: string; +export interface HyperVReplicaAzureUpdateReplicationProtectedItemInput extends UpdateReplicationProtectedItemProviderInput { diskIdToDiskEncryptionMap?: { [propertyName: string]: string; }; - targetProximityPlacementGroupId?: string; + instanceType: "HyperVReplicaAzure"; + recoveryAzureV1ResourceGroupId?: string; + recoveryAzureV2ResourceGroupId?: string; + sqlServerLicenseType?: SqlServerLicenseType; targetAvailabilityZone?: string; - targetVmTags?: { - [propertyName: string]: string; - }; targetManagedDiskTags?: { [propertyName: string]: string; }; targetNicTags?: { [propertyName: string]: string; }; - sqlServerLicenseType?: SqlServerLicenseType; + targetProximityPlacementGroupId?: string; + targetVmTags?: { + [propertyName: string]: string; + }; + useManagedDisks?: string; vmDisks?: UpdateDiskInput[]; -}; +} // @public -export type HyperVReplicaBaseEventDetails = EventProviderSpecificDetails & { - instanceType: "HyperVReplicaBaseEventDetails"; +export interface HyperVReplicaBaseEventDetails extends EventProviderSpecificDetails { containerName?: string; fabricName?: string; + instanceType: "HyperVReplicaBaseEventDetails"; remoteContainerName?: string; remoteFabricName?: string; -}; +} // @public -export type HyperVReplicaBasePolicyDetails = PolicyProviderSpecificDetails & { - instanceType: "HyperVReplicaBasePolicyDetails"; - recoveryPoints?: number; +export interface HyperVReplicaBasePolicyDetails extends PolicyProviderSpecificDetails { + allowedAuthenticationType?: number; applicationConsistentSnapshotFrequencyInHours?: number; compression?: string; initialReplicationMethod?: string; - onlineReplicationStartTime?: string; - offlineReplicationImportPath?: string; + instanceType: "HyperVReplicaBasePolicyDetails"; offlineReplicationExportPath?: string; - replicationPort?: number; - allowedAuthenticationType?: number; + offlineReplicationImportPath?: string; + onlineReplicationStartTime?: string; + recoveryPoints?: number; replicaDeletionOption?: string; -}; + replicationPort?: number; +} // @public -export type HyperVReplicaBaseReplicationDetails = ReplicationProviderSpecificSettings & { +export interface HyperVReplicaBaseReplicationDetails extends ReplicationProviderSpecificSettings { + initialReplicationDetails?: InitialReplicationDetails; instanceType: "HyperVReplicaBaseReplicationDetails"; lastReplicatedTime?: Date; - vmNics?: VMNicDetails[]; + vMDiskDetails?: DiskDetails[]; vmId?: string; + vmNics?: VMNicDetails[]; vmProtectionState?: string; vmProtectionStateDescription?: string; - initialReplicationDetails?: InitialReplicationDetails; - vMDiskDetails?: DiskDetails[]; -}; +} // @public -export type HyperVReplicaBluePolicyDetails = PolicyProviderSpecificDetails & { - instanceType: "HyperVReplica2012R2"; - replicationFrequencyInSeconds?: number; - recoveryPoints?: number; +export interface HyperVReplicaBluePolicyDetails extends PolicyProviderSpecificDetails { + allowedAuthenticationType?: number; applicationConsistentSnapshotFrequencyInHours?: number; compression?: string; initialReplicationMethod?: string; - onlineReplicationStartTime?: string; - offlineReplicationImportPath?: string; + instanceType: "HyperVReplica2012R2"; offlineReplicationExportPath?: string; - replicationPort?: number; - allowedAuthenticationType?: number; + offlineReplicationImportPath?: string; + onlineReplicationStartTime?: string; + recoveryPoints?: number; replicaDeletionOption?: string; -}; + replicationFrequencyInSeconds?: number; + replicationPort?: number; +} // @public -export type HyperVReplicaBluePolicyInput = HyperVReplicaPolicyInput & { +export interface HyperVReplicaBluePolicyInput extends HyperVReplicaPolicyInput { instanceType: "HyperVReplica2012R2"; replicationFrequencyInSeconds?: number; -}; +} // @public -export type HyperVReplicaBlueReplicationDetails = ReplicationProviderSpecificSettings & { +export interface HyperVReplicaBlueReplicationDetails extends ReplicationProviderSpecificSettings { + initialReplicationDetails?: InitialReplicationDetails; instanceType: "HyperVReplica2012R2"; lastReplicatedTime?: Date; - vmNics?: VMNicDetails[]; + vMDiskDetails?: DiskDetails[]; vmId?: string; + vmNics?: VMNicDetails[]; vmProtectionState?: string; vmProtectionStateDescription?: string; - initialReplicationDetails?: InitialReplicationDetails; - vMDiskDetails?: DiskDetails[]; -}; +} // @public -export type HyperVReplicaPolicyDetails = PolicyProviderSpecificDetails & { - instanceType: "HyperVReplica2012"; - recoveryPoints?: number; +export interface HyperVReplicaPolicyDetails extends PolicyProviderSpecificDetails { + allowedAuthenticationType?: number; applicationConsistentSnapshotFrequencyInHours?: number; compression?: string; initialReplicationMethod?: string; - onlineReplicationStartTime?: string; - offlineReplicationImportPath?: string; + instanceType: "HyperVReplica2012"; offlineReplicationExportPath?: string; - replicationPort?: number; - allowedAuthenticationType?: number; + offlineReplicationImportPath?: string; + onlineReplicationStartTime?: string; + recoveryPoints?: number; replicaDeletionOption?: string; -}; + replicationPort?: number; +} // @public -export type HyperVReplicaPolicyInput = PolicyProviderSpecificInput & { - instanceType: "HyperVReplica2012" | "HyperVReplica2012R2"; - recoveryPoints?: number; +export interface HyperVReplicaPolicyInput extends PolicyProviderSpecificInput { + allowedAuthenticationType?: number; applicationConsistentSnapshotFrequencyInHours?: number; compression?: string; initialReplicationMethod?: string; - onlineReplicationStartTime?: string; - offlineReplicationImportPath?: string; + instanceType: "HyperVReplica2012" | "HyperVReplica2012R2"; offlineReplicationExportPath?: string; - replicationPort?: number; - allowedAuthenticationType?: number; + offlineReplicationImportPath?: string; + onlineReplicationStartTime?: string; + recoveryPoints?: number; replicaDeletion?: string; -}; + replicationPort?: number; +} // @public (undocumented) export type HyperVReplicaPolicyInputUnion = HyperVReplicaPolicyInput | HyperVReplicaBluePolicyInput; // @public -export type HyperVReplicaReplicationDetails = ReplicationProviderSpecificSettings & { +export interface HyperVReplicaReplicationDetails extends ReplicationProviderSpecificSettings { + initialReplicationDetails?: InitialReplicationDetails; instanceType: "HyperVReplica2012"; lastReplicatedTime?: Date; - vmNics?: VMNicDetails[]; + vMDiskDetails?: DiskDetails[]; vmId?: string; + vmNics?: VMNicDetails[]; vmProtectionState?: string; vmProtectionStateDescription?: string; - initialReplicationDetails?: InitialReplicationDetails; - vMDiskDetails?: DiskDetails[]; -}; +} // @public -export type HyperVSiteDetails = FabricSpecificDetails & { - instanceType: "HyperVSite"; +export interface HyperVSiteDetails extends FabricSpecificDetails { hyperVHosts?: HyperVHostDetails[]; -}; + instanceType: "HyperVSite"; +} // @public -export type HyperVVirtualMachineDetails = ConfigurationSettings & { - instanceType: "HyperVVirtualMachine" | "VmmVirtualMachine"; - sourceItemId?: string; - generation?: string; - osDetails?: OSDetails; +export interface HyperVVirtualMachineDetails extends ConfigurationSettings { diskDetails?: DiskDetails[]; - hasPhysicalDisk?: PresenceStatus; + generation?: string; hasFibreChannelAdapter?: PresenceStatus; + hasPhysicalDisk?: PresenceStatus; hasSharedVhd?: PresenceStatus; hyperVHostId?: string; -}; + instanceType: "HyperVVirtualMachine" | "VmmVirtualMachine"; + osDetails?: OSDetails; + sourceItemId?: string; +} // @public (undocumented) export type HyperVVirtualMachineDetailsUnion = HyperVVirtualMachineDetails | VmmVirtualMachineDetails; @@ -1622,10 +1640,10 @@ export interface InitialReplicationDetails { } // @public -export type InlineWorkflowTaskDetails = GroupTaskDetails & { +export interface InlineWorkflowTaskDetails extends GroupTaskDetails { instanceType: "InlineWorkflowTaskDetails"; workflowIds?: string[]; -}; +} // @public export interface InMageAgentDetails { @@ -1636,9 +1654,9 @@ export interface InMageAgentDetails { } // @public -export type InMageAzureV2ApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface InMageAzureV2ApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { instanceType: "InMageAzureV2"; -}; +} // @public export interface InMageAzureV2DiskInputDetails { @@ -1649,55 +1667,55 @@ export interface InMageAzureV2DiskInputDetails { } // @public -export type InMageAzureV2EnableProtectionInput = EnableProtectionProviderSpecificInput & { +export interface InMageAzureV2EnableProtectionInput extends EnableProtectionProviderSpecificInput { + diskEncryptionSetId?: string; + disksToInclude?: InMageAzureV2DiskInputDetails[]; + diskType?: DiskAccountType; + enableRdpOnTargetOption?: string; instanceType: "InMageAzureV2"; + licenseType?: LicenseType; + logStorageAccountId?: string; masterTargetId?: string; - processServerId?: string; - storageAccountId?: string; - runAsAccountId?: string; multiVmGroupId?: string; multiVmGroupName?: string; - disksToInclude?: InMageAzureV2DiskInputDetails[]; + processServerId?: string; + runAsAccountId?: string; + seedManagedDiskTags?: { + [propertyName: string]: string; + }; + sqlServerLicenseType?: SqlServerLicenseType; + storageAccountId?: string; + targetAvailabilitySetId?: string; + targetAvailabilityZone?: string; targetAzureNetworkId?: string; targetAzureSubnetId?: string; - enableRdpOnTargetOption?: string; - targetAzureVmName?: string; - logStorageAccountId?: string; targetAzureV1ResourceGroupId?: string; targetAzureV2ResourceGroupId?: string; - diskType?: DiskAccountType; - targetAvailabilitySetId?: string; - targetAvailabilityZone?: string; - targetProximityPlacementGroupId?: string; - licenseType?: LicenseType; - sqlServerLicenseType?: SqlServerLicenseType; - targetVmSize?: string; - diskEncryptionSetId?: string; - targetVmTags?: { - [propertyName: string]: string; - }; - seedManagedDiskTags?: { - [propertyName: string]: string; - }; + targetAzureVmName?: string; targetManagedDiskTags?: { [propertyName: string]: string; }; targetNicTags?: { [propertyName: string]: string; }; -}; + targetProximityPlacementGroupId?: string; + targetVmSize?: string; + targetVmTags?: { + [propertyName: string]: string; + }; +} // @public -export type InMageAzureV2EventDetails = EventProviderSpecificDetails & { - instanceType: "InMageAzureV2"; - eventType?: string; +export interface InMageAzureV2EventDetails extends EventProviderSpecificDetails { category?: string; component?: string; correctiveAction?: string; details?: string; - summary?: string; + eventType?: string; + instanceType: "InMageAzureV2"; siteName?: string; -}; + summary?: string; +} // @public export interface InMageAzureV2ManagedDiskDetails { @@ -1709,24 +1727,24 @@ export interface InMageAzureV2ManagedDiskDetails { } // @public -export type InMageAzureV2PolicyDetails = PolicyProviderSpecificDetails & { - instanceType: "InMageAzureV2"; - crashConsistentFrequencyInMinutes?: number; - recoveryPointThresholdInMinutes?: number; - recoveryPointHistory?: number; +export interface InMageAzureV2PolicyDetails extends PolicyProviderSpecificDetails { appConsistentFrequencyInMinutes?: number; + crashConsistentFrequencyInMinutes?: number; + instanceType: "InMageAzureV2"; multiVmSyncStatus?: string; -}; + recoveryPointHistory?: number; + recoveryPointThresholdInMinutes?: number; +} // @public -export type InMageAzureV2PolicyInput = PolicyProviderSpecificInput & { - instanceType: "InMageAzureV2"; - recoveryPointThresholdInMinutes?: number; - recoveryPointHistory?: number; - crashConsistentFrequencyInMinutes?: number; +export interface InMageAzureV2PolicyInput extends PolicyProviderSpecificInput { appConsistentFrequencyInMinutes?: number; + crashConsistentFrequencyInMinutes?: number; + instanceType: "InMageAzureV2"; multiVmSyncStatus: SetMultiVmSyncStatus; -}; + recoveryPointHistory?: number; + recoveryPointThresholdInMinutes?: number; +} // @public export interface InMageAzureV2ProtectedDiskDetails { @@ -1756,102 +1774,102 @@ export interface InMageAzureV2ProtectedDiskDetails { } // @public -export type InMageAzureV2RecoveryPointDetails = ProviderSpecificRecoveryPointDetails & { +export interface InMageAzureV2RecoveryPointDetails extends ProviderSpecificRecoveryPointDetails { instanceType: "InMageAzureV2"; isMultiVmSyncPoint?: string; -}; +} // @public -export type InMageAzureV2ReplicationDetails = ReplicationProviderSpecificSettings & { - instanceType: "InMageAzureV2"; - infrastructureVmId?: string; - vCenterInfrastructureId?: string; - protectionStage?: string; - vmId?: string; - vmProtectionState?: string; - vmProtectionStateDescription?: string; - resyncProgressPercentage?: number; - rpoInSeconds?: number; +export interface InMageAzureV2ReplicationDetails extends ReplicationProviderSpecificSettings { + agentExpiryDate?: Date; + agentVersion?: string; + azureVMDiskDetails?: AzureVmDiskDetails[]; + azureVmGeneration?: string; compressedDataRateInMB?: number; - uncompressedDataRateInMB?: number; + datastores?: string[]; + discoveryType?: string; + diskResized?: string; + enableRdpOnTargetOption?: string; + firmwareType?: string; + infrastructureVmId?: string; + instanceType: "InMageAzureV2"; ipAddress?: string; - agentVersion?: string; - agentExpiryDate?: Date; + isAdditionalStatsAvailable?: boolean; isAgentUpdateRequired?: string; isRebootAfterUpdateRequired?: string; lastHeartbeat?: Date; - processServerId?: string; - processServerName?: string; + readonly lastRecoveryPointReceived?: Date; + lastRpoCalculatedTime?: Date; + lastUpdateReceivedTime?: Date; + licenseType?: string; + masterTargetId?: string; multiVmGroupId?: string; multiVmGroupName?: string; multiVmSyncStatus?: string; - protectedDisks?: InMageAzureV2ProtectedDiskDetails[]; - diskResized?: string; - masterTargetId?: string; - sourceVmCpuCount?: number; - sourceVmRamSizeInMB?: number; - osType?: string; - vhdName?: string; osDiskId?: string; - azureVMDiskDetails?: AzureVmDiskDetails[]; - recoveryAzureVMName?: string; - recoveryAzureVMSize?: string; - recoveryAzureStorageAccount?: string; - recoveryAzureLogStorageAccountId?: string; - vmNics?: VMNicDetails[]; - selectedRecoveryAzureNetworkId?: string; - selectedTfoAzureNetworkId?: string; - selectedSourceNicId?: string; - discoveryType?: string; - enableRdpOnTargetOption?: string; - datastores?: string[]; - targetVmId?: string; - recoveryAzureResourceGroupId?: string; - recoveryAvailabilitySetId?: string; - targetAvailabilityZone?: string; - targetProximityPlacementGroupId?: string; - useManagedDisks?: string; - licenseType?: string; - sqlServerLicenseType?: string; - validationErrors?: HealthError[]; - lastRpoCalculatedTime?: Date; - lastUpdateReceivedTime?: Date; - replicaId?: string; + osType?: string; osVersion?: string; + processServerId?: string; + processServerName?: string; + protectedDisks?: InMageAzureV2ProtectedDiskDetails[]; protectedManagedDisks?: InMageAzureV2ManagedDiskDetails[]; - readonly lastRecoveryPointReceived?: Date; - firmwareType?: string; - azureVmGeneration?: string; - isAdditionalStatsAvailable?: boolean; - totalDataTransferred?: number; - totalProgressHealth?: string; - targetVmTags?: { - [propertyName: string]: string; - }; + protectionStage?: string; + recoveryAvailabilitySetId?: string; + recoveryAzureLogStorageAccountId?: string; + recoveryAzureResourceGroupId?: string; + recoveryAzureStorageAccount?: string; + recoveryAzureVMName?: string; + recoveryAzureVMSize?: string; + replicaId?: string; + resyncProgressPercentage?: number; + rpoInSeconds?: number; seedManagedDiskTags?: { [propertyName: string]: string; }; + selectedRecoveryAzureNetworkId?: string; + selectedSourceNicId?: string; + selectedTfoAzureNetworkId?: string; + sourceVmCpuCount?: number; + sourceVmRamSizeInMB?: number; + sqlServerLicenseType?: string; + switchProviderBlockingErrorDetails?: InMageAzureV2SwitchProviderBlockingErrorDetails[]; + switchProviderDetails?: InMageAzureV2SwitchProviderDetails; + targetAvailabilityZone?: string; targetManagedDiskTags?: { [propertyName: string]: string; }; targetNicTags?: { [propertyName: string]: string; }; - switchProviderBlockingErrorDetails?: InMageAzureV2SwitchProviderBlockingErrorDetails[]; - switchProviderDetails?: InMageAzureV2SwitchProviderDetails; -}; + targetProximityPlacementGroupId?: string; + targetVmId?: string; + targetVmTags?: { + [propertyName: string]: string; + }; + totalDataTransferred?: number; + totalProgressHealth?: string; + uncompressedDataRateInMB?: number; + useManagedDisks?: string; + validationErrors?: HealthError[]; + vCenterInfrastructureId?: string; + vhdName?: string; + vmId?: string; + vmNics?: VMNicDetails[]; + vmProtectionState?: string; + vmProtectionStateDescription?: string; +} // @public -export type InMageAzureV2ReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface InMageAzureV2ReprotectInput extends ReverseReplicationProviderSpecificInput { + disksToInclude?: string[]; instanceType: "InMageAzureV2"; + logStorageAccountId?: string; masterTargetId?: string; + policyId?: string; processServerId?: string; - storageAccountId?: string; runAsAccountId?: string; - policyId?: string; - logStorageAccountId?: string; - disksToInclude?: string[]; -}; + storageAccountId?: string; +} // @public export interface InMageAzureV2SwitchProviderBlockingErrorDetails { @@ -1876,60 +1894,60 @@ export interface InMageAzureV2SwitchProviderDetails { } // @public -export type InMageAzureV2SwitchProviderInput = SwitchProviderSpecificInput & { +export interface InMageAzureV2SwitchProviderInput extends SwitchProviderSpecificInput { instanceType: "InMageAzureV2"; - targetVaultID: string; - targetFabricID: string; targetApplianceID: string; -}; + targetFabricID: string; + targetVaultID: string; +} // @public -export type InMageAzureV2TestFailoverInput = TestFailoverProviderSpecificInput & { +export interface InMageAzureV2TestFailoverInput extends TestFailoverProviderSpecificInput { instanceType: "InMageAzureV2"; recoveryPointId?: string; -}; +} // @public -export type InMageAzureV2UnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface InMageAzureV2UnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { instanceType: "InMageAzureV2"; recoveryPointId?: string; -}; +} // @public -export type InMageAzureV2UpdateReplicationProtectedItemInput = UpdateReplicationProtectedItemProviderInput & { +export interface InMageAzureV2UpdateReplicationProtectedItemInput extends UpdateReplicationProtectedItemProviderInput { instanceType: "InMageAzureV2"; recoveryAzureV1ResourceGroupId?: string; recoveryAzureV2ResourceGroupId?: string; - useManagedDisks?: string; - targetProximityPlacementGroupId?: string; + sqlServerLicenseType?: SqlServerLicenseType; targetAvailabilityZone?: string; - targetVmTags?: { - [propertyName: string]: string; - }; targetManagedDiskTags?: { [propertyName: string]: string; }; targetNicTags?: { [propertyName: string]: string; }; - sqlServerLicenseType?: SqlServerLicenseType; + targetProximityPlacementGroupId?: string; + targetVmTags?: { + [propertyName: string]: string; + }; + useManagedDisks?: string; vmDisks?: UpdateDiskInput[]; -}; +} // @public -export type InMageBasePolicyDetails = PolicyProviderSpecificDetails & { - instanceType: "InMageBasePolicyDetails"; - recoveryPointThresholdInMinutes?: number; - recoveryPointHistory?: number; +export interface InMageBasePolicyDetails extends PolicyProviderSpecificDetails { appConsistentFrequencyInMinutes?: number; + instanceType: "InMageBasePolicyDetails"; multiVmSyncStatus?: string; -}; + recoveryPointHistory?: number; + recoveryPointThresholdInMinutes?: number; +} // @public -export type InMageDisableProtectionProviderSpecificInput = DisableProtectionProviderSpecificInput & { +export interface InMageDisableProtectionProviderSpecificInput extends DisableProtectionProviderSpecificInput { instanceType: "InMage"; replicaVmDeletionStatus?: string; -}; +} // @public export interface InMageDiskDetails { @@ -1953,19 +1971,19 @@ export interface InMageDiskSignatureExclusionOptions { } // @public -export type InMageEnableProtectionInput = EnableProtectionProviderSpecificInput & { +export interface InMageEnableProtectionInput extends EnableProtectionProviderSpecificInput { + datastoreName?: string; + diskExclusionInput?: InMageDiskExclusionInput; + disksToInclude?: string[]; instanceType: "InMage"; - vmFriendlyName?: string; masterTargetId: string; + multiVmGroupId: string; + multiVmGroupName: string; processServerId: string; retentionDrive: string; runAsAccountId?: string; - multiVmGroupId: string; - multiVmGroupName: string; - datastoreName?: string; - diskExclusionInput?: InMageDiskExclusionInput; - disksToInclude?: string[]; -}; + vmFriendlyName?: string; +} // @public export interface InMageFabricSwitchProviderBlockingErrorDetails { @@ -1982,22 +2000,22 @@ export interface InMageFabricSwitchProviderBlockingErrorDetails { } // @public -export type InMagePolicyDetails = PolicyProviderSpecificDetails & { - instanceType: "InMage"; - recoveryPointThresholdInMinutes?: number; - recoveryPointHistory?: number; +export interface InMagePolicyDetails extends PolicyProviderSpecificDetails { appConsistentFrequencyInMinutes?: number; + instanceType: "InMage"; multiVmSyncStatus?: string; -}; + recoveryPointHistory?: number; + recoveryPointThresholdInMinutes?: number; +} // @public -export type InMagePolicyInput = PolicyProviderSpecificInput & { - instanceType: "InMage"; - recoveryPointThresholdInMinutes?: number; - recoveryPointHistory?: number; +export interface InMagePolicyInput extends PolicyProviderSpecificInput { appConsistentFrequencyInMinutes?: number; + instanceType: "InMage"; multiVmSyncStatus: SetMultiVmSyncStatus; -}; + recoveryPointHistory?: number; + recoveryPointThresholdInMinutes?: number; +} // @public export interface InMageProtectedDiskDetails { @@ -2055,16 +2073,16 @@ export interface InMageRcmApplianceDetails { } // @public -export type InMageRcmApplianceSpecificDetails = ApplianceSpecificDetails & { - instanceType: "InMageRcm"; +export interface InMageRcmApplianceSpecificDetails extends ApplianceSpecificDetails { readonly appliances?: InMageRcmApplianceDetails[]; -}; + instanceType: "InMageRcm"; +} // @public -export type InMageRcmApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface InMageRcmApplyRecoveryPointInput extends ApplyRecoveryPointProviderSpecificInput { instanceType: "InMageRcm"; recoveryPointId: string; -}; +} // @public export interface InMageRcmDiscoveredProtectedVmDetails { @@ -2098,69 +2116,69 @@ export interface InMageRcmDisksDefaultInput { } // @public -export type InMageRcmEnableProtectionInput = EnableProtectionProviderSpecificInput & { - instanceType: "InMageRcm"; - fabricDiscoveryMachineId: string; - disksToInclude?: InMageRcmDiskInput[]; +export interface InMageRcmEnableProtectionInput extends EnableProtectionProviderSpecificInput { disksDefault?: InMageRcmDisksDefaultInput; - targetResourceGroupId: string; - targetNetworkId?: string; - testNetworkId?: string; - targetSubnetName?: string; - testSubnetName?: string; - targetVmName?: string; - targetVmSize?: string; + disksToInclude?: InMageRcmDiskInput[]; + fabricDiscoveryMachineId: string; + instanceType: "InMageRcm"; licenseType?: LicenseType; + multiVmGroupName?: string; + processServerId: string; + runAsAccountId?: string; targetAvailabilitySetId?: string; targetAvailabilityZone?: string; - targetProximityPlacementGroupId?: string; targetBootDiagnosticsStorageAccountId?: string; - runAsAccountId?: string; - processServerId: string; - multiVmGroupName?: string; -}; + targetNetworkId?: string; + targetProximityPlacementGroupId?: string; + targetResourceGroupId: string; + targetSubnetName?: string; + targetVmName?: string; + targetVmSize?: string; + testNetworkId?: string; + testSubnetName?: string; +} // @public -export type InMageRcmEventDetails = EventProviderSpecificDetails & { +export interface InMageRcmEventDetails extends EventProviderSpecificDetails { + readonly applianceName?: string; + readonly componentDisplayName?: string; + readonly fabricName?: string; instanceType: "InMageRcm"; - readonly protectedItemName?: string; - readonly vmName?: string; - readonly latestAgentVersion?: string; readonly jobId?: string; - readonly fabricName?: string; - readonly applianceName?: string; + readonly latestAgentVersion?: string; + readonly protectedItemName?: string; readonly serverType?: string; - readonly componentDisplayName?: string; -}; + readonly vmName?: string; +} // @public -export type InMageRcmFabricCreationInput = FabricSpecificCreationInput & { +export interface InMageRcmFabricCreationInput extends FabricSpecificCreationInput { instanceType: "InMageRcm"; - vmwareSiteId: string; physicalSiteId: string; sourceAgentIdentity: IdentityProviderInput; -}; + vmwareSiteId: string; +} // @public -export type InMageRcmFabricSpecificDetails = FabricSpecificDetails & { +export interface InMageRcmFabricSpecificDetails extends FabricSpecificDetails { + readonly agentDetails?: AgentDetails[]; + readonly controlPlaneUri?: string; + readonly dataPlaneUri?: string; + readonly dras?: DraDetails[]; instanceType: "InMageRcm"; - readonly vmwareSiteId?: string; + readonly marsAgents?: MarsAgentDetails[]; readonly physicalSiteId?: string; - readonly serviceEndpoint?: string; - readonly serviceResourceId?: string; - readonly serviceContainerId?: string; - readonly dataPlaneUri?: string; - readonly controlPlaneUri?: string; - sourceAgentIdentityDetails?: IdentityProviderDetails; readonly processServers?: ProcessServerDetails[]; - readonly rcmProxies?: RcmProxyDetails[]; readonly pushInstallers?: PushInstallerDetails[]; + readonly rcmProxies?: RcmProxyDetails[]; readonly replicationAgents?: ReplicationAgentDetails[]; readonly reprotectAgents?: ReprotectAgentDetails[]; - readonly marsAgents?: MarsAgentDetails[]; - readonly dras?: DraDetails[]; - readonly agentDetails?: AgentDetails[]; -}; + readonly serviceContainerId?: string; + readonly serviceEndpoint?: string; + readonly serviceResourceId?: string; + sourceAgentIdentityDetails?: IdentityProviderDetails; + readonly vmwareSiteId?: string; +} // @public export interface InMageRcmFabricSwitchProviderBlockingErrorDetails { @@ -2193,14 +2211,14 @@ export interface InMageRcmFailbackDiscoveredProtectedVmDetails { } // @public -export type InMageRcmFailbackEventDetails = EventProviderSpecificDetails & { +export interface InMageRcmFailbackEventDetails extends EventProviderSpecificDetails { + readonly applianceName?: string; + readonly componentDisplayName?: string; instanceType: "InMageRcmFailback"; readonly protectedItemName?: string; - readonly vmName?: string; - readonly applianceName?: string; readonly serverType?: string; - readonly componentDisplayName?: string; -}; + readonly vmName?: string; +} // @public export interface InMageRcmFailbackMobilityAgentDetails { @@ -2224,24 +2242,24 @@ export interface InMageRcmFailbackNicDetails { } // @public -export type InMageRcmFailbackPlannedFailoverProviderInput = PlannedFailoverProviderSpecificFailoverInput & { +export interface InMageRcmFailbackPlannedFailoverProviderInput extends PlannedFailoverProviderSpecificFailoverInput { instanceType: "InMageRcmFailback"; recoveryPointType: InMageRcmFailbackRecoveryPointType; -}; +} // @public -export type InMageRcmFailbackPolicyCreationInput = PolicyProviderSpecificInput & { - instanceType: "InMageRcmFailback"; - crashConsistentFrequencyInMinutes?: number; +export interface InMageRcmFailbackPolicyCreationInput extends PolicyProviderSpecificInput { appConsistentFrequencyInMinutes?: number; -}; + crashConsistentFrequencyInMinutes?: number; + instanceType: "InMageRcmFailback"; +} // @public -export type InMageRcmFailbackPolicyDetails = PolicyProviderSpecificDetails & { - instanceType: "InMageRcmFailback"; +export interface InMageRcmFailbackPolicyDetails extends PolicyProviderSpecificDetails { appConsistentFrequencyInMinutes?: number; crashConsistentFrequencyInMinutes?: number; -}; + instanceType: "InMageRcmFailback"; +} // @public export interface InMageRcmFailbackProtectedDiskDetails { @@ -2262,46 +2280,46 @@ export interface InMageRcmFailbackProtectedDiskDetails { export type InMageRcmFailbackRecoveryPointType = string; // @public -export type InMageRcmFailbackReplicationDetails = ReplicationProviderSpecificSettings & { +export interface InMageRcmFailbackReplicationDetails extends ReplicationProviderSpecificSettings { + readonly azureVirtualMachineId?: string; + discoveredVmDetails?: InMageRcmFailbackDiscoveredProtectedVmDetails; + readonly initialReplicationProcessedBytes?: number; + readonly initialReplicationProgressHealth?: VmReplicationProgressHealth; + readonly initialReplicationProgressPercentage?: number; + readonly initialReplicationTransferredBytes?: number; instanceType: "InMageRcmFailback"; readonly internalIdentifier?: string; - readonly azureVirtualMachineId?: string; + readonly isAgentRegistrationSuccessfulAfterFailover?: boolean; + readonly lastPlannedFailoverStartTime?: Date; + readonly lastPlannedFailoverStatus?: PlannedFailoverStatus; + readonly lastUsedPolicyFriendlyName?: string; + readonly lastUsedPolicyId?: string; + readonly logStorageAccountId?: string; + mobilityAgentDetails?: InMageRcmFailbackMobilityAgentDetails; readonly multiVmGroupName?: string; + readonly osType?: string; + protectedDisks?: InMageRcmFailbackProtectedDiskDetails[]; readonly reprotectAgentId?: string; readonly reprotectAgentName?: string; - readonly osType?: string; - readonly logStorageAccountId?: string; - readonly targetvCenterId?: string; - readonly targetDataStoreName?: string; - readonly targetVmName?: string; - readonly initialReplicationProgressPercentage?: number; - readonly initialReplicationProcessedBytes?: number; - readonly initialReplicationTransferredBytes?: number; - readonly initialReplicationProgressHealth?: VmReplicationProgressHealth; - readonly resyncProgressPercentage?: number; readonly resyncProcessedBytes?: number; - readonly resyncTransferredBytes?: number; readonly resyncProgressHealth?: VmReplicationProgressHealth; + readonly resyncProgressPercentage?: number; readonly resyncRequired?: string; readonly resyncState?: ResyncState; - protectedDisks?: InMageRcmFailbackProtectedDiskDetails[]; - mobilityAgentDetails?: InMageRcmFailbackMobilityAgentDetails; + readonly resyncTransferredBytes?: number; + readonly targetDataStoreName?: string; + readonly targetvCenterId?: string; + readonly targetVmName?: string; vmNics?: InMageRcmFailbackNicDetails[]; - readonly lastPlannedFailoverStartTime?: Date; - readonly lastPlannedFailoverStatus?: PlannedFailoverStatus; - discoveredVmDetails?: InMageRcmFailbackDiscoveredProtectedVmDetails; - readonly lastUsedPolicyId?: string; - readonly lastUsedPolicyFriendlyName?: string; - readonly isAgentRegistrationSuccessfulAfterFailover?: boolean; -}; +} // @public -export type InMageRcmFailbackReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface InMageRcmFailbackReprotectInput extends ReverseReplicationProviderSpecificInput { instanceType: "InMageRcmFailback"; + policyId: string; processServerId: string; runAsAccountId?: string; - policyId: string; -}; +} // @public export interface InMageRcmFailbackSyncDetails { @@ -2372,22 +2390,22 @@ export interface InMageRcmNicInput { } // @public -export type InMageRcmPolicyCreationInput = PolicyProviderSpecificInput & { - instanceType: "InMageRcm"; - recoveryPointHistoryInMinutes?: number; - crashConsistentFrequencyInMinutes?: number; +export interface InMageRcmPolicyCreationInput extends PolicyProviderSpecificInput { appConsistentFrequencyInMinutes?: number; + crashConsistentFrequencyInMinutes?: number; enableMultiVmSync?: string; -}; - -// @public -export type InMageRcmPolicyDetails = PolicyProviderSpecificDetails & { instanceType: "InMageRcm"; recoveryPointHistoryInMinutes?: number; +} + +// @public +export interface InMageRcmPolicyDetails extends PolicyProviderSpecificDetails { appConsistentFrequencyInMinutes?: number; crashConsistentFrequencyInMinutes?: number; enableMultiVmSync?: string; -}; + instanceType: "InMageRcm"; + recoveryPointHistoryInMinutes?: number; +} // @public export interface InMageRcmProtectedDiskDetails { @@ -2403,86 +2421,88 @@ export interface InMageRcmProtectedDiskDetails { readonly isOSDisk?: string; readonly logStorageAccountId?: string; resyncDetails?: InMageRcmSyncDetails; + readonly seedBlobUri?: string; readonly seedManagedDiskId?: string; readonly targetManagedDiskId?: string; } // @public -export type InMageRcmProtectionContainerMappingDetails = ProtectionContainerMappingProviderSpecificDetails & { - instanceType: "InMageRcm"; +export interface InMageRcmProtectionContainerMappingDetails extends ProtectionContainerMappingProviderSpecificDetails { readonly enableAgentAutoUpgrade?: string; -}; + instanceType: "InMageRcm"; +} // @public -export type InMageRcmRecoveryPointDetails = ProviderSpecificRecoveryPointDetails & { +export interface InMageRcmRecoveryPointDetails extends ProviderSpecificRecoveryPointDetails { instanceType: "InMageRcm"; readonly isMultiVmSyncPoint?: string; -}; +} // @public -export type InMageRcmReplicationDetails = ReplicationProviderSpecificSettings & { +export interface InMageRcmReplicationDetails extends ReplicationProviderSpecificSettings { + readonly agentUpgradeAttemptToVersion?: string; + agentUpgradeBlockingErrorDetails?: InMageRcmAgentUpgradeBlockingErrorDetails[]; + readonly agentUpgradeJobId?: string; + readonly agentUpgradeState?: MobilityAgentUpgradeState; + readonly allocatedMemoryInMB?: number; + discoveredVmDetails?: InMageRcmDiscoveredProtectedVmDetails; + readonly discoveryType?: string; + readonly fabricDiscoveryMachineId?: string; + readonly failoverRecoveryPointId?: string; + readonly firmwareType?: string; + readonly initialReplicationProcessedBytes?: number; + readonly initialReplicationProgressHealth?: VmReplicationProgressHealth; + readonly initialReplicationProgressPercentage?: number; + readonly initialReplicationTransferredBytes?: number; instanceType: "InMageRcm"; readonly internalIdentifier?: string; - readonly fabricDiscoveryMachineId?: string; + readonly isAgentRegistrationSuccessfulAfterFailover?: boolean; + readonly isLastUpgradeSuccessful?: string; + lastAgentUpgradeErrorDetails?: InMageRcmLastAgentUpgradeErrorDetails[]; + readonly lastAgentUpgradeType?: string; + readonly lastRecoveryPointId?: string; + readonly lastRecoveryPointReceived?: Date; + readonly lastRpoCalculatedTime?: Date; + readonly lastRpoInSeconds?: number; + licenseType?: string; + mobilityAgentDetails?: InMageRcmMobilityAgentDetails; readonly multiVmGroupName?: string; - readonly discoveryType?: string; - readonly processServerId?: string; + readonly osType?: string; + readonly primaryNicIpAddress?: string; readonly processorCoreCount?: number; - readonly allocatedMemoryInMB?: number; + readonly processServerId?: string; readonly processServerName?: string; + protectedDisks?: InMageRcmProtectedDiskDetails[]; + readonly resyncProcessedBytes?: number; + readonly resyncProgressHealth?: VmReplicationProgressHealth; + readonly resyncProgressPercentage?: number; + readonly resyncRequired?: string; + readonly resyncState?: ResyncState; + readonly resyncTransferredBytes?: number; readonly runAsAccountId?: string; - readonly osType?: string; - readonly firmwareType?: string; - readonly primaryNicIpAddress?: string; - readonly targetGeneration?: string; - licenseType?: string; - targetVmName?: string; - targetVmSize?: string; - targetResourceGroupId?: string; - targetLocation?: string; + readonly storageAccountId?: string; targetAvailabilitySetId?: string; targetAvailabilityZone?: string; - targetProximityPlacementGroupId?: string; targetBootDiagnosticsStorageAccountId?: string; + readonly targetGeneration?: string; + targetLocation?: string; targetNetworkId?: string; + targetProximityPlacementGroupId?: string; + targetResourceGroupId?: string; + targetVmName?: string; + targetVmSize?: string; testNetworkId?: string; - readonly failoverRecoveryPointId?: string; - readonly lastRecoveryPointReceived?: Date; - readonly lastRpoInSeconds?: number; - readonly lastRpoCalculatedTime?: Date; - readonly lastRecoveryPointId?: string; - readonly initialReplicationProgressPercentage?: number; - readonly initialReplicationProcessedBytes?: number; - readonly initialReplicationTransferredBytes?: number; - readonly initialReplicationProgressHealth?: VmReplicationProgressHealth; - readonly resyncProgressPercentage?: number; - readonly resyncProcessedBytes?: number; - readonly resyncTransferredBytes?: number; - readonly resyncProgressHealth?: VmReplicationProgressHealth; - readonly resyncRequired?: string; - readonly resyncState?: ResyncState; - readonly agentUpgradeState?: MobilityAgentUpgradeState; - readonly lastAgentUpgradeType?: string; - readonly agentUpgradeJobId?: string; - readonly agentUpgradeAttemptToVersion?: string; - protectedDisks?: InMageRcmProtectedDiskDetails[]; - readonly isLastUpgradeSuccessful?: string; - readonly isAgentRegistrationSuccessfulAfterFailover?: boolean; - mobilityAgentDetails?: InMageRcmMobilityAgentDetails; - lastAgentUpgradeErrorDetails?: InMageRcmLastAgentUpgradeErrorDetails[]; - agentUpgradeBlockingErrorDetails?: InMageRcmAgentUpgradeBlockingErrorDetails[]; vmNics?: InMageRcmNicDetails[]; - discoveredVmDetails?: InMageRcmDiscoveredProtectedVmDetails; -}; +} // @public -export type InMageRcmReprotectInput = ReverseReplicationProviderSpecificInput & { - instanceType: "InMageRcm"; - reprotectAgentId: string; +export interface InMageRcmReprotectInput extends ReverseReplicationProviderSpecificInput { datastoreName: string; + instanceType: "InMageRcm"; logStorageAccountId: string; policyId?: string; -}; + reprotectAgentId: string; +} // @public export interface InMageRcmSyncDetails { @@ -2497,120 +2517,120 @@ export interface InMageRcmSyncDetails { } // @public -export type InMageRcmTestFailoverInput = TestFailoverProviderSpecificInput & { +export interface InMageRcmTestFailoverInput extends TestFailoverProviderSpecificInput { instanceType: "InMageRcm"; networkId?: string; recoveryPointId?: string; -}; +} // @public -export type InMageRcmUnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface InMageRcmUnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { instanceType: "InMageRcm"; performShutdown: string; recoveryPointId?: string; -}; +} // @public -export type InMageRcmUpdateApplianceForReplicationProtectedItemInput = UpdateApplianceForReplicationProtectedItemProviderSpecificInput & { +export interface InMageRcmUpdateApplianceForReplicationProtectedItemInput extends UpdateApplianceForReplicationProtectedItemProviderSpecificInput { instanceType: "InMageRcm"; runAsAccountId?: string; -}; +} // @public -export type InMageRcmUpdateContainerMappingInput = ReplicationProviderSpecificUpdateContainerMappingInput & { - instanceType: "InMageRcm"; +export interface InMageRcmUpdateContainerMappingInput extends ReplicationProviderSpecificUpdateContainerMappingInput { enableAgentAutoUpgrade: string; -}; + instanceType: "InMageRcm"; +} // @public -export type InMageRcmUpdateReplicationProtectedItemInput = UpdateReplicationProtectedItemProviderInput & { +export interface InMageRcmUpdateReplicationProtectedItemInput extends UpdateReplicationProtectedItemProviderInput { instanceType: "InMageRcm"; - targetVmName?: string; - targetVmSize?: string; - targetResourceGroupId?: string; + licenseType?: LicenseType; targetAvailabilitySetId?: string; targetAvailabilityZone?: string; - targetProximityPlacementGroupId?: string; targetBootDiagnosticsStorageAccountId?: string; targetNetworkId?: string; + targetProximityPlacementGroupId?: string; + targetResourceGroupId?: string; + targetVmName?: string; + targetVmSize?: string; testNetworkId?: string; vmNics?: InMageRcmNicInput[]; - licenseType?: LicenseType; -}; +} // @public -export type InMageReplicationDetails = ReplicationProviderSpecificSettings & { - instanceType: "InMage"; +export interface InMageReplicationDetails extends ReplicationProviderSpecificSettings { activeSiteType?: string; - sourceVmCpuCount?: number; - sourceVmRamSizeInMB?: number; - osDetails?: OSDiskDetails; - protectionStage?: string; - vmId?: string; - vmProtectionState?: string; - vmProtectionStateDescription?: string; - resyncDetails?: InitialReplicationDetails; - retentionWindowStart?: Date; - retentionWindowEnd?: Date; + agentDetails?: InMageAgentDetails; + azureStorageAccountId?: string; compressedDataRateInMB?: number; - uncompressedDataRateInMB?: number; - rpoInSeconds?: number; - protectedDisks?: InMageProtectedDiskDetails[]; - ipAddress?: string; - lastHeartbeat?: Date; - processServerId?: string; - masterTargetId?: string; consistencyPoints?: { [propertyName: string]: Date; }; + datastores?: string[]; + discoveryType?: string; diskResized?: string; - rebootAfterUpdateStatus?: string; - multiVmGroupId?: string; - multiVmGroupName?: string; - multiVmSyncStatus?: string; - agentDetails?: InMageAgentDetails; - vCenterInfrastructureId?: string; infrastructureVmId?: string; - vmNics?: VMNicDetails[]; - discoveryType?: string; - azureStorageAccountId?: string; - datastores?: string[]; - validationErrors?: HealthError[]; + instanceType: "InMage"; + ipAddress?: string; + isAdditionalStatsAvailable?: boolean; + lastHeartbeat?: Date; lastRpoCalculatedTime?: Date; lastUpdateReceivedTime?: Date; - replicaId?: string; + masterTargetId?: string; + multiVmGroupId?: string; + multiVmGroupName?: string; + multiVmSyncStatus?: string; + osDetails?: OSDiskDetails; osVersion?: string; - isAdditionalStatsAvailable?: boolean; + processServerId?: string; + protectedDisks?: InMageProtectedDiskDetails[]; + protectionStage?: string; + rebootAfterUpdateStatus?: string; + replicaId?: string; + resyncDetails?: InitialReplicationDetails; + retentionWindowEnd?: Date; + retentionWindowStart?: Date; + rpoInSeconds?: number; + sourceVmCpuCount?: number; + sourceVmRamSizeInMB?: number; totalDataTransferred?: number; totalProgressHealth?: string; -}; + uncompressedDataRateInMB?: number; + validationErrors?: HealthError[]; + vCenterInfrastructureId?: string; + vmId?: string; + vmNics?: VMNicDetails[]; + vmProtectionState?: string; + vmProtectionStateDescription?: string; +} // @public -export type InMageReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface InMageReprotectInput extends ReverseReplicationProviderSpecificInput { + datastoreName?: string; + diskExclusionInput?: InMageDiskExclusionInput; + disksToInclude?: string[]; instanceType: "InMage"; masterTargetId: string; processServerId: string; + profileId: string; retentionDrive: string; runAsAccountId?: string; - datastoreName?: string; - diskExclusionInput?: InMageDiskExclusionInput; - profileId: string; - disksToInclude?: string[]; -}; +} // @public -export type InMageTestFailoverInput = TestFailoverProviderSpecificInput & { +export interface InMageTestFailoverInput extends TestFailoverProviderSpecificInput { instanceType: "InMage"; - recoveryPointType?: RecoveryPointType; recoveryPointId?: string; -}; + recoveryPointType?: RecoveryPointType; +} // @public -export type InMageUnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface InMageUnplannedFailoverInput extends UnplannedFailoverProviderSpecificInput { instanceType: "InMage"; - recoveryPointType?: RecoveryPointType; recoveryPointId?: string; -}; + recoveryPointType?: RecoveryPointType; +} // @public export type InMageV2RpRecoveryPointType = string; @@ -2712,9 +2732,9 @@ export interface IPConfigInputDetails { } // @public -export type Job = Resource & { +export interface Job extends Resource { properties?: JobProperties; -}; +} // @public export interface JobCollection { @@ -2783,19 +2803,19 @@ export interface JobQueryParameter { } // @public -export type JobStatusEventDetails = EventSpecificDetails & { +export interface JobStatusEventDetails extends EventSpecificDetails { + affectedObjectType?: string; instanceType: "JobStatus"; - jobId?: string; jobFriendlyName?: string; + jobId?: string; jobStatus?: string; - affectedObjectType?: string; -}; +} // @public -export type JobTaskDetails = TaskTypeDetails & { +export interface JobTaskDetails extends TaskTypeDetails { instanceType: "JobTaskDetails" | "FabricReplicationGroupTaskDetails" | "VirtualMachineTaskDetails"; jobTask?: JobEntity; -}; +} // @public (undocumented) export type JobTaskDetailsUnion = JobTaskDetails | FabricReplicationGroupTaskDetails | VirtualMachineTaskDetails; @@ -2808,557 +2828,385 @@ export interface KeyEncryptionKeyInfo { // @public export enum KnownA2ARecoveryAvailabilityType { - // (undocumented) AvailabilitySet = "AvailabilitySet", - // (undocumented) AvailabilityZone = "AvailabilityZone", - // (undocumented) Single = "Single" } // @public export enum KnownA2ARpRecoveryPointType { - // (undocumented) Latest = "Latest", - // (undocumented) LatestApplicationConsistent = "LatestApplicationConsistent", - // (undocumented) LatestCrashConsistent = "LatestCrashConsistent", - // (undocumented) LatestProcessed = "LatestProcessed" } // @public export enum KnownAgentAutoUpdateStatus { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public export enum KnownAgentUpgradeBlockedReason { - // (undocumented) AgentNoHeartbeat = "AgentNoHeartbeat", - // (undocumented) AlreadyOnLatestVersion = "AlreadyOnLatestVersion", - // (undocumented) DistroIsNotReported = "DistroIsNotReported", - // (undocumented) DistroNotSupportedForUpgrade = "DistroNotSupportedForUpgrade", - // (undocumented) IncompatibleApplianceVersion = "IncompatibleApplianceVersion", - // (undocumented) InvalidAgentVersion = "InvalidAgentVersion", - // (undocumented) InvalidDriverVersion = "InvalidDriverVersion", - // (undocumented) MissingUpgradePath = "MissingUpgradePath", - // (undocumented) NotProtected = "NotProtected", - // (undocumented) ProcessServerNoHeartbeat = "ProcessServerNoHeartbeat", - // (undocumented) RcmProxyNoHeartbeat = "RcmProxyNoHeartbeat", - // (undocumented) RebootRequired = "RebootRequired", - // (undocumented) Unknown = "Unknown", - // (undocumented) UnsupportedProtectionScenario = "UnsupportedProtectionScenario" } // @public export enum KnownAgentVersionStatus { - // (undocumented) Deprecated = "Deprecated", - // (undocumented) NotSupported = "NotSupported", - // (undocumented) SecurityUpdateRequired = "SecurityUpdateRequired", - // (undocumented) Supported = "Supported", - // (undocumented) UpdateRequired = "UpdateRequired" } // @public export enum KnownAlternateLocationRecoveryOption { - // (undocumented) CreateVmIfNotFound = "CreateVmIfNotFound", - // (undocumented) NoAction = "NoAction" } // @public export enum KnownAutomationAccountAuthenticationType { - // (undocumented) RunAsAccount = "RunAsAccount", - // (undocumented) SystemAssignedIdentity = "SystemAssignedIdentity" } // @public export enum KnownAutoProtectionOfDataDisk { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public export enum KnownDataSyncStatus { - // (undocumented) ForDownTime = "ForDownTime", - // (undocumented) ForSynchronization = "ForSynchronization" } // @public export enum KnownDisableProtectionReason { - // (undocumented) MigrationComplete = "MigrationComplete", - // (undocumented) NotSpecified = "NotSpecified" } // @public export enum KnownDiskAccountType { - // (undocumented) PremiumLRS = "Premium_LRS", - // (undocumented) StandardLRS = "Standard_LRS", - // (undocumented) StandardSSDLRS = "StandardSSD_LRS" } // @public export enum KnownDiskReplicationProgressHealth { - // (undocumented) InProgress = "InProgress", - // (undocumented) None = "None", - // (undocumented) NoProgress = "NoProgress", - // (undocumented) Queued = "Queued", - // (undocumented) SlowProgress = "SlowProgress" } // @public export enum KnownEthernetAddressType { - // (undocumented) Dynamic = "Dynamic", - // (undocumented) Static = "Static" } // @public export enum KnownExportJobOutputSerializationType { - // (undocumented) Excel = "Excel", - // (undocumented) Json = "Json", - // (undocumented) Xml = "Xml" } // @public export enum KnownExtendedLocationType { - // (undocumented) EdgeZone = "EdgeZone" } // @public export enum KnownFailoverDeploymentModel { - // (undocumented) Classic = "Classic", - // (undocumented) NotApplicable = "NotApplicable", - // (undocumented) ResourceManager = "ResourceManager" } // @public export enum KnownHealthErrorCategory { - // (undocumented) AgentAutoUpdateArtifactDeleted = "AgentAutoUpdateArtifactDeleted", - // (undocumented) AgentAutoUpdateInfra = "AgentAutoUpdateInfra", - // (undocumented) AgentAutoUpdateRunAsAccount = "AgentAutoUpdateRunAsAccount", - // (undocumented) AgentAutoUpdateRunAsAccountExpired = "AgentAutoUpdateRunAsAccountExpired", - // (undocumented) AgentAutoUpdateRunAsAccountExpiry = "AgentAutoUpdateRunAsAccountExpiry", - // (undocumented) Configuration = "Configuration", - // (undocumented) FabricInfrastructure = "FabricInfrastructure", - // (undocumented) None = "None", - // (undocumented) Replication = "Replication", - // (undocumented) TestFailover = "TestFailover", - // (undocumented) VersionExpiry = "VersionExpiry" } // @public export enum KnownHealthErrorCustomerResolvability { - // (undocumented) Allowed = "Allowed", - // (undocumented) NotAllowed = "NotAllowed" } // @public export enum KnownHyperVReplicaAzureRpRecoveryPointType { - // (undocumented) Latest = "Latest", - // (undocumented) LatestApplicationConsistent = "LatestApplicationConsistent", - // (undocumented) LatestProcessed = "LatestProcessed" } // @public export enum KnownInMageRcmFailbackRecoveryPointType { - // (undocumented) ApplicationConsistent = "ApplicationConsistent", - // (undocumented) CrashConsistent = "CrashConsistent" } // @public export enum KnownInMageV2RpRecoveryPointType { - // (undocumented) Latest = "Latest", - // (undocumented) LatestApplicationConsistent = "LatestApplicationConsistent", - // (undocumented) LatestCrashConsistent = "LatestCrashConsistent", - // (undocumented) LatestProcessed = "LatestProcessed" } // @public export enum KnownLicenseType { - // (undocumented) NoLicenseType = "NoLicenseType", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) WindowsServer = "WindowsServer" } // @public export enum KnownMigrationItemOperation { - // (undocumented) DisableMigration = "DisableMigration", - // (undocumented) Migrate = "Migrate", - // (undocumented) + PauseReplication = "PauseReplication", + ResumeReplication = "ResumeReplication", StartResync = "StartResync", - // (undocumented) TestMigrate = "TestMigrate", - // (undocumented) TestMigrateCleanup = "TestMigrateCleanup" } // @public export enum KnownMigrationRecoveryPointType { - // (undocumented) ApplicationConsistent = "ApplicationConsistent", - // (undocumented) CrashConsistent = "CrashConsistent", - // (undocumented) NotSpecified = "NotSpecified" } // @public export enum KnownMigrationState { - // (undocumented) DisableMigrationFailed = "DisableMigrationFailed", - // (undocumented) DisableMigrationInProgress = "DisableMigrationInProgress", - // (undocumented) EnableMigrationFailed = "EnableMigrationFailed", - // (undocumented) EnableMigrationInProgress = "EnableMigrationInProgress", - // (undocumented) InitialSeedingFailed = "InitialSeedingFailed", - // (undocumented) InitialSeedingInProgress = "InitialSeedingInProgress", - // (undocumented) + MigrationCompletedWithInformation = "MigrationCompletedWithInformation", MigrationFailed = "MigrationFailed", - // (undocumented) MigrationInProgress = "MigrationInProgress", - // (undocumented) + MigrationPartiallySucceeded = "MigrationPartiallySucceeded", MigrationSucceeded = "MigrationSucceeded", - // (undocumented) None = "None", - // (undocumented) - Replicating = "Replicating" + ProtectionSuspended = "ProtectionSuspended", + Replicating = "Replicating", + ResumeInitiated = "ResumeInitiated", + ResumeInProgress = "ResumeInProgress", + SuspendingProtection = "SuspendingProtection" } // @public export enum KnownMobilityAgentUpgradeState { - // (undocumented) Commit = "Commit", - // (undocumented) Completed = "Completed", - // (undocumented) None = "None", - // (undocumented) Started = "Started" } // @public export enum KnownMultiVmGroupCreateOption { - // (undocumented) AutoCreated = "AutoCreated", - // (undocumented) UserSpecified = "UserSpecified" } // @public export enum KnownMultiVmSyncPointOption { - // (undocumented) UseMultiVmSyncRecoveryPoint = "UseMultiVmSyncRecoveryPoint", - // (undocumented) UsePerVmRecoveryPoint = "UsePerVmRecoveryPoint" } // @public export enum KnownPlannedFailoverStatus { - // (undocumented) Cancelled = "Cancelled", - // (undocumented) Failed = "Failed", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Unknown = "Unknown" } // @public export enum KnownPossibleOperationsDirections { - // (undocumented) PrimaryToRecovery = "PrimaryToRecovery", - // (undocumented) RecoveryToPrimary = "RecoveryToPrimary" } // @public export enum KnownPresenceStatus { - // (undocumented) NotPresent = "NotPresent", - // (undocumented) Present = "Present", - // (undocumented) Unknown = "Unknown" } // @public export enum KnownProtectionHealth { - // (undocumented) Critical = "Critical", - // (undocumented) None = "None", - // (undocumented) Normal = "Normal", - // (undocumented) Warning = "Warning" } // @public export enum KnownRcmComponentStatus { - // (undocumented) Critical = "Critical", - // (undocumented) Healthy = "Healthy", - // (undocumented) Unknown = "Unknown", - // (undocumented) Warning = "Warning" } // @public export enum KnownRecoveryPlanActionLocation { - // (undocumented) Primary = "Primary", - // (undocumented) Recovery = "Recovery" } // @public export enum KnownRecoveryPlanGroupType { - // (undocumented) Boot = "Boot", - // (undocumented) Failover = "Failover", - // (undocumented) Shutdown = "Shutdown" } // @public export enum KnownRecoveryPlanPointType { - // (undocumented) Latest = "Latest", - // (undocumented) LatestApplicationConsistent = "LatestApplicationConsistent", - // (undocumented) LatestCrashConsistent = "LatestCrashConsistent", - // (undocumented) LatestProcessed = "LatestProcessed" } // @public export enum KnownRecoveryPointSyncType { - // (undocumented) MultiVmSyncRecoveryPoint = "MultiVmSyncRecoveryPoint", - // (undocumented) PerVmRecoveryPoint = "PerVmRecoveryPoint" } // @public export enum KnownRecoveryPointType { - // (undocumented) Custom = "Custom", - // (undocumented) LatestTag = "LatestTag", - // (undocumented) LatestTime = "LatestTime" } // @public export enum KnownReplicationProtectedItemOperation { - // (undocumented) CancelFailover = "CancelFailover", - // (undocumented) ChangePit = "ChangePit", - // (undocumented) Commit = "Commit", - // (undocumented) CompleteMigration = "CompleteMigration", - // (undocumented) DisableProtection = "DisableProtection", - // (undocumented) Failback = "Failback", - // (undocumented) FinalizeFailback = "FinalizeFailback", - // (undocumented) PlannedFailover = "PlannedFailover", - // (undocumented) RepairReplication = "RepairReplication", - // (undocumented) ReverseReplicate = "ReverseReplicate", - // (undocumented) SwitchProtection = "SwitchProtection", - // (undocumented) TestFailover = "TestFailover", - // (undocumented) TestFailoverCleanup = "TestFailoverCleanup", - // (undocumented) UnplannedFailover = "UnplannedFailover" } // @public export enum KnownResyncState { - // (undocumented) None = "None", - // (undocumented) PreparedForResynchronization = "PreparedForResynchronization", - // (undocumented) StartedResynchronization = "StartedResynchronization" } // @public export enum KnownRpInMageRecoveryPointType { - // (undocumented) Custom = "Custom", - // (undocumented) LatestTag = "LatestTag", - // (undocumented) LatestTime = "LatestTime" } // @public export enum KnownSetMultiVmSyncStatus { - // (undocumented) Disable = "Disable", - // (undocumented) Enable = "Enable" } // @public export enum KnownSeverity { - // (undocumented) Error = "Error", - // (undocumented) Info = "Info", - // (undocumented) None = "NONE", - // (undocumented) Warning = "Warning" } // @public export enum KnownSourceSiteOperations { - // (undocumented) NotRequired = "NotRequired", - // (undocumented) Required = "Required" } // @public export enum KnownSqlServerLicenseType { - // (undocumented) Ahub = "AHUB", - // (undocumented) NoLicenseType = "NoLicenseType", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) Payg = "PAYG" } // @public export enum KnownTestMigrationState { - // (undocumented) None = "None", - // (undocumented) TestMigrationCleanupInProgress = "TestMigrationCleanupInProgress", - // (undocumented) + TestMigrationCompletedWithInformation = "TestMigrationCompletedWithInformation", TestMigrationFailed = "TestMigrationFailed", - // (undocumented) TestMigrationInProgress = "TestMigrationInProgress", - // (undocumented) + TestMigrationPartiallySucceeded = "TestMigrationPartiallySucceeded", TestMigrationSucceeded = "TestMigrationSucceeded" } // @public export enum KnownVmEncryptionType { - // (undocumented) NotEncrypted = "NotEncrypted", - // (undocumented) OnePassEncrypted = "OnePassEncrypted", - // (undocumented) TwoPassEncrypted = "TwoPassEncrypted" } // @public export enum KnownVmReplicationProgressHealth { - // (undocumented) InProgress = "InProgress", - // (undocumented) None = "None", - // (undocumented) NoProgress = "NoProgress", - // (undocumented) SlowProgress = "SlowProgress" } @@ -3366,9 +3214,9 @@ export enum KnownVmReplicationProgressHealth { export type LicenseType = string; // @public -export type LogicalNetwork = Resource & { +export interface LogicalNetwork extends Resource { properties?: LogicalNetworkProperties; -}; +} // @public export interface LogicalNetworkCollection { @@ -3385,12 +3233,12 @@ export interface LogicalNetworkProperties { } // @public -export type ManualActionTaskDetails = TaskTypeDetails & { +export interface ManualActionTaskDetails extends TaskTypeDetails { instanceType: "ManualActionTaskDetails"; - name?: string; instructions?: string; + name?: string; observation?: string; -}; +} // @public export interface MarsAgentDetails { @@ -3446,9 +3294,9 @@ export interface MigrateProviderSpecificInput { export type MigrateProviderSpecificInputUnion = MigrateProviderSpecificInput | VMwareCbtMigrateInput; // @public -export type MigrationItem = Resource & { +export interface MigrationItem extends Resource { properties?: MigrationItemProperties; -}; +} // @public export interface MigrationItemCollection { @@ -3462,10 +3310,13 @@ export type MigrationItemOperation = string; // @public export interface MigrationItemProperties { readonly allowedOperations?: MigrationItemOperation[]; + readonly criticalJobHistory?: CriticalJobHistoryDetails[]; readonly currentJob?: CurrentJobDetails; readonly eventCorrelationId?: string; readonly health?: ProtectionHealth; readonly healthErrors?: HealthError[]; + readonly lastMigrationStatus?: string; + readonly lastMigrationTime?: Date; readonly lastTestMigrationStatus?: string; readonly lastTestMigrationTime?: Date; readonly machineName?: string; @@ -3474,6 +3325,8 @@ export interface MigrationItemProperties { readonly policyFriendlyName?: string; readonly policyId?: string; providerSpecificDetails?: MigrationProviderSpecificSettingsUnion; + readonly recoveryServicesProviderId?: string; + readonly replicationStatus?: string; readonly testMigrateState?: TestMigrationState; readonly testMigrateStateDescription?: string; } @@ -3494,9 +3347,9 @@ export interface MigrationProviderSpecificSettings { export type MigrationProviderSpecificSettingsUnion = MigrationProviderSpecificSettings | VMwareCbtMigrationDetails; // @public -export type MigrationRecoveryPoint = Resource & { +export interface MigrationRecoveryPoint extends Resource { properties?: MigrationRecoveryPointProperties; -}; +} // @public export interface MigrationRecoveryPointCollection { @@ -3512,8 +3365,8 @@ export interface MigrationRecoveryPointProperties { // @public export interface MigrationRecoveryPoints { - get(fabricName: string, protectionContainerName: string, migrationItemName: string, migrationRecoveryPointName: string, options?: MigrationRecoveryPointsGetOptionalParams): Promise; - listByReplicationMigrationItems(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: MigrationRecoveryPointsListByReplicationMigrationItemsOptionalParams): PagedAsyncIterableIterator; + get(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, migrationRecoveryPointName: string, options?: MigrationRecoveryPointsGetOptionalParams): Promise; + listByReplicationMigrationItems(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, options?: MigrationRecoveryPointsListByReplicationMigrationItemsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -3560,9 +3413,9 @@ export type MultiVmGroupCreateOption = string; export type MultiVmSyncPointOption = string; // @public -export type Network = Resource & { +export interface Network extends Resource { properties?: NetworkProperties; -}; +} // @public export interface NetworkCollection { @@ -3571,9 +3424,9 @@ export interface NetworkCollection { } // @public -export type NetworkMapping = Resource & { +export interface NetworkMapping extends Resource { properties?: NetworkMappingProperties; -}; +} // @public export interface NetworkMappingCollection { @@ -3611,25 +3464,25 @@ export interface NetworkProperties { } // @public -export type NewProtectionProfile = ProtectionProfileCustomDetails & { - resourceType: "New"; - policyName: string; - recoveryPointHistory?: number; - crashConsistentFrequencyInMinutes?: number; +export interface NewProtectionProfile extends ProtectionProfileCustomDetails { appConsistentFrequencyInMinutes?: number; + crashConsistentFrequencyInMinutes?: number; multiVmSyncStatus: SetMultiVmSyncStatus; -}; + policyName: string; + recoveryPointHistory?: number; + resourceType: "New"; +} // @public -export type NewRecoveryVirtualNetwork = RecoveryVirtualNetworkCustomDetails & { - resourceType: "New"; - recoveryVirtualNetworkResourceGroupName?: string; +export interface NewRecoveryVirtualNetwork extends RecoveryVirtualNetworkCustomDetails { recoveryVirtualNetworkName?: string; -}; + recoveryVirtualNetworkResourceGroupName?: string; + resourceType: "New"; +} // @public export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + list(resourceGroupName: string, options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -3683,6 +3536,16 @@ export interface OSVersionWrapper { version?: string; } +// @public +export interface PauseReplicationInput { + properties: PauseReplicationInputProperties; +} + +// @public +export interface PauseReplicationInputProperties { + instanceType: string; +} + // @public export interface PlannedFailoverInput { properties?: PlannedFailoverInputProperties; @@ -3706,9 +3569,9 @@ export type PlannedFailoverProviderSpecificFailoverInputUnion = PlannedFailoverP export type PlannedFailoverStatus = string; // @public -export type Policy = Resource & { +export interface Policy extends Resource { properties?: PolicyProperties; -}; +} // @public export interface PolicyCollection { @@ -3818,9 +3681,9 @@ export interface ProcessServerDetails { } // @public -export type ProtectableItem = Resource & { +export interface ProtectableItem extends Resource { properties?: ProtectableItemProperties; -}; +} // @public export interface ProtectableItemCollection { @@ -3857,9 +3720,9 @@ export interface ProtectedItemsQueryParameter { } // @public -export type ProtectionContainer = Resource & { +export interface ProtectionContainer extends Resource { properties?: ProtectionContainerProperties; -}; +} // @public export interface ProtectionContainerCollection { @@ -3873,9 +3736,9 @@ export interface ProtectionContainerFabricSpecificDetails { } // @public -export type ProtectionContainerMapping = Resource & { +export interface ProtectionContainerMapping extends Resource { properties?: ProtectionContainerMappingProperties; -}; +} // @public export interface ProtectionContainerMappingCollection { @@ -3984,33 +3847,35 @@ export interface RecoveryAvailabilitySetCustomDetails { export type RecoveryAvailabilitySetCustomDetailsUnion = RecoveryAvailabilitySetCustomDetails | ExistingRecoveryAvailabilitySet; // @public -export type RecoveryPlan = Resource & { +export interface RecoveryPlan extends Resource { properties?: RecoveryPlanProperties; -}; +} // @public -export type RecoveryPlanA2ADetails = RecoveryPlanProviderSpecificDetails & { +export interface RecoveryPlanA2ADetails extends RecoveryPlanProviderSpecificDetails { instanceType: "A2A"; + primaryExtendedLocation?: ExtendedLocation; primaryZone?: string; + recoveryExtendedLocation?: ExtendedLocation; recoveryZone?: string; -}; +} // @public -export type RecoveryPlanA2AFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { - instanceType: "A2A"; - recoveryPointType: A2ARpRecoveryPointType; +export interface RecoveryPlanA2AFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { cloudServiceCreationOption?: string; + instanceType: "A2A"; multiVmSyncPointOption?: MultiVmSyncPointOption; -}; + recoveryPointType: A2ARpRecoveryPointType; +} // @public -export type RecoveryPlanA2AInput = RecoveryPlanProviderSpecificInput & { +export interface RecoveryPlanA2AInput extends RecoveryPlanProviderSpecificInput { instanceType: "A2A"; - primaryZone?: string; - recoveryZone?: string; primaryExtendedLocation?: ExtendedLocation; + primaryZone?: string; recoveryExtendedLocation?: ExtendedLocation; -}; + recoveryZone?: string; +} // @public export interface RecoveryPlanAction { @@ -4032,12 +3897,12 @@ export type RecoveryPlanActionDetailsUnion = RecoveryPlanActionDetails | Recover export type RecoveryPlanActionLocation = string; // @public -export type RecoveryPlanAutomationRunbookActionDetails = RecoveryPlanActionDetails & { +export interface RecoveryPlanAutomationRunbookActionDetails extends RecoveryPlanActionDetails { + fabricLocation: RecoveryPlanActionLocation; instanceType: "AutomationRunbookActionDetails"; runbookId?: string; timeout?: string; - fabricLocation: RecoveryPlanActionLocation; -}; +} // @public export interface RecoveryPlanCollection { @@ -4054,12 +3919,12 @@ export interface RecoveryPlanGroup { } // @public -export type RecoveryPlanGroupTaskDetails = GroupTaskDetails & { +export interface RecoveryPlanGroupTaskDetails extends GroupTaskDetails { + groupId?: string; instanceType: "RecoveryPlanGroupTaskDetails" | "RecoveryPlanShutdownGroupTaskDetails"; name?: string; - groupId?: string; rpGroupType?: string; -}; +} // @public (undocumented) export type RecoveryPlanGroupTaskDetailsUnion = RecoveryPlanGroupTaskDetails | RecoveryPlanShutdownGroupTaskDetails; @@ -4068,52 +3933,52 @@ export type RecoveryPlanGroupTaskDetailsUnion = RecoveryPlanGroupTaskDetails | R export type RecoveryPlanGroupType = string; // @public -export type RecoveryPlanHyperVReplicaAzureFailbackInput = RecoveryPlanProviderSpecificFailoverInput & { - instanceType: "HyperVReplicaAzureFailback"; +export interface RecoveryPlanHyperVReplicaAzureFailbackInput extends RecoveryPlanProviderSpecificFailoverInput { dataSyncOption: DataSyncStatus; + instanceType: "HyperVReplicaAzureFailback"; recoveryVmCreationOption: AlternateLocationRecoveryOption; -}; +} // @public -export type RecoveryPlanHyperVReplicaAzureFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanHyperVReplicaAzureFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { instanceType: "HyperVReplicaAzure"; primaryKekCertificatePfx?: string; - secondaryKekCertificatePfx?: string; recoveryPointType?: HyperVReplicaAzureRpRecoveryPointType; -}; + secondaryKekCertificatePfx?: string; +} // @public -export type RecoveryPlanInMageAzureV2FailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanInMageAzureV2FailoverInput extends RecoveryPlanProviderSpecificFailoverInput { instanceType: "InMageAzureV2"; recoveryPointType: InMageV2RpRecoveryPointType; useMultiVmSyncPoint?: string; -}; +} // @public -export type RecoveryPlanInMageFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanInMageFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { instanceType: "InMage"; recoveryPointType: RpInMageRecoveryPointType; -}; +} // @public -export type RecoveryPlanInMageRcmFailbackFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanInMageRcmFailbackFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { instanceType: "InMageRcmFailback"; recoveryPointType: InMageRcmFailbackRecoveryPointType; useMultiVmSyncPoint?: string; -}; +} // @public -export type RecoveryPlanInMageRcmFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanInMageRcmFailoverInput extends RecoveryPlanProviderSpecificFailoverInput { instanceType: "InMageRcm"; recoveryPointType: RecoveryPlanPointType; useMultiVmSyncPoint?: string; -}; +} // @public -export type RecoveryPlanManualActionDetails = RecoveryPlanActionDetails & { - instanceType: "ManualActionDetails"; +export interface RecoveryPlanManualActionDetails extends RecoveryPlanActionDetails { description?: string; -}; + instanceType: "ManualActionDetails"; +} // @public export interface RecoveryPlanPlannedFailoverInput { @@ -4180,17 +4045,17 @@ export interface RecoveryPlanProviderSpecificInput { export type RecoveryPlanProviderSpecificInputUnion = RecoveryPlanProviderSpecificInput | RecoveryPlanA2AInput; // @public -export type RecoveryPlanScriptActionDetails = RecoveryPlanActionDetails & { +export interface RecoveryPlanScriptActionDetails extends RecoveryPlanActionDetails { + fabricLocation: RecoveryPlanActionLocation; instanceType: "ScriptActionDetails"; path: string; timeout?: string; - fabricLocation: RecoveryPlanActionLocation; -}; +} // @public -export type RecoveryPlanShutdownGroupTaskDetails = RecoveryPlanGroupTaskDetails & { +export interface RecoveryPlanShutdownGroupTaskDetails extends RecoveryPlanGroupTaskDetails { instanceType: "RecoveryPlanShutdownGroupTaskDetails"; -}; +} // @public export interface RecoveryPlanTestFailoverCleanupInput { @@ -4228,9 +4093,9 @@ export interface RecoveryPlanUnplannedFailoverInputProperties { } // @public -export type RecoveryPoint = Resource & { +export interface RecoveryPoint extends Resource { properties?: RecoveryPointProperties; -}; +} // @public export interface RecoveryPointCollection { @@ -4247,8 +4112,8 @@ export interface RecoveryPointProperties { // @public export interface RecoveryPoints { - get(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, recoveryPointName: string, options?: RecoveryPointsGetOptionalParams): Promise; - listByReplicationProtectedItems(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: RecoveryPointsListByReplicationProtectedItemsOptionalParams): PagedAsyncIterableIterator; + get(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, recoveryPointName: string, options?: RecoveryPointsGetOptionalParams): Promise; + listByReplicationProtectedItems(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: RecoveryPointsListByReplicationProtectedItemsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -4295,9 +4160,9 @@ export interface RecoveryResourceGroupCustomDetails { export type RecoveryResourceGroupCustomDetailsUnion = RecoveryResourceGroupCustomDetails | ExistingRecoveryResourceGroup; // @public -export type RecoveryServicesProvider = Resource & { +export interface RecoveryServicesProvider extends Resource { properties?: RecoveryServicesProviderProperties; -}; +} // @public export interface RecoveryServicesProviderCollection { @@ -4390,9 +4255,9 @@ export interface ReplicationAgentDetails { // @public export interface ReplicationAlertSettings { - create(alertSettingName: string, request: ConfigureAlertRequest, options?: ReplicationAlertSettingsCreateOptionalParams): Promise; - get(alertSettingName: string, options?: ReplicationAlertSettingsGetOptionalParams): Promise; - list(options?: ReplicationAlertSettingsListOptionalParams): PagedAsyncIterableIterator; + create(resourceName: string, resourceGroupName: string, alertSettingName: string, request: ConfigureAlertRequest, options?: ReplicationAlertSettingsCreateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, alertSettingName: string, options?: ReplicationAlertSettingsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationAlertSettingsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -4435,12 +4300,11 @@ export interface ReplicationApplianceProperties { // @public export interface ReplicationAppliances { - list(options?: ReplicationAppliancesListOptionalParams): PagedAsyncIterableIterator; + list(resourceName: string, resourceGroupName: string, options?: ReplicationAppliancesListOptionalParams): PagedAsyncIterableIterator; } // @public export interface ReplicationAppliancesListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4492,8 +4356,8 @@ export type ReplicationEligibilityResultsListResponse = ReplicationEligibilityRe // @public export interface ReplicationEligibilityResultsOperations { - get(virtualMachineName: string, options?: ReplicationEligibilityResultsGetOptionalParams): Promise; - list(virtualMachineName: string, options?: ReplicationEligibilityResultsListOptionalParams): Promise; + get(resourceGroupName: string, virtualMachineName: string, options?: ReplicationEligibilityResultsGetOptionalParams): Promise; + list(resourceGroupName: string, virtualMachineName: string, options?: ReplicationEligibilityResultsListOptionalParams): Promise; } // @public @@ -4504,8 +4368,8 @@ export interface ReplicationEligibilityResultsProperties { // @public export interface ReplicationEvents { - get(eventName: string, options?: ReplicationEventsGetOptionalParams): Promise; - list(options?: ReplicationEventsListOptionalParams): PagedAsyncIterableIterator; + get(resourceName: string, resourceGroupName: string, eventName: string, options?: ReplicationEventsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationEventsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -4517,7 +4381,6 @@ export type ReplicationEventsGetResponse = Event_2; // @public export interface ReplicationEventsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4533,22 +4396,22 @@ export type ReplicationEventsListResponse = EventCollection; // @public export interface ReplicationFabrics { - beginCheckConsistency(fabricName: string, options?: ReplicationFabricsCheckConsistencyOptionalParams): Promise, ReplicationFabricsCheckConsistencyResponse>>; - beginCheckConsistencyAndWait(fabricName: string, options?: ReplicationFabricsCheckConsistencyOptionalParams): Promise; - beginCreate(fabricName: string, input: FabricCreationInput, options?: ReplicationFabricsCreateOptionalParams): Promise, ReplicationFabricsCreateResponse>>; - beginCreateAndWait(fabricName: string, input: FabricCreationInput, options?: ReplicationFabricsCreateOptionalParams): Promise; - beginDelete(fabricName: string, options?: ReplicationFabricsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(fabricName: string, options?: ReplicationFabricsDeleteOptionalParams): Promise; - beginMigrateToAad(fabricName: string, options?: ReplicationFabricsMigrateToAadOptionalParams): Promise, void>>; - beginMigrateToAadAndWait(fabricName: string, options?: ReplicationFabricsMigrateToAadOptionalParams): Promise; - beginPurge(fabricName: string, options?: ReplicationFabricsPurgeOptionalParams): Promise, void>>; - beginPurgeAndWait(fabricName: string, options?: ReplicationFabricsPurgeOptionalParams): Promise; - beginReassociateGateway(fabricName: string, failoverProcessServerRequest: FailoverProcessServerRequest, options?: ReplicationFabricsReassociateGatewayOptionalParams): Promise, ReplicationFabricsReassociateGatewayResponse>>; - beginReassociateGatewayAndWait(fabricName: string, failoverProcessServerRequest: FailoverProcessServerRequest, options?: ReplicationFabricsReassociateGatewayOptionalParams): Promise; - beginRenewCertificate(fabricName: string, renewCertificate: RenewCertificateInput, options?: ReplicationFabricsRenewCertificateOptionalParams): Promise, ReplicationFabricsRenewCertificateResponse>>; - beginRenewCertificateAndWait(fabricName: string, renewCertificate: RenewCertificateInput, options?: ReplicationFabricsRenewCertificateOptionalParams): Promise; - get(fabricName: string, options?: ReplicationFabricsGetOptionalParams): Promise; - list(options?: ReplicationFabricsListOptionalParams): PagedAsyncIterableIterator; + beginCheckConsistency(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationFabricsCheckConsistencyOptionalParams): Promise, ReplicationFabricsCheckConsistencyResponse>>; + beginCheckConsistencyAndWait(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationFabricsCheckConsistencyOptionalParams): Promise; + beginCreate(resourceName: string, resourceGroupName: string, fabricName: string, input: FabricCreationInput, options?: ReplicationFabricsCreateOptionalParams): Promise, ReplicationFabricsCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, input: FabricCreationInput, options?: ReplicationFabricsCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationFabricsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationFabricsDeleteOptionalParams): Promise; + beginMigrateToAad(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationFabricsMigrateToAadOptionalParams): Promise, void>>; + beginMigrateToAadAndWait(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationFabricsMigrateToAadOptionalParams): Promise; + beginPurge(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationFabricsPurgeOptionalParams): Promise, void>>; + beginPurgeAndWait(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationFabricsPurgeOptionalParams): Promise; + beginReassociateGateway(resourceName: string, resourceGroupName: string, fabricName: string, failoverProcessServerRequest: FailoverProcessServerRequest, options?: ReplicationFabricsReassociateGatewayOptionalParams): Promise, ReplicationFabricsReassociateGatewayResponse>>; + beginReassociateGatewayAndWait(resourceName: string, resourceGroupName: string, fabricName: string, failoverProcessServerRequest: FailoverProcessServerRequest, options?: ReplicationFabricsReassociateGatewayOptionalParams): Promise; + beginRenewCertificate(resourceName: string, resourceGroupName: string, fabricName: string, renewCertificate: RenewCertificateInput, options?: ReplicationFabricsRenewCertificateOptionalParams): Promise, ReplicationFabricsRenewCertificateResponse>>; + beginRenewCertificateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, renewCertificate: RenewCertificateInput, options?: ReplicationFabricsRenewCertificateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationFabricsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationFabricsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -4628,22 +4491,22 @@ export interface ReplicationFabricsRenewCertificateOptionalParams extends coreCl export type ReplicationFabricsRenewCertificateResponse = Fabric; // @public -export type ReplicationGroupDetails = ConfigurationSettings & { +export interface ReplicationGroupDetails extends ConfigurationSettings { instanceType: "ReplicationGroupDetails"; -}; +} // @public export interface ReplicationJobs { - beginCancel(jobName: string, options?: ReplicationJobsCancelOptionalParams): Promise, ReplicationJobsCancelResponse>>; - beginCancelAndWait(jobName: string, options?: ReplicationJobsCancelOptionalParams): Promise; - beginExport(jobQueryParameter: JobQueryParameter, options?: ReplicationJobsExportOptionalParams): Promise, ReplicationJobsExportResponse>>; - beginExportAndWait(jobQueryParameter: JobQueryParameter, options?: ReplicationJobsExportOptionalParams): Promise; - beginRestart(jobName: string, options?: ReplicationJobsRestartOptionalParams): Promise, ReplicationJobsRestartResponse>>; - beginRestartAndWait(jobName: string, options?: ReplicationJobsRestartOptionalParams): Promise; - beginResume(jobName: string, resumeJobParams: ResumeJobParams, options?: ReplicationJobsResumeOptionalParams): Promise, ReplicationJobsResumeResponse>>; - beginResumeAndWait(jobName: string, resumeJobParams: ResumeJobParams, options?: ReplicationJobsResumeOptionalParams): Promise; - get(jobName: string, options?: ReplicationJobsGetOptionalParams): Promise; - list(options?: ReplicationJobsListOptionalParams): PagedAsyncIterableIterator; + beginCancel(resourceName: string, resourceGroupName: string, jobName: string, options?: ReplicationJobsCancelOptionalParams): Promise, ReplicationJobsCancelResponse>>; + beginCancelAndWait(resourceName: string, resourceGroupName: string, jobName: string, options?: ReplicationJobsCancelOptionalParams): Promise; + beginExport(resourceName: string, resourceGroupName: string, jobQueryParameter: JobQueryParameter, options?: ReplicationJobsExportOptionalParams): Promise, ReplicationJobsExportResponse>>; + beginExportAndWait(resourceName: string, resourceGroupName: string, jobQueryParameter: JobQueryParameter, options?: ReplicationJobsExportOptionalParams): Promise; + beginRestart(resourceName: string, resourceGroupName: string, jobName: string, options?: ReplicationJobsRestartOptionalParams): Promise, ReplicationJobsRestartResponse>>; + beginRestartAndWait(resourceName: string, resourceGroupName: string, jobName: string, options?: ReplicationJobsRestartOptionalParams): Promise; + beginResume(resourceName: string, resourceGroupName: string, jobName: string, resumeJobParams: ResumeJobParams, options?: ReplicationJobsResumeOptionalParams): Promise, ReplicationJobsResumeResponse>>; + beginResumeAndWait(resourceName: string, resourceGroupName: string, jobName: string, resumeJobParams: ResumeJobParams, options?: ReplicationJobsResumeOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, jobName: string, options?: ReplicationJobsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationJobsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -4673,7 +4536,6 @@ export type ReplicationJobsGetResponse = Job; // @public export interface ReplicationJobsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public @@ -4707,8 +4569,8 @@ export type ReplicationJobsResumeResponse = Job; // @public export interface ReplicationLogicalNetworks { - get(fabricName: string, logicalNetworkName: string, options?: ReplicationLogicalNetworksGetOptionalParams): Promise; - listByReplicationFabrics(fabricName: string, options?: ReplicationLogicalNetworksListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; + get(resourceName: string, resourceGroupName: string, fabricName: string, logicalNetworkName: string, options?: ReplicationLogicalNetworksGetOptionalParams): Promise; + listByReplicationFabrics(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationLogicalNetworksListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -4734,23 +4596,27 @@ export type ReplicationLogicalNetworksListByReplicationFabricsResponse = Logical // @public export interface ReplicationMigrationItems { - beginCreate(fabricName: string, protectionContainerName: string, migrationItemName: string, input: EnableMigrationInput, options?: ReplicationMigrationItemsCreateOptionalParams): Promise, ReplicationMigrationItemsCreateResponse>>; - beginCreateAndWait(fabricName: string, protectionContainerName: string, migrationItemName: string, input: EnableMigrationInput, options?: ReplicationMigrationItemsCreateOptionalParams): Promise; - beginDelete(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: ReplicationMigrationItemsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: ReplicationMigrationItemsDeleteOptionalParams): Promise; - beginMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: MigrateInput, options?: ReplicationMigrationItemsMigrateOptionalParams): Promise, ReplicationMigrationItemsMigrateResponse>>; - beginMigrateAndWait(fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: MigrateInput, options?: ReplicationMigrationItemsMigrateOptionalParams): Promise; - beginResync(fabricName: string, protectionContainerName: string, migrationItemName: string, input: ResyncInput, options?: ReplicationMigrationItemsResyncOptionalParams): Promise, ReplicationMigrationItemsResyncResponse>>; - beginResyncAndWait(fabricName: string, protectionContainerName: string, migrationItemName: string, input: ResyncInput, options?: ReplicationMigrationItemsResyncOptionalParams): Promise; - beginTestMigrate(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: TestMigrateInput, options?: ReplicationMigrationItemsTestMigrateOptionalParams): Promise, ReplicationMigrationItemsTestMigrateResponse>>; - beginTestMigrateAndWait(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: TestMigrateInput, options?: ReplicationMigrationItemsTestMigrateOptionalParams): Promise; - beginTestMigrateCleanup(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: TestMigrateCleanupInput, options?: ReplicationMigrationItemsTestMigrateCleanupOptionalParams): Promise, ReplicationMigrationItemsTestMigrateCleanupResponse>>; - beginTestMigrateCleanupAndWait(fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: TestMigrateCleanupInput, options?: ReplicationMigrationItemsTestMigrateCleanupOptionalParams): Promise; - beginUpdate(fabricName: string, protectionContainerName: string, migrationItemName: string, input: UpdateMigrationItemInput, options?: ReplicationMigrationItemsUpdateOptionalParams): Promise, ReplicationMigrationItemsUpdateResponse>>; - beginUpdateAndWait(fabricName: string, protectionContainerName: string, migrationItemName: string, input: UpdateMigrationItemInput, options?: ReplicationMigrationItemsUpdateOptionalParams): Promise; - get(fabricName: string, protectionContainerName: string, migrationItemName: string, options?: ReplicationMigrationItemsGetOptionalParams): Promise; - list(options?: ReplicationMigrationItemsListOptionalParams): PagedAsyncIterableIterator; - listByReplicationProtectionContainers(fabricName: string, protectionContainerName: string, options?: ReplicationMigrationItemsListByReplicationProtectionContainersOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, input: EnableMigrationInput, options?: ReplicationMigrationItemsCreateOptionalParams): Promise, ReplicationMigrationItemsCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, input: EnableMigrationInput, options?: ReplicationMigrationItemsCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, options?: ReplicationMigrationItemsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, options?: ReplicationMigrationItemsDeleteOptionalParams): Promise; + beginMigrate(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: MigrateInput, options?: ReplicationMigrationItemsMigrateOptionalParams): Promise, ReplicationMigrationItemsMigrateResponse>>; + beginMigrateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: MigrateInput, options?: ReplicationMigrationItemsMigrateOptionalParams): Promise; + beginPauseReplication(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, pauseReplicationInput: PauseReplicationInput, options?: ReplicationMigrationItemsPauseReplicationOptionalParams): Promise, ReplicationMigrationItemsPauseReplicationResponse>>; + beginPauseReplicationAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, pauseReplicationInput: PauseReplicationInput, options?: ReplicationMigrationItemsPauseReplicationOptionalParams): Promise; + beginResumeReplication(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, resumeReplicationInput: ResumeReplicationInput, options?: ReplicationMigrationItemsResumeReplicationOptionalParams): Promise, ReplicationMigrationItemsResumeReplicationResponse>>; + beginResumeReplicationAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, resumeReplicationInput: ResumeReplicationInput, options?: ReplicationMigrationItemsResumeReplicationOptionalParams): Promise; + beginResync(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, input: ResyncInput, options?: ReplicationMigrationItemsResyncOptionalParams): Promise, ReplicationMigrationItemsResyncResponse>>; + beginResyncAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, input: ResyncInput, options?: ReplicationMigrationItemsResyncOptionalParams): Promise; + beginTestMigrate(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: TestMigrateInput, options?: ReplicationMigrationItemsTestMigrateOptionalParams): Promise, ReplicationMigrationItemsTestMigrateResponse>>; + beginTestMigrateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateInput: TestMigrateInput, options?: ReplicationMigrationItemsTestMigrateOptionalParams): Promise; + beginTestMigrateCleanup(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: TestMigrateCleanupInput, options?: ReplicationMigrationItemsTestMigrateCleanupOptionalParams): Promise, ReplicationMigrationItemsTestMigrateCleanupResponse>>; + beginTestMigrateCleanupAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, testMigrateCleanupInput: TestMigrateCleanupInput, options?: ReplicationMigrationItemsTestMigrateCleanupOptionalParams): Promise; + beginUpdate(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, input: UpdateMigrationItemInput, options?: ReplicationMigrationItemsUpdateOptionalParams): Promise, ReplicationMigrationItemsUpdateResponse>>; + beginUpdateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, input: UpdateMigrationItemInput, options?: ReplicationMigrationItemsUpdateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, options?: ReplicationMigrationItemsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationMigrationItemsListOptionalParams): PagedAsyncIterableIterator; + listByReplicationProtectionContainers(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationMigrationItemsListByReplicationProtectionContainersOptionalParams): PagedAsyncIterableIterator; } // @public @@ -4778,9 +4644,6 @@ export type ReplicationMigrationItemsGetResponse = MigrationItem; // @public export interface ReplicationMigrationItemsListByReplicationProtectionContainersNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - skipToken?: string; - takeToken?: string; } // @public @@ -4798,9 +4661,6 @@ export type ReplicationMigrationItemsListByReplicationProtectionContainersRespon // @public export interface ReplicationMigrationItemsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - skipToken?: string; - takeToken?: string; } // @public @@ -4825,6 +4685,24 @@ export interface ReplicationMigrationItemsMigrateOptionalParams extends coreClie // @public export type ReplicationMigrationItemsMigrateResponse = MigrationItem; +// @public +export interface ReplicationMigrationItemsPauseReplicationOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ReplicationMigrationItemsPauseReplicationResponse = MigrationItem; + +// @public +export interface ReplicationMigrationItemsResumeReplicationOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ReplicationMigrationItemsResumeReplicationResponse = MigrationItem; + // @public export interface ReplicationMigrationItemsResyncOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -4863,15 +4741,15 @@ export type ReplicationMigrationItemsUpdateResponse = MigrationItem; // @public export interface ReplicationNetworkMappings { - beginCreate(fabricName: string, networkName: string, networkMappingName: string, input: CreateNetworkMappingInput, options?: ReplicationNetworkMappingsCreateOptionalParams): Promise, ReplicationNetworkMappingsCreateResponse>>; - beginCreateAndWait(fabricName: string, networkName: string, networkMappingName: string, input: CreateNetworkMappingInput, options?: ReplicationNetworkMappingsCreateOptionalParams): Promise; - beginDelete(fabricName: string, networkName: string, networkMappingName: string, options?: ReplicationNetworkMappingsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(fabricName: string, networkName: string, networkMappingName: string, options?: ReplicationNetworkMappingsDeleteOptionalParams): Promise; - beginUpdate(fabricName: string, networkName: string, networkMappingName: string, input: UpdateNetworkMappingInput, options?: ReplicationNetworkMappingsUpdateOptionalParams): Promise, ReplicationNetworkMappingsUpdateResponse>>; - beginUpdateAndWait(fabricName: string, networkName: string, networkMappingName: string, input: UpdateNetworkMappingInput, options?: ReplicationNetworkMappingsUpdateOptionalParams): Promise; - get(fabricName: string, networkName: string, networkMappingName: string, options?: ReplicationNetworkMappingsGetOptionalParams): Promise; - list(options?: ReplicationNetworkMappingsListOptionalParams): PagedAsyncIterableIterator; - listByReplicationNetworks(fabricName: string, networkName: string, options?: ReplicationNetworkMappingsListByReplicationNetworksOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, input: CreateNetworkMappingInput, options?: ReplicationNetworkMappingsCreateOptionalParams): Promise, ReplicationNetworkMappingsCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, input: CreateNetworkMappingInput, options?: ReplicationNetworkMappingsCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, options?: ReplicationNetworkMappingsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, options?: ReplicationNetworkMappingsDeleteOptionalParams): Promise; + beginUpdate(resourceName: string, resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, input: UpdateNetworkMappingInput, options?: ReplicationNetworkMappingsUpdateOptionalParams): Promise, ReplicationNetworkMappingsUpdateResponse>>; + beginUpdateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, input: UpdateNetworkMappingInput, options?: ReplicationNetworkMappingsUpdateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, options?: ReplicationNetworkMappingsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationNetworkMappingsListOptionalParams): PagedAsyncIterableIterator; + listByReplicationNetworks(resourceName: string, resourceGroupName: string, fabricName: string, networkName: string, options?: ReplicationNetworkMappingsListByReplicationNetworksOptionalParams): PagedAsyncIterableIterator; } // @public @@ -4935,9 +4813,9 @@ export type ReplicationNetworkMappingsUpdateResponse = NetworkMapping; // @public export interface ReplicationNetworks { - get(fabricName: string, networkName: string, options?: ReplicationNetworksGetOptionalParams): Promise; - list(options?: ReplicationNetworksListOptionalParams): PagedAsyncIterableIterator; - listByReplicationFabrics(fabricName: string, options?: ReplicationNetworksListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; + get(resourceName: string, resourceGroupName: string, fabricName: string, networkName: string, options?: ReplicationNetworksGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationNetworksListOptionalParams): PagedAsyncIterableIterator; + listByReplicationFabrics(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationNetworksListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -4977,14 +4855,14 @@ export type ReplicationNetworksListResponse = NetworkCollection; // @public export interface ReplicationPolicies { - beginCreate(policyName: string, input: CreatePolicyInput, options?: ReplicationPoliciesCreateOptionalParams): Promise, ReplicationPoliciesCreateResponse>>; - beginCreateAndWait(policyName: string, input: CreatePolicyInput, options?: ReplicationPoliciesCreateOptionalParams): Promise; - beginDelete(policyName: string, options?: ReplicationPoliciesDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(policyName: string, options?: ReplicationPoliciesDeleteOptionalParams): Promise; - beginUpdate(policyName: string, input: UpdatePolicyInput, options?: ReplicationPoliciesUpdateOptionalParams): Promise, ReplicationPoliciesUpdateResponse>>; - beginUpdateAndWait(policyName: string, input: UpdatePolicyInput, options?: ReplicationPoliciesUpdateOptionalParams): Promise; - get(policyName: string, options?: ReplicationPoliciesGetOptionalParams): Promise; - list(options?: ReplicationPoliciesListOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, policyName: string, input: CreatePolicyInput, options?: ReplicationPoliciesCreateOptionalParams): Promise, ReplicationPoliciesCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, policyName: string, input: CreatePolicyInput, options?: ReplicationPoliciesCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, policyName: string, options?: ReplicationPoliciesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, policyName: string, options?: ReplicationPoliciesDeleteOptionalParams): Promise; + beginUpdate(resourceName: string, resourceGroupName: string, policyName: string, input: UpdatePolicyInput, options?: ReplicationPoliciesUpdateOptionalParams): Promise, ReplicationPoliciesUpdateResponse>>; + beginUpdateAndWait(resourceName: string, resourceGroupName: string, policyName: string, input: UpdatePolicyInput, options?: ReplicationPoliciesUpdateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, policyName: string, options?: ReplicationPoliciesGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationPoliciesListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5034,8 +4912,8 @@ export type ReplicationPoliciesUpdateResponse = Policy; // @public export interface ReplicationProtectableItems { - get(fabricName: string, protectionContainerName: string, protectableItemName: string, options?: ReplicationProtectableItemsGetOptionalParams): Promise; - listByReplicationProtectionContainers(fabricName: string, protectionContainerName: string, options?: ReplicationProtectableItemsListByReplicationProtectionContainersOptionalParams): PagedAsyncIterableIterator; + get(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, protectableItemName: string, options?: ReplicationProtectableItemsGetOptionalParams): Promise; + listByReplicationProtectionContainers(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectableItemsListByReplicationProtectionContainersOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5047,9 +4925,6 @@ export type ReplicationProtectableItemsGetResponse = ProtectableItem; // @public export interface ReplicationProtectableItemsListByReplicationProtectionContainersNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - skipToken?: string; - take?: string; } // @public @@ -5066,9 +4941,9 @@ export interface ReplicationProtectableItemsListByReplicationProtectionContainer export type ReplicationProtectableItemsListByReplicationProtectionContainersResponse = ProtectableItemCollection; // @public -export type ReplicationProtectedItem = Resource & { +export interface ReplicationProtectedItem extends Resource { properties?: ReplicationProtectedItemProperties; -}; +} // @public export interface ReplicationProtectedItemCollection { @@ -5115,47 +4990,47 @@ export interface ReplicationProtectedItemProperties { // @public export interface ReplicationProtectedItems { - beginAddDisks(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, addDisksInput: AddDisksInput, options?: ReplicationProtectedItemsAddDisksOptionalParams): Promise, ReplicationProtectedItemsAddDisksResponse>>; - beginAddDisksAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, addDisksInput: AddDisksInput, options?: ReplicationProtectedItemsAddDisksOptionalParams): Promise; - beginApplyRecoveryPoint(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, applyRecoveryPointInput: ApplyRecoveryPointInput, options?: ReplicationProtectedItemsApplyRecoveryPointOptionalParams): Promise, ReplicationProtectedItemsApplyRecoveryPointResponse>>; - beginApplyRecoveryPointAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, applyRecoveryPointInput: ApplyRecoveryPointInput, options?: ReplicationProtectedItemsApplyRecoveryPointOptionalParams): Promise; - beginCreate(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, input: EnableProtectionInput, options?: ReplicationProtectedItemsCreateOptionalParams): Promise, ReplicationProtectedItemsCreateResponse>>; - beginCreateAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, input: EnableProtectionInput, options?: ReplicationProtectedItemsCreateOptionalParams): Promise; - beginDelete(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, disableProtectionInput: DisableProtectionInput, options?: ReplicationProtectedItemsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, disableProtectionInput: DisableProtectionInput, options?: ReplicationProtectedItemsDeleteOptionalParams): Promise; - beginFailoverCancel(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCancelOptionalParams): Promise, ReplicationProtectedItemsFailoverCancelResponse>>; - beginFailoverCancelAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCancelOptionalParams): Promise; - beginFailoverCommit(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCommitOptionalParams): Promise, ReplicationProtectedItemsFailoverCommitResponse>>; - beginFailoverCommitAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCommitOptionalParams): Promise; - beginPlannedFailover(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, failoverInput: PlannedFailoverInput, options?: ReplicationProtectedItemsPlannedFailoverOptionalParams): Promise, ReplicationProtectedItemsPlannedFailoverResponse>>; - beginPlannedFailoverAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, failoverInput: PlannedFailoverInput, options?: ReplicationProtectedItemsPlannedFailoverOptionalParams): Promise; - beginPurge(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsPurgeOptionalParams): Promise, void>>; - beginPurgeAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsPurgeOptionalParams): Promise; - beginRemoveDisks(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, removeDisksInput: RemoveDisksInput, options?: ReplicationProtectedItemsRemoveDisksOptionalParams): Promise, ReplicationProtectedItemsRemoveDisksResponse>>; - beginRemoveDisksAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, removeDisksInput: RemoveDisksInput, options?: ReplicationProtectedItemsRemoveDisksOptionalParams): Promise; - beginRepairReplication(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsRepairReplicationOptionalParams): Promise, ReplicationProtectedItemsRepairReplicationResponse>>; - beginRepairReplicationAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsRepairReplicationOptionalParams): Promise; - beginReprotect(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, reprotectInput: ReverseReplicationInput, options?: ReplicationProtectedItemsReprotectOptionalParams): Promise, ReplicationProtectedItemsReprotectResponse>>; - beginReprotectAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, reprotectInput: ReverseReplicationInput, options?: ReplicationProtectedItemsReprotectOptionalParams): Promise; - beginResolveHealthErrors(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, resolveHealthInput: ResolveHealthInput, options?: ReplicationProtectedItemsResolveHealthErrorsOptionalParams): Promise, ReplicationProtectedItemsResolveHealthErrorsResponse>>; - beginResolveHealthErrorsAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, resolveHealthInput: ResolveHealthInput, options?: ReplicationProtectedItemsResolveHealthErrorsOptionalParams): Promise; - beginSwitchProvider(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, switchProviderInput: SwitchProviderInput, options?: ReplicationProtectedItemsSwitchProviderOptionalParams): Promise, ReplicationProtectedItemsSwitchProviderResponse>>; - beginSwitchProviderAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, switchProviderInput: SwitchProviderInput, options?: ReplicationProtectedItemsSwitchProviderOptionalParams): Promise; - beginTestFailover(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, testfailoverInput: TestFailoverInput, options?: ReplicationProtectedItemsTestFailoverOptionalParams): Promise, ReplicationProtectedItemsTestFailoverResponse>>; - beginTestFailoverAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, testfailoverInput: TestFailoverInput, options?: ReplicationProtectedItemsTestFailoverOptionalParams): Promise; - beginTestFailoverCleanup(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, cleanupInput: TestFailoverCleanupInput, options?: ReplicationProtectedItemsTestFailoverCleanupOptionalParams): Promise, ReplicationProtectedItemsTestFailoverCleanupResponse>>; - beginTestFailoverCleanupAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, cleanupInput: TestFailoverCleanupInput, options?: ReplicationProtectedItemsTestFailoverCleanupOptionalParams): Promise; - beginUnplannedFailover(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, failoverInput: UnplannedFailoverInput, options?: ReplicationProtectedItemsUnplannedFailoverOptionalParams): Promise, ReplicationProtectedItemsUnplannedFailoverResponse>>; - beginUnplannedFailoverAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, failoverInput: UnplannedFailoverInput, options?: ReplicationProtectedItemsUnplannedFailoverOptionalParams): Promise; - beginUpdate(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, updateProtectionInput: UpdateReplicationProtectedItemInput, options?: ReplicationProtectedItemsUpdateOptionalParams): Promise, ReplicationProtectedItemsUpdateResponse>>; - beginUpdateAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, updateProtectionInput: UpdateReplicationProtectedItemInput, options?: ReplicationProtectedItemsUpdateOptionalParams): Promise; - beginUpdateAppliance(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, applianceUpdateInput: UpdateApplianceForReplicationProtectedItemInput, options?: ReplicationProtectedItemsUpdateApplianceOptionalParams): Promise, ReplicationProtectedItemsUpdateApplianceResponse>>; - beginUpdateApplianceAndWait(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, applianceUpdateInput: UpdateApplianceForReplicationProtectedItemInput, options?: ReplicationProtectedItemsUpdateApplianceOptionalParams): Promise; - beginUpdateMobilityService(fabricName: string, protectionContainerName: string, replicationProtectedItemName: string, updateMobilityServiceRequest: UpdateMobilityServiceRequest, options?: ReplicationProtectedItemsUpdateMobilityServiceOptionalParams): Promise, ReplicationProtectedItemsUpdateMobilityServiceResponse>>; - beginUpdateMobilityServiceAndWait(fabricName: string, protectionContainerName: string, replicationProtectedItemName: string, updateMobilityServiceRequest: UpdateMobilityServiceRequest, options?: ReplicationProtectedItemsUpdateMobilityServiceOptionalParams): Promise; - get(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsGetOptionalParams): Promise; - list(options?: ReplicationProtectedItemsListOptionalParams): PagedAsyncIterableIterator; - listByReplicationProtectionContainers(fabricName: string, protectionContainerName: string, options?: ReplicationProtectedItemsListByReplicationProtectionContainersOptionalParams): PagedAsyncIterableIterator; + beginAddDisks(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, addDisksInput: AddDisksInput, options?: ReplicationProtectedItemsAddDisksOptionalParams): Promise, ReplicationProtectedItemsAddDisksResponse>>; + beginAddDisksAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, addDisksInput: AddDisksInput, options?: ReplicationProtectedItemsAddDisksOptionalParams): Promise; + beginApplyRecoveryPoint(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, applyRecoveryPointInput: ApplyRecoveryPointInput, options?: ReplicationProtectedItemsApplyRecoveryPointOptionalParams): Promise, ReplicationProtectedItemsApplyRecoveryPointResponse>>; + beginApplyRecoveryPointAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, applyRecoveryPointInput: ApplyRecoveryPointInput, options?: ReplicationProtectedItemsApplyRecoveryPointOptionalParams): Promise; + beginCreate(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, input: EnableProtectionInput, options?: ReplicationProtectedItemsCreateOptionalParams): Promise, ReplicationProtectedItemsCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, input: EnableProtectionInput, options?: ReplicationProtectedItemsCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, disableProtectionInput: DisableProtectionInput, options?: ReplicationProtectedItemsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, disableProtectionInput: DisableProtectionInput, options?: ReplicationProtectedItemsDeleteOptionalParams): Promise; + beginFailoverCancel(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCancelOptionalParams): Promise, ReplicationProtectedItemsFailoverCancelResponse>>; + beginFailoverCancelAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCancelOptionalParams): Promise; + beginFailoverCommit(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCommitOptionalParams): Promise, ReplicationProtectedItemsFailoverCommitResponse>>; + beginFailoverCommitAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCommitOptionalParams): Promise; + beginPlannedFailover(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, failoverInput: PlannedFailoverInput, options?: ReplicationProtectedItemsPlannedFailoverOptionalParams): Promise, ReplicationProtectedItemsPlannedFailoverResponse>>; + beginPlannedFailoverAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, failoverInput: PlannedFailoverInput, options?: ReplicationProtectedItemsPlannedFailoverOptionalParams): Promise; + beginPurge(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsPurgeOptionalParams): Promise, void>>; + beginPurgeAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsPurgeOptionalParams): Promise; + beginRemoveDisks(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, removeDisksInput: RemoveDisksInput, options?: ReplicationProtectedItemsRemoveDisksOptionalParams): Promise, ReplicationProtectedItemsRemoveDisksResponse>>; + beginRemoveDisksAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, removeDisksInput: RemoveDisksInput, options?: ReplicationProtectedItemsRemoveDisksOptionalParams): Promise; + beginRepairReplication(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsRepairReplicationOptionalParams): Promise, ReplicationProtectedItemsRepairReplicationResponse>>; + beginRepairReplicationAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsRepairReplicationOptionalParams): Promise; + beginReprotect(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, reprotectInput: ReverseReplicationInput, options?: ReplicationProtectedItemsReprotectOptionalParams): Promise, ReplicationProtectedItemsReprotectResponse>>; + beginReprotectAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, reprotectInput: ReverseReplicationInput, options?: ReplicationProtectedItemsReprotectOptionalParams): Promise; + beginResolveHealthErrors(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, resolveHealthInput: ResolveHealthInput, options?: ReplicationProtectedItemsResolveHealthErrorsOptionalParams): Promise, ReplicationProtectedItemsResolveHealthErrorsResponse>>; + beginResolveHealthErrorsAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, resolveHealthInput: ResolveHealthInput, options?: ReplicationProtectedItemsResolveHealthErrorsOptionalParams): Promise; + beginSwitchProvider(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, switchProviderInput: SwitchProviderInput, options?: ReplicationProtectedItemsSwitchProviderOptionalParams): Promise, ReplicationProtectedItemsSwitchProviderResponse>>; + beginSwitchProviderAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, switchProviderInput: SwitchProviderInput, options?: ReplicationProtectedItemsSwitchProviderOptionalParams): Promise; + beginTestFailover(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, testfailoverInput: TestFailoverInput, options?: ReplicationProtectedItemsTestFailoverOptionalParams): Promise, ReplicationProtectedItemsTestFailoverResponse>>; + beginTestFailoverAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, testfailoverInput: TestFailoverInput, options?: ReplicationProtectedItemsTestFailoverOptionalParams): Promise; + beginTestFailoverCleanup(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, cleanupInput: TestFailoverCleanupInput, options?: ReplicationProtectedItemsTestFailoverCleanupOptionalParams): Promise, ReplicationProtectedItemsTestFailoverCleanupResponse>>; + beginTestFailoverCleanupAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, cleanupInput: TestFailoverCleanupInput, options?: ReplicationProtectedItemsTestFailoverCleanupOptionalParams): Promise; + beginUnplannedFailover(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, failoverInput: UnplannedFailoverInput, options?: ReplicationProtectedItemsUnplannedFailoverOptionalParams): Promise, ReplicationProtectedItemsUnplannedFailoverResponse>>; + beginUnplannedFailoverAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, failoverInput: UnplannedFailoverInput, options?: ReplicationProtectedItemsUnplannedFailoverOptionalParams): Promise; + beginUpdate(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, updateProtectionInput: UpdateReplicationProtectedItemInput, options?: ReplicationProtectedItemsUpdateOptionalParams): Promise, ReplicationProtectedItemsUpdateResponse>>; + beginUpdateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, updateProtectionInput: UpdateReplicationProtectedItemInput, options?: ReplicationProtectedItemsUpdateOptionalParams): Promise; + beginUpdateAppliance(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, applianceUpdateInput: UpdateApplianceForReplicationProtectedItemInput, options?: ReplicationProtectedItemsUpdateApplianceOptionalParams): Promise, ReplicationProtectedItemsUpdateApplianceResponse>>; + beginUpdateApplianceAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, applianceUpdateInput: UpdateApplianceForReplicationProtectedItemInput, options?: ReplicationProtectedItemsUpdateApplianceOptionalParams): Promise; + beginUpdateMobilityService(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, updateMobilityServiceRequest: UpdateMobilityServiceRequest, options?: ReplicationProtectedItemsUpdateMobilityServiceOptionalParams): Promise, ReplicationProtectedItemsUpdateMobilityServiceResponse>>; + beginUpdateMobilityServiceAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, updateMobilityServiceRequest: UpdateMobilityServiceRequest, options?: ReplicationProtectedItemsUpdateMobilityServiceOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationProtectedItemsListOptionalParams): PagedAsyncIterableIterator; + listByReplicationProtectionContainers(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectedItemsListByReplicationProtectionContainersOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5232,8 +5107,6 @@ export type ReplicationProtectedItemsListByReplicationProtectionContainersRespon // @public export interface ReplicationProtectedItemsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - skipToken?: string; } // @public @@ -5344,6 +5217,12 @@ export interface ReplicationProtectedItemsUpdateApplianceOptionalParams extends // @public export type ReplicationProtectedItemsUpdateApplianceResponse = ReplicationProtectedItem; +// @public +export interface ReplicationProtectedItemsUpdateMobilityServiceHeaders { + // (undocumented) + location?: string; +} + // @public export interface ReplicationProtectedItemsUpdateMobilityServiceOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -5364,17 +5243,17 @@ export type ReplicationProtectedItemsUpdateResponse = ReplicationProtectedItem; // @public export interface ReplicationProtectionContainerMappings { - beginCreate(fabricName: string, protectionContainerName: string, mappingName: string, creationInput: CreateProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsCreateOptionalParams): Promise, ReplicationProtectionContainerMappingsCreateResponse>>; - beginCreateAndWait(fabricName: string, protectionContainerName: string, mappingName: string, creationInput: CreateProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsCreateOptionalParams): Promise; - beginDelete(fabricName: string, protectionContainerName: string, mappingName: string, removalInput: RemoveProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(fabricName: string, protectionContainerName: string, mappingName: string, removalInput: RemoveProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsDeleteOptionalParams): Promise; - beginPurge(fabricName: string, protectionContainerName: string, mappingName: string, options?: ReplicationProtectionContainerMappingsPurgeOptionalParams): Promise, void>>; - beginPurgeAndWait(fabricName: string, protectionContainerName: string, mappingName: string, options?: ReplicationProtectionContainerMappingsPurgeOptionalParams): Promise; - beginUpdate(fabricName: string, protectionContainerName: string, mappingName: string, updateInput: UpdateProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsUpdateOptionalParams): Promise, ReplicationProtectionContainerMappingsUpdateResponse>>; - beginUpdateAndWait(fabricName: string, protectionContainerName: string, mappingName: string, updateInput: UpdateProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsUpdateOptionalParams): Promise; - get(fabricName: string, protectionContainerName: string, mappingName: string, options?: ReplicationProtectionContainerMappingsGetOptionalParams): Promise; - list(options?: ReplicationProtectionContainerMappingsListOptionalParams): PagedAsyncIterableIterator; - listByReplicationProtectionContainers(fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainerMappingsListByReplicationProtectionContainersOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, creationInput: CreateProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsCreateOptionalParams): Promise, ReplicationProtectionContainerMappingsCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, creationInput: CreateProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, removalInput: RemoveProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, removalInput: RemoveProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsDeleteOptionalParams): Promise; + beginPurge(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, options?: ReplicationProtectionContainerMappingsPurgeOptionalParams): Promise, void>>; + beginPurgeAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, options?: ReplicationProtectionContainerMappingsPurgeOptionalParams): Promise; + beginUpdate(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, updateInput: UpdateProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsUpdateOptionalParams): Promise, ReplicationProtectionContainerMappingsUpdateResponse>>; + beginUpdateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, updateInput: UpdateProtectionContainerMappingInput, options?: ReplicationProtectionContainerMappingsUpdateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, options?: ReplicationProtectionContainerMappingsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationProtectionContainerMappingsListOptionalParams): PagedAsyncIterableIterator; + listByReplicationProtectionContainers(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainerMappingsListByReplicationProtectionContainersOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5444,17 +5323,17 @@ export type ReplicationProtectionContainerMappingsUpdateResponse = ProtectionCon // @public export interface ReplicationProtectionContainers { - beginCreate(fabricName: string, protectionContainerName: string, creationInput: CreateProtectionContainerInput, options?: ReplicationProtectionContainersCreateOptionalParams): Promise, ReplicationProtectionContainersCreateResponse>>; - beginCreateAndWait(fabricName: string, protectionContainerName: string, creationInput: CreateProtectionContainerInput, options?: ReplicationProtectionContainersCreateOptionalParams): Promise; - beginDelete(fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersDeleteOptionalParams): Promise; - beginDiscoverProtectableItem(fabricName: string, protectionContainerName: string, discoverProtectableItemRequest: DiscoverProtectableItemRequest, options?: ReplicationProtectionContainersDiscoverProtectableItemOptionalParams): Promise, ReplicationProtectionContainersDiscoverProtectableItemResponse>>; - beginDiscoverProtectableItemAndWait(fabricName: string, protectionContainerName: string, discoverProtectableItemRequest: DiscoverProtectableItemRequest, options?: ReplicationProtectionContainersDiscoverProtectableItemOptionalParams): Promise; - beginSwitchProtection(fabricName: string, protectionContainerName: string, switchInput: SwitchProtectionInput, options?: ReplicationProtectionContainersSwitchProtectionOptionalParams): Promise, ReplicationProtectionContainersSwitchProtectionResponse>>; - beginSwitchProtectionAndWait(fabricName: string, protectionContainerName: string, switchInput: SwitchProtectionInput, options?: ReplicationProtectionContainersSwitchProtectionOptionalParams): Promise; - get(fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersGetOptionalParams): Promise; - list(options?: ReplicationProtectionContainersListOptionalParams): PagedAsyncIterableIterator; - listByReplicationFabrics(fabricName: string, options?: ReplicationProtectionContainersListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, creationInput: CreateProtectionContainerInput, options?: ReplicationProtectionContainersCreateOptionalParams): Promise, ReplicationProtectionContainersCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, creationInput: CreateProtectionContainerInput, options?: ReplicationProtectionContainersCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersDeleteOptionalParams): Promise; + beginDiscoverProtectableItem(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, discoverProtectableItemRequest: DiscoverProtectableItemRequest, options?: ReplicationProtectionContainersDiscoverProtectableItemOptionalParams): Promise, ReplicationProtectionContainersDiscoverProtectableItemResponse>>; + beginDiscoverProtectableItemAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, discoverProtectableItemRequest: DiscoverProtectableItemRequest, options?: ReplicationProtectionContainersDiscoverProtectableItemOptionalParams): Promise; + beginSwitchProtection(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, switchInput: SwitchProtectionInput, options?: ReplicationProtectionContainersSwitchProtectionOptionalParams): Promise, ReplicationProtectionContainersSwitchProtectionResponse>>; + beginSwitchProtectionAndWait(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, switchInput: SwitchProtectionInput, options?: ReplicationProtectionContainersSwitchProtectionOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationProtectionContainersListOptionalParams): PagedAsyncIterableIterator; + listByReplicationFabrics(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationProtectionContainersListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5526,9 +5405,9 @@ export interface ReplicationProtectionContainersSwitchProtectionOptionalParams e export type ReplicationProtectionContainersSwitchProtectionResponse = ProtectionContainer; // @public -export type ReplicationProtectionIntent = Resource & { +export interface ReplicationProtectionIntent extends Resource { properties?: ReplicationProtectionIntentProperties; -}; +} // @public export interface ReplicationProtectionIntentCollection { @@ -5556,9 +5435,9 @@ export type ReplicationProtectionIntentProviderSpecificSettingsUnion = Replicati // @public export interface ReplicationProtectionIntents { - create(intentObjectName: string, input: CreateProtectionIntentInput, options?: ReplicationProtectionIntentsCreateOptionalParams): Promise; - get(intentObjectName: string, options?: ReplicationProtectionIntentsGetOptionalParams): Promise; - list(options?: ReplicationProtectionIntentsListOptionalParams): PagedAsyncIterableIterator; + create(resourceName: string, resourceGroupName: string, intentObjectName: string, input: CreateProtectionIntentInput, options?: ReplicationProtectionIntentsCreateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, intentObjectName: string, options?: ReplicationProtectionIntentsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationProtectionIntentsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5577,8 +5456,6 @@ export type ReplicationProtectionIntentsGetResponse = ReplicationProtectionInten // @public export interface ReplicationProtectionIntentsListNextOptionalParams extends coreClient.OperationOptions { - skipToken?: string; - takeToken?: string; } // @public @@ -5632,28 +5509,28 @@ export type ReplicationProviderSpecificUpdateContainerMappingInputUnion = Replic // @public export interface ReplicationRecoveryPlans { - beginCreate(recoveryPlanName: string, input: CreateRecoveryPlanInput, options?: ReplicationRecoveryPlansCreateOptionalParams): Promise, ReplicationRecoveryPlansCreateResponse>>; - beginCreateAndWait(recoveryPlanName: string, input: CreateRecoveryPlanInput, options?: ReplicationRecoveryPlansCreateOptionalParams): Promise; - beginDelete(recoveryPlanName: string, options?: ReplicationRecoveryPlansDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(recoveryPlanName: string, options?: ReplicationRecoveryPlansDeleteOptionalParams): Promise; - beginFailoverCancel(recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCancelOptionalParams): Promise, ReplicationRecoveryPlansFailoverCancelResponse>>; - beginFailoverCancelAndWait(recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCancelOptionalParams): Promise; - beginFailoverCommit(recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCommitOptionalParams): Promise, ReplicationRecoveryPlansFailoverCommitResponse>>; - beginFailoverCommitAndWait(recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCommitOptionalParams): Promise; - beginPlannedFailover(recoveryPlanName: string, input: RecoveryPlanPlannedFailoverInput, options?: ReplicationRecoveryPlansPlannedFailoverOptionalParams): Promise, ReplicationRecoveryPlansPlannedFailoverResponse>>; - beginPlannedFailoverAndWait(recoveryPlanName: string, input: RecoveryPlanPlannedFailoverInput, options?: ReplicationRecoveryPlansPlannedFailoverOptionalParams): Promise; - beginReprotect(recoveryPlanName: string, options?: ReplicationRecoveryPlansReprotectOptionalParams): Promise, ReplicationRecoveryPlansReprotectResponse>>; - beginReprotectAndWait(recoveryPlanName: string, options?: ReplicationRecoveryPlansReprotectOptionalParams): Promise; - beginTestFailover(recoveryPlanName: string, input: RecoveryPlanTestFailoverInput, options?: ReplicationRecoveryPlansTestFailoverOptionalParams): Promise, ReplicationRecoveryPlansTestFailoverResponse>>; - beginTestFailoverAndWait(recoveryPlanName: string, input: RecoveryPlanTestFailoverInput, options?: ReplicationRecoveryPlansTestFailoverOptionalParams): Promise; - beginTestFailoverCleanup(recoveryPlanName: string, input: RecoveryPlanTestFailoverCleanupInput, options?: ReplicationRecoveryPlansTestFailoverCleanupOptionalParams): Promise, ReplicationRecoveryPlansTestFailoverCleanupResponse>>; - beginTestFailoverCleanupAndWait(recoveryPlanName: string, input: RecoveryPlanTestFailoverCleanupInput, options?: ReplicationRecoveryPlansTestFailoverCleanupOptionalParams): Promise; - beginUnplannedFailover(recoveryPlanName: string, input: RecoveryPlanUnplannedFailoverInput, options?: ReplicationRecoveryPlansUnplannedFailoverOptionalParams): Promise, ReplicationRecoveryPlansUnplannedFailoverResponse>>; - beginUnplannedFailoverAndWait(recoveryPlanName: string, input: RecoveryPlanUnplannedFailoverInput, options?: ReplicationRecoveryPlansUnplannedFailoverOptionalParams): Promise; - beginUpdate(recoveryPlanName: string, input: UpdateRecoveryPlanInput, options?: ReplicationRecoveryPlansUpdateOptionalParams): Promise, ReplicationRecoveryPlansUpdateResponse>>; - beginUpdateAndWait(recoveryPlanName: string, input: UpdateRecoveryPlanInput, options?: ReplicationRecoveryPlansUpdateOptionalParams): Promise; - get(recoveryPlanName: string, options?: ReplicationRecoveryPlansGetOptionalParams): Promise; - list(options?: ReplicationRecoveryPlansListOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: CreateRecoveryPlanInput, options?: ReplicationRecoveryPlansCreateOptionalParams): Promise, ReplicationRecoveryPlansCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: CreateRecoveryPlanInput, options?: ReplicationRecoveryPlansCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansDeleteOptionalParams): Promise; + beginFailoverCancel(resourceName: string, resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCancelOptionalParams): Promise, ReplicationRecoveryPlansFailoverCancelResponse>>; + beginFailoverCancelAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCancelOptionalParams): Promise; + beginFailoverCommit(resourceName: string, resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCommitOptionalParams): Promise, ReplicationRecoveryPlansFailoverCommitResponse>>; + beginFailoverCommitAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCommitOptionalParams): Promise; + beginPlannedFailover(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanPlannedFailoverInput, options?: ReplicationRecoveryPlansPlannedFailoverOptionalParams): Promise, ReplicationRecoveryPlansPlannedFailoverResponse>>; + beginPlannedFailoverAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanPlannedFailoverInput, options?: ReplicationRecoveryPlansPlannedFailoverOptionalParams): Promise; + beginReprotect(resourceName: string, resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansReprotectOptionalParams): Promise, ReplicationRecoveryPlansReprotectResponse>>; + beginReprotectAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansReprotectOptionalParams): Promise; + beginTestFailover(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverInput, options?: ReplicationRecoveryPlansTestFailoverOptionalParams): Promise, ReplicationRecoveryPlansTestFailoverResponse>>; + beginTestFailoverAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverInput, options?: ReplicationRecoveryPlansTestFailoverOptionalParams): Promise; + beginTestFailoverCleanup(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverCleanupInput, options?: ReplicationRecoveryPlansTestFailoverCleanupOptionalParams): Promise, ReplicationRecoveryPlansTestFailoverCleanupResponse>>; + beginTestFailoverCleanupAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverCleanupInput, options?: ReplicationRecoveryPlansTestFailoverCleanupOptionalParams): Promise; + beginUnplannedFailover(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanUnplannedFailoverInput, options?: ReplicationRecoveryPlansUnplannedFailoverOptionalParams): Promise, ReplicationRecoveryPlansUnplannedFailoverResponse>>; + beginUnplannedFailoverAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanUnplannedFailoverInput, options?: ReplicationRecoveryPlansUnplannedFailoverOptionalParams): Promise; + beginUpdate(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: UpdateRecoveryPlanInput, options?: ReplicationRecoveryPlansUpdateOptionalParams): Promise, ReplicationRecoveryPlansUpdateResponse>>; + beginUpdateAndWait(resourceName: string, resourceGroupName: string, recoveryPlanName: string, input: UpdateRecoveryPlanInput, options?: ReplicationRecoveryPlansUpdateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationRecoveryPlansListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5766,17 +5643,17 @@ export type ReplicationRecoveryPlansUpdateResponse = RecoveryPlan; // @public export interface ReplicationRecoveryServicesProviders { - beginCreate(fabricName: string, providerName: string, addProviderInput: AddRecoveryServicesProviderInput, options?: ReplicationRecoveryServicesProvidersCreateOptionalParams): Promise, ReplicationRecoveryServicesProvidersCreateResponse>>; - beginCreateAndWait(fabricName: string, providerName: string, addProviderInput: AddRecoveryServicesProviderInput, options?: ReplicationRecoveryServicesProvidersCreateOptionalParams): Promise; - beginDelete(fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersDeleteOptionalParams): Promise; - beginPurge(fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersPurgeOptionalParams): Promise, void>>; - beginPurgeAndWait(fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersPurgeOptionalParams): Promise; - beginRefreshProvider(fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersRefreshProviderOptionalParams): Promise, ReplicationRecoveryServicesProvidersRefreshProviderResponse>>; - beginRefreshProviderAndWait(fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersRefreshProviderOptionalParams): Promise; - get(fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersGetOptionalParams): Promise; - list(options?: ReplicationRecoveryServicesProvidersListOptionalParams): PagedAsyncIterableIterator; - listByReplicationFabrics(fabricName: string, options?: ReplicationRecoveryServicesProvidersListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, fabricName: string, providerName: string, addProviderInput: AddRecoveryServicesProviderInput, options?: ReplicationRecoveryServicesProvidersCreateOptionalParams): Promise, ReplicationRecoveryServicesProvidersCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, providerName: string, addProviderInput: AddRecoveryServicesProviderInput, options?: ReplicationRecoveryServicesProvidersCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersDeleteOptionalParams): Promise; + beginPurge(resourceName: string, resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersPurgeOptionalParams): Promise, void>>; + beginPurgeAndWait(resourceName: string, resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersPurgeOptionalParams): Promise; + beginRefreshProvider(resourceName: string, resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersRefreshProviderOptionalParams): Promise, ReplicationRecoveryServicesProvidersRefreshProviderResponse>>; + beginRefreshProviderAndWait(resourceName: string, resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersRefreshProviderOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationRecoveryServicesProvidersListOptionalParams): PagedAsyncIterableIterator; + listByReplicationFabrics(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationRecoveryServicesProvidersListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5846,13 +5723,13 @@ export type ReplicationRecoveryServicesProvidersRefreshProviderResponse = Recove // @public export interface ReplicationStorageClassificationMappings { - beginCreate(fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, pairingInput: StorageClassificationMappingInput, options?: ReplicationStorageClassificationMappingsCreateOptionalParams): Promise, ReplicationStorageClassificationMappingsCreateResponse>>; - beginCreateAndWait(fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, pairingInput: StorageClassificationMappingInput, options?: ReplicationStorageClassificationMappingsCreateOptionalParams): Promise; - beginDelete(fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, options?: ReplicationStorageClassificationMappingsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, options?: ReplicationStorageClassificationMappingsDeleteOptionalParams): Promise; - get(fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, options?: ReplicationStorageClassificationMappingsGetOptionalParams): Promise; - list(options?: ReplicationStorageClassificationMappingsListOptionalParams): PagedAsyncIterableIterator; - listByReplicationStorageClassifications(fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, pairingInput: StorageClassificationMappingInput, options?: ReplicationStorageClassificationMappingsCreateOptionalParams): Promise, ReplicationStorageClassificationMappingsCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, pairingInput: StorageClassificationMappingInput, options?: ReplicationStorageClassificationMappingsCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, options?: ReplicationStorageClassificationMappingsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, options?: ReplicationStorageClassificationMappingsDeleteOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, options?: ReplicationStorageClassificationMappingsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationStorageClassificationMappingsListOptionalParams): PagedAsyncIterableIterator; + listByReplicationStorageClassifications(resourceName: string, resourceGroupName: string, fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5907,9 +5784,9 @@ export type ReplicationStorageClassificationMappingsListResponse = StorageClassi // @public export interface ReplicationStorageClassifications { - get(fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationsGetOptionalParams): Promise; - list(options?: ReplicationStorageClassificationsListOptionalParams): PagedAsyncIterableIterator; - listByReplicationFabrics(fabricName: string, options?: ReplicationStorageClassificationsListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; + get(resourceName: string, resourceGroupName: string, fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationsGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationStorageClassificationsListOptionalParams): PagedAsyncIterableIterator; + listByReplicationFabrics(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationStorageClassificationsListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -5949,9 +5826,9 @@ export type ReplicationStorageClassificationsListResponse = StorageClassificatio // @public export interface ReplicationVaultHealth { - beginRefresh(options?: ReplicationVaultHealthRefreshOptionalParams): Promise, ReplicationVaultHealthRefreshResponse>>; - beginRefreshAndWait(options?: ReplicationVaultHealthRefreshOptionalParams): Promise; - get(options?: ReplicationVaultHealthGetOptionalParams): Promise; + beginRefresh(resourceName: string, resourceGroupName: string, options?: ReplicationVaultHealthRefreshOptionalParams): Promise, ReplicationVaultHealthRefreshResponse>>; + beginRefreshAndWait(resourceName: string, resourceGroupName: string, options?: ReplicationVaultHealthRefreshOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, options?: ReplicationVaultHealthGetOptionalParams): Promise; } // @public @@ -5972,10 +5849,10 @@ export type ReplicationVaultHealthRefreshResponse = VaultHealthDetails; // @public export interface ReplicationVaultSetting { - beginCreate(vaultSettingName: string, input: VaultSettingCreationInput, options?: ReplicationVaultSettingCreateOptionalParams): Promise, ReplicationVaultSettingCreateResponse>>; - beginCreateAndWait(vaultSettingName: string, input: VaultSettingCreationInput, options?: ReplicationVaultSettingCreateOptionalParams): Promise; - get(vaultSettingName: string, options?: ReplicationVaultSettingGetOptionalParams): Promise; - list(options?: ReplicationVaultSettingListOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, vaultSettingName: string, input: VaultSettingCreationInput, options?: ReplicationVaultSettingCreateOptionalParams): Promise, ReplicationVaultSettingCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, vaultSettingName: string, input: VaultSettingCreationInput, options?: ReplicationVaultSettingCreateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, vaultSettingName: string, options?: ReplicationVaultSettingGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationVaultSettingListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -6010,15 +5887,15 @@ export type ReplicationVaultSettingListResponse = VaultSettingCollection; // @public export interface ReplicationvCenters { - beginCreate(fabricName: string, vcenterName: string, addVCenterRequest: AddVCenterRequest, options?: ReplicationvCentersCreateOptionalParams): Promise, ReplicationvCentersCreateResponse>>; - beginCreateAndWait(fabricName: string, vcenterName: string, addVCenterRequest: AddVCenterRequest, options?: ReplicationvCentersCreateOptionalParams): Promise; - beginDelete(fabricName: string, vcenterName: string, options?: ReplicationvCentersDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(fabricName: string, vcenterName: string, options?: ReplicationvCentersDeleteOptionalParams): Promise; - beginUpdate(fabricName: string, vcenterName: string, updateVCenterRequest: UpdateVCenterRequest, options?: ReplicationvCentersUpdateOptionalParams): Promise, ReplicationvCentersUpdateResponse>>; - beginUpdateAndWait(fabricName: string, vcenterName: string, updateVCenterRequest: UpdateVCenterRequest, options?: ReplicationvCentersUpdateOptionalParams): Promise; - get(fabricName: string, vcenterName: string, options?: ReplicationvCentersGetOptionalParams): Promise; - list(options?: ReplicationvCentersListOptionalParams): PagedAsyncIterableIterator; - listByReplicationFabrics(fabricName: string, options?: ReplicationvCentersListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; + beginCreate(resourceName: string, resourceGroupName: string, fabricName: string, vcenterName: string, addVCenterRequest: AddVCenterRequest, options?: ReplicationvCentersCreateOptionalParams): Promise, ReplicationvCentersCreateResponse>>; + beginCreateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, vcenterName: string, addVCenterRequest: AddVCenterRequest, options?: ReplicationvCentersCreateOptionalParams): Promise; + beginDelete(resourceName: string, resourceGroupName: string, fabricName: string, vcenterName: string, options?: ReplicationvCentersDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceName: string, resourceGroupName: string, fabricName: string, vcenterName: string, options?: ReplicationvCentersDeleteOptionalParams): Promise; + beginUpdate(resourceName: string, resourceGroupName: string, fabricName: string, vcenterName: string, updateVCenterRequest: UpdateVCenterRequest, options?: ReplicationvCentersUpdateOptionalParams): Promise, ReplicationvCentersUpdateResponse>>; + beginUpdateAndWait(resourceName: string, resourceGroupName: string, fabricName: string, vcenterName: string, updateVCenterRequest: UpdateVCenterRequest, options?: ReplicationvCentersUpdateOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, fabricName: string, vcenterName: string, options?: ReplicationvCentersGetOptionalParams): Promise; + list(resourceName: string, resourceGroupName: string, options?: ReplicationvCentersListOptionalParams): PagedAsyncIterableIterator; + listByReplicationFabrics(resourceName: string, resourceGroupName: string, fabricName: string, options?: ReplicationvCentersListByReplicationFabricsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -6139,6 +6016,24 @@ export interface ResumeJobParamsProperties { comments?: string; } +// @public +export interface ResumeReplicationInput { + properties: ResumeReplicationInputProperties; +} + +// @public +export interface ResumeReplicationInputProperties { + providerSpecificDetails: ResumeReplicationProviderSpecificInputUnion; +} + +// @public +export interface ResumeReplicationProviderSpecificInput { + instanceType: "VMwareCbt"; +} + +// @public (undocumented) +export type ResumeReplicationProviderSpecificInputUnion = ResumeReplicationProviderSpecificInput | VMwareCbtResumeReplicationInput; + // @public export interface ResyncInput { properties: ResyncInputProperties; @@ -6206,13 +6101,13 @@ export interface RunAsAccount { } // @public -export type ScriptActionTaskDetails = TaskTypeDetails & { +export interface ScriptActionTaskDetails extends TaskTypeDetails { instanceType: "ScriptActionTaskDetails"; + isPrimarySideScript?: boolean; name?: string; - path?: string; output?: string; - isPrimarySideScript?: boolean; -}; + path?: string; +} // @public export interface ServiceError { @@ -6233,7 +6128,7 @@ export type Severity = string; export class SiteRecoveryManagementClient extends coreClient.ServiceClient { // (undocumented) $host: string; - constructor(credentials: coreAuth.TokenCredential, resourceGroupName: string, subscriptionId: string, resourceName: string, options?: SiteRecoveryManagementClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: SiteRecoveryManagementClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -6289,10 +6184,6 @@ export class SiteRecoveryManagementClient extends coreClient.ServiceClient { // (undocumented) replicationvCenters: ReplicationvCenters; // (undocumented) - resourceGroupName: string; - // (undocumented) - resourceName: string; - // (undocumented) subscriptionId: string; // (undocumented) supportedOperatingSystemsOperations: SupportedOperatingSystemsOperations; @@ -6322,9 +6213,9 @@ export interface StorageAccountCustomDetails { export type StorageAccountCustomDetailsUnion = StorageAccountCustomDetails | ExistingStorageAccount; // @public -export type StorageClassification = Resource & { +export interface StorageClassification extends Resource { properties?: StorageClassificationProperties; -}; +} // @public export interface StorageClassificationCollection { @@ -6333,9 +6224,9 @@ export interface StorageClassificationCollection { } // @public -export type StorageClassificationMapping = Resource & { +export interface StorageClassificationMapping extends Resource { properties?: StorageClassificationMappingProperties; -}; +} // @public export interface StorageClassificationMappingCollection { @@ -6371,9 +6262,9 @@ export interface Subnet { } // @public -export type SupportedOperatingSystems = Resource & { +export interface SupportedOperatingSystems extends Resource { properties?: SupportedOSProperties; -}; +} // @public export interface SupportedOperatingSystemsGetOptionalParams extends coreClient.OperationOptions { @@ -6385,7 +6276,7 @@ export type SupportedOperatingSystemsGetResponse = SupportedOperatingSystems; // @public export interface SupportedOperatingSystemsOperations { - get(options?: SupportedOperatingSystemsGetOptionalParams): Promise; + get(resourceName: string, resourceGroupName: string, options?: SupportedOperatingSystemsGetOptionalParams): Promise; } // @public @@ -6418,10 +6309,10 @@ export interface SwitchProtectionInputProperties { } // @public -export type SwitchProtectionJobDetails = JobDetails & { +export interface SwitchProtectionJobDetails extends JobDetails { instanceType: "SwitchProtectionJobDetails"; newReplicationProtectedItemId?: string; -}; +} // @public export interface SwitchProtectionProviderSpecificInput { @@ -6480,7 +6371,7 @@ export interface TargetComputeSizeProperties { // @public export interface TargetComputeSizes { - listByReplicationProtectedItems(fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: TargetComputeSizesListByReplicationProtectedItemsOptionalParams): PagedAsyncIterableIterator; + listByReplicationProtectedItems(resourceName: string, resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: TargetComputeSizesListByReplicationProtectedItemsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -6529,15 +6420,15 @@ export interface TestFailoverInputProperties { } // @public -export type TestFailoverJobDetails = JobDetails & { - instanceType: "TestFailoverJobDetails"; - testFailoverStatus?: string; +export interface TestFailoverJobDetails extends JobDetails { comments?: string; - networkName?: string; + instanceType: "TestFailoverJobDetails"; networkFriendlyName?: string; + networkName?: string; networkType?: string; protectedItemDetails?: FailoverReplicationProtectedItemDetails[]; -}; + testFailoverStatus?: string; +} // @public export interface TestFailoverProviderSpecificInput { @@ -6735,9 +6626,9 @@ export interface UpdateVCenterRequestProperties { } // @public -export type VaultHealthDetails = Resource & { +export interface VaultHealthDetails extends Resource { properties?: VaultHealthProperties; -}; +} // @public export interface VaultHealthProperties { @@ -6748,9 +6639,9 @@ export interface VaultHealthProperties { } // @public -export type VaultSetting = Resource & { +export interface VaultSetting extends Resource { properties?: VaultSettingProperties; -}; +} // @public export interface VaultSettingCollection { @@ -6776,9 +6667,9 @@ export interface VaultSettingProperties { } // @public -export type VCenter = Resource & { +export interface VCenter extends Resource { properties?: VCenterProperties; -}; +} // @public export interface VCenterCollection { @@ -6809,54 +6700,54 @@ export interface VersionDetails { } // @public -export type VirtualMachineTaskDetails = JobTaskDetails & { +export interface VirtualMachineTaskDetails extends JobTaskDetails { instanceType: "VirtualMachineTaskDetails"; skippedReason?: string; skippedReasonString?: string; -}; +} // @public export type VmEncryptionType = string; // @public -export type VmmDetails = FabricSpecificDetails & { +export interface VmmDetails extends FabricSpecificDetails { instanceType: "VMM"; -}; +} // @public -export type VmmToAzureCreateNetworkMappingInput = FabricSpecificCreateNetworkMappingInput & { +export interface VmmToAzureCreateNetworkMappingInput extends FabricSpecificCreateNetworkMappingInput { instanceType: "VmmToAzure"; -}; +} // @public -export type VmmToAzureNetworkMappingSettings = NetworkMappingFabricSpecificSettings & { +export interface VmmToAzureNetworkMappingSettings extends NetworkMappingFabricSpecificSettings { instanceType: "VmmToAzure"; -}; +} // @public -export type VmmToAzureUpdateNetworkMappingInput = FabricSpecificUpdateNetworkMappingInput & { +export interface VmmToAzureUpdateNetworkMappingInput extends FabricSpecificUpdateNetworkMappingInput { instanceType: "VmmToAzure"; -}; +} // @public -export type VmmToVmmCreateNetworkMappingInput = FabricSpecificCreateNetworkMappingInput & { +export interface VmmToVmmCreateNetworkMappingInput extends FabricSpecificCreateNetworkMappingInput { instanceType: "VmmToVmm"; -}; +} // @public -export type VmmToVmmNetworkMappingSettings = NetworkMappingFabricSpecificSettings & { +export interface VmmToVmmNetworkMappingSettings extends NetworkMappingFabricSpecificSettings { instanceType: "VmmToVmm"; -}; +} // @public -export type VmmToVmmUpdateNetworkMappingInput = FabricSpecificUpdateNetworkMappingInput & { +export interface VmmToVmmUpdateNetworkMappingInput extends FabricSpecificUpdateNetworkMappingInput { instanceType: "VmmToVmm"; -}; +} // @public -export type VmmVirtualMachineDetails = HyperVVirtualMachineDetails & { +export interface VmmVirtualMachineDetails extends HyperVVirtualMachineDetails { instanceType: "VmmVirtualMachine"; -}; +} // @public export interface VMNicDetails { @@ -6900,31 +6791,31 @@ export interface VMNicInputDetails { } // @public -export type VmNicUpdatesTaskDetails = TaskTypeDetails & { +export interface VmNicUpdatesTaskDetails extends TaskTypeDetails { instanceType: "VmNicUpdatesTaskDetails"; - vmId?: string; - nicId?: string; name?: string; -}; + nicId?: string; + vmId?: string; +} // @public export type VmReplicationProgressHealth = string; // @public -export type VMwareCbtContainerCreationInput = ReplicationProviderSpecificContainerCreationInput & { +export interface VMwareCbtContainerCreationInput extends ReplicationProviderSpecificContainerCreationInput { instanceType: "VMwareCbt"; -}; +} // @public -export type VMwareCbtContainerMappingInput = ReplicationProviderSpecificContainerMappingInput & { +export interface VMwareCbtContainerMappingInput extends ReplicationProviderSpecificContainerMappingInput { instanceType: "VMwareCbt"; - keyVaultId: string; - keyVaultUri: string; + keyVaultId?: string; + keyVaultUri?: string; + serviceBusConnectionStringSecretName?: string; storageAccountId: string; - storageAccountSasSecretName: string; - serviceBusConnectionStringSecretName: string; + storageAccountSasSecretName?: string; targetLocation: string; -}; +} // @public export interface VMwareCbtDiskInput { @@ -6937,96 +6828,103 @@ export interface VMwareCbtDiskInput { } // @public -export type VMwareCbtEnableMigrationInput = EnableMigrationProviderSpecificInput & { - instanceType: "VMwareCbt"; - vmwareMachineId: string; +export interface VMwareCbtEnableMigrationInput extends EnableMigrationProviderSpecificInput { + dataMoverRunAsAccountId: string; disksToInclude: VMwareCbtDiskInput[]; + instanceType: "VMwareCbt"; licenseType?: LicenseType; - sqlServerLicenseType?: SqlServerLicenseType; - dataMoverRunAsAccountId: string; - snapshotRunAsAccountId: string; - targetVmName?: string; - targetVmSize?: string; - targetResourceGroupId: string; - targetNetworkId: string; - targetSubnetName?: string; - targetAvailabilitySetId?: string; - targetAvailabilityZone?: string; - targetProximityPlacementGroupId?: string; - targetBootDiagnosticsStorageAccountId?: string; performAutoResync?: string; - targetVmTags?: { - [propertyName: string]: string; - }; + performSqlBulkRegistration?: string; seedDiskTags?: { [propertyName: string]: string; }; + snapshotRunAsAccountId: string; + sqlServerLicenseType?: SqlServerLicenseType; + targetAvailabilitySetId?: string; + targetAvailabilityZone?: string; + targetBootDiagnosticsStorageAccountId?: string; targetDiskTags?: { [propertyName: string]: string; }; + targetNetworkId: string; targetNicTags?: { [propertyName: string]: string; }; -}; + targetProximityPlacementGroupId?: string; + targetResourceGroupId: string; + targetSubnetName?: string; + targetVmName?: string; + targetVmSize?: string; + targetVmTags?: { + [propertyName: string]: string; + }; + testNetworkId?: string; + testSubnetName?: string; + vmwareMachineId: string; +} // @public -export type VMwareCbtEventDetails = EventProviderSpecificDetails & { +export interface VMwareCbtEventDetails extends EventProviderSpecificDetails { instanceType: "VMwareCbt"; readonly migrationItemName?: string; -}; +} // @public -export type VMwareCbtMigrateInput = MigrateProviderSpecificInput & { +export interface VMwareCbtMigrateInput extends MigrateProviderSpecificInput { instanceType: "VMwareCbt"; performShutdown: string; -}; +} // @public -export type VMwareCbtMigrationDetails = MigrationProviderSpecificSettings & { - instanceType: "VMwareCbt"; - readonly vmwareMachineId?: string; - readonly osType?: string; +export interface VMwareCbtMigrationDetails extends MigrationProviderSpecificSettings { + readonly dataMoverRunAsAccountId?: string; readonly firmwareType?: string; - readonly targetGeneration?: string; + readonly initialSeedingProgressPercentage?: number; + readonly initialSeedingRetryCount?: number; + instanceType: "VMwareCbt"; + readonly lastRecoveryPointId?: string; + readonly lastRecoveryPointReceived?: Date; licenseType?: string; - sqlServerLicenseType?: string; - readonly dataMoverRunAsAccountId?: string; + readonly migrationProgressPercentage?: number; + readonly migrationRecoveryPointId?: string; + readonly osType?: string; + performAutoResync?: string; + protectedDisks?: VMwareCbtProtectedDiskDetails[]; + readonly resumeProgressPercentage?: number; + readonly resumeRetryCount?: number; + readonly resyncProgressPercentage?: number; + readonly resyncRequired?: string; + readonly resyncRetryCount?: number; + readonly resyncState?: ResyncState; + seedDiskTags?: { + [propertyName: string]: string; + }; readonly snapshotRunAsAccountId?: string; - targetVmName?: string; - targetVmSize?: string; - readonly targetLocation?: string; - targetResourceGroupId?: string; + sqlServerLicenseType?: string; + readonly storageAccountId?: string; targetAvailabilitySetId?: string; targetAvailabilityZone?: string; - targetProximityPlacementGroupId?: string; targetBootDiagnosticsStorageAccountId?: string; - targetVmTags?: { + targetDiskTags?: { [propertyName: string]: string; }; - protectedDisks?: VMwareCbtProtectedDiskDetails[]; + readonly targetGeneration?: string; + readonly targetLocation?: string; targetNetworkId?: string; - vmNics?: VMwareCbtNicDetails[]; targetNicTags?: { [propertyName: string]: string; }; - readonly migrationRecoveryPointId?: string; - readonly lastRecoveryPointReceived?: Date; - readonly lastRecoveryPointId?: string; - readonly initialSeedingProgressPercentage?: number; - readonly migrationProgressPercentage?: number; - readonly resyncProgressPercentage?: number; - readonly initialSeedingRetryCount?: number; - readonly resyncRetryCount?: number; - readonly resyncRequired?: string; - readonly resyncState?: ResyncState; - performAutoResync?: string; - seedDiskTags?: { - [propertyName: string]: string; - }; - targetDiskTags?: { + targetProximityPlacementGroupId?: string; + targetResourceGroupId?: string; + targetVmName?: string; + targetVmSize?: string; + targetVmTags?: { [propertyName: string]: string; }; -}; + testNetworkId?: string; + vmNics?: VMwareCbtNicDetails[]; + readonly vmwareMachineId?: string; +} // @public export interface VMwareCbtNicDetails { @@ -7040,6 +6938,10 @@ export interface VMwareCbtNicDetails { targetIPAddressType?: EthernetAddressType; targetNicName?: string; targetSubnetName?: string; + testIPAddress?: string; + testIPAddressType?: EthernetAddressType; + testNetworkId?: string; + testSubnetName?: string; } // @public @@ -7050,23 +6952,25 @@ export interface VMwareCbtNicInput { targetNicName?: string; targetStaticIPAddress?: string; targetSubnetName?: string; + testStaticIPAddress?: string; + testSubnetName?: string; } // @public -export type VMwareCbtPolicyCreationInput = PolicyProviderSpecificInput & { +export interface VMwareCbtPolicyCreationInput extends PolicyProviderSpecificInput { + appConsistentFrequencyInMinutes?: number; + crashConsistentFrequencyInMinutes?: number; instanceType: "VMwareCbt"; recoveryPointHistoryInMinutes?: number; - crashConsistentFrequencyInMinutes?: number; - appConsistentFrequencyInMinutes?: number; -}; +} // @public -export type VmwareCbtPolicyDetails = PolicyProviderSpecificDetails & { - instanceType: "VMwareCbt"; - recoveryPointHistoryInMinutes?: number; +export interface VmwareCbtPolicyDetails extends PolicyProviderSpecificDetails { appConsistentFrequencyInMinutes?: number; crashConsistentFrequencyInMinutes?: number; -}; + instanceType: "VMwareCbt"; + recoveryPointHistoryInMinutes?: number; +} // @public export interface VMwareCbtProtectedDiskDetails { @@ -7079,140 +6983,154 @@ export interface VMwareCbtProtectedDiskDetails { readonly isOSDisk?: string; readonly logStorageAccountId?: string; readonly logStorageAccountSasSecretName?: string; + readonly seedBlobUri?: string; readonly seedManagedDiskId?: string; + readonly targetBlobUri?: string; targetDiskName?: string; readonly targetManagedDiskId?: string; } // @public -export type VMwareCbtProtectionContainerMappingDetails = ProtectionContainerMappingProviderSpecificDetails & { +export interface VMwareCbtProtectionContainerMappingDetails extends ProtectionContainerMappingProviderSpecificDetails { instanceType: "VMwareCbt"; readonly keyVaultId?: string; readonly keyVaultUri?: string; + readonly roleSizeToNicCountMap?: { + [propertyName: string]: number; + }; + readonly serviceBusConnectionStringSecretName?: string; readonly storageAccountId?: string; readonly storageAccountSasSecretName?: string; - readonly serviceBusConnectionStringSecretName?: string; readonly targetLocation?: string; -}; +} + +// @public +export interface VMwareCbtResumeReplicationInput extends ResumeReplicationProviderSpecificInput { + deleteMigrationResources?: string; + instanceType: "VMwareCbt"; +} // @public -export type VMwareCbtResyncInput = ResyncProviderSpecificInput & { +export interface VMwareCbtResyncInput extends ResyncProviderSpecificInput { instanceType: "VMwareCbt"; skipCbtReset: string; -}; +} // @public -export type VMwareCbtTestMigrateInput = TestMigrateProviderSpecificInput & { +export interface VMwareCbtTestMigrateInput extends TestMigrateProviderSpecificInput { instanceType: "VMwareCbt"; - recoveryPointId: string; networkId: string; -}; + recoveryPointId: string; + vmNics?: VMwareCbtNicInput[]; +} // @public export interface VMwareCbtUpdateDiskInput { diskId: string; + isOSDisk?: string; targetDiskName?: string; } // @public -export type VMwareCbtUpdateMigrationItemInput = UpdateMigrationItemProviderSpecificInput & { +export interface VMwareCbtUpdateMigrationItemInput extends UpdateMigrationItemProviderSpecificInput { instanceType: "VMwareCbt"; - targetVmName?: string; - targetVmSize?: string; - targetResourceGroupId?: string; + licenseType?: LicenseType; + performAutoResync?: string; + sqlServerLicenseType?: SqlServerLicenseType; targetAvailabilitySetId?: string; targetAvailabilityZone?: string; - targetProximityPlacementGroupId?: string; targetBootDiagnosticsStorageAccountId?: string; - targetNetworkId?: string; - vmNics?: VMwareCbtNicInput[]; - vmDisks?: VMwareCbtUpdateDiskInput[]; - licenseType?: LicenseType; - sqlServerLicenseType?: SqlServerLicenseType; - performAutoResync?: string; - targetVmTags?: { - [propertyName: string]: string; - }; targetDiskTags?: { [propertyName: string]: string; }; + targetNetworkId?: string; targetNicTags?: { [propertyName: string]: string; }; -}; + targetProximityPlacementGroupId?: string; + targetResourceGroupId?: string; + targetVmName?: string; + targetVmSize?: string; + targetVmTags?: { + [propertyName: string]: string; + }; + testNetworkId?: string; + vmDisks?: VMwareCbtUpdateDiskInput[]; + vmNics?: VMwareCbtNicInput[]; +} // @public -export type VMwareDetails = FabricSpecificDetails & { - instanceType: "VMware"; - processServers?: ProcessServer[]; - masterTargetServers?: MasterTargetServer[]; - runAsAccounts?: RunAsAccount[]; - replicationPairCount?: string; - processServerCount?: string; +export interface VMwareDetails extends FabricSpecificDetails { agentCount?: string; - protectedServers?: string; - systemLoad?: string; - systemLoadStatus?: string; - cpuLoad?: string; - cpuLoadStatus?: string; - totalMemoryInBytes?: number; + agentExpiryDate?: Date; + agentVersion?: string; + agentVersionDetails?: VersionDetails; availableMemoryInBytes?: number; - memoryUsageStatus?: string; - totalSpaceInBytes?: number; availableSpaceInBytes?: number; - spaceUsageStatus?: string; - webLoad?: string; - webLoadStatus?: string; + cpuLoad?: string; + cpuLoadStatus?: string; + csServiceStatus?: string; databaseServerLoad?: string; databaseServerLoadStatus?: string; - csServiceStatus?: string; - ipAddress?: string; - agentVersion?: string; hostName?: string; + instanceType: "VMware"; + ipAddress?: string; lastHeartbeat?: Date; - versionStatus?: string; + masterTargetServers?: MasterTargetServer[]; + memoryUsageStatus?: string; + processServerCount?: string; + processServers?: ProcessServer[]; + protectedServers?: string; + psTemplateVersion?: string; + replicationPairCount?: string; + runAsAccounts?: RunAsAccount[]; + spaceUsageStatus?: string; sslCertExpiryDate?: Date; sslCertExpiryRemainingDays?: number; - psTemplateVersion?: string; - agentExpiryDate?: Date; - agentVersionDetails?: VersionDetails; switchProviderBlockingErrorDetails?: InMageFabricSwitchProviderBlockingErrorDetails[]; -}; + systemLoad?: string; + systemLoadStatus?: string; + totalMemoryInBytes?: number; + totalSpaceInBytes?: number; + versionStatus?: string; + webLoad?: string; + webLoadStatus?: string; +} // @public -export type VMwareV2FabricCreationInput = FabricSpecificCreationInput & { +export interface VMwareV2FabricCreationInput extends FabricSpecificCreationInput { instanceType: "VMwareV2"; - vmwareSiteId?: string; - physicalSiteId?: string; migrationSolutionId: string; -}; + physicalSiteId?: string; + vmwareSiteId?: string; +} // @public -export type VMwareV2FabricSpecificDetails = FabricSpecificDetails & { +export interface VMwareV2FabricSpecificDetails extends FabricSpecificDetails { instanceType: "VMwareV2"; - readonly vmwareSiteId?: string; - readonly physicalSiteId?: string; readonly migrationSolutionId?: string; + readonly physicalSiteId?: string; + readonly processServers?: ProcessServerDetails[]; + readonly serviceContainerId?: string; readonly serviceEndpoint?: string; readonly serviceResourceId?: string; - readonly serviceContainerId?: string; - readonly processServers?: ProcessServerDetails[]; -}; + readonly vmwareSiteId?: string; +} // @public -export type VMwareVirtualMachineDetails = ConfigurationSettings & { - instanceType: "VMwareVirtualMachine"; +export interface VMwareVirtualMachineDetails extends ConfigurationSettings { agentGeneratedId?: string; agentInstalled?: string; - osType?: string; agentVersion?: string; - ipAddress?: string; - poweredOn?: string; - vCenterInfrastructureId?: string; discoveryType?: string; diskDetails?: InMageDiskDetails[]; + instanceType: "VMwareVirtualMachine"; + ipAddress?: string; + osType?: string; + poweredOn?: string; validationErrors?: HealthError[]; -}; + vCenterInfrastructureId?: string; +} // (No @packageDocumentation comment for this package) diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/rollup.config.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/rollup.config.js index 9be1955eb7f1..3f89d7309da5 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/rollup.config.js +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/rollup.config.js @@ -14,62 +14,14 @@ 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 rollupwarning should be ignored. If + * A function that can determine whether a rollup warning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEvalWarnings(warning) { +function ignoreNiseSinonEval(warning) { return ( warning.code === "EVAL" && warning.id && @@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) { ); } -function ignoreChaiCircularDependencyWarnings(warning) { +function ignoreChaiCircularDependency(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ - ignoreChaiCircularDependencyWarnings, - ignoreNiseSinonEvalWarnings -]; +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; /** * Construct a warning handler for the shared rollup configuration @@ -122,22 +71,7 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs({ - namedExports: { - // Chai's strange internal architecture makes it impossible to statically - // analyze its exports. - chai: [ - "version", - "use", - "util", - "config", - "expect", - "should", - "assert" - ], - ...openTelemetryCommonJs() - } - }), + cjs(), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -173,7 +107,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve(), cjs()] + plugins: [sourcemaps(), nodeResolve()] }; const config = [baseConfig]; diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/sample.env b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/migrationRecoveryPointsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/migrationRecoveryPointsGetSample.ts new file mode 100644 index 000000000000..08c7d223a0e6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/migrationRecoveryPointsGetSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a recovery point for a migration item. + * + * @summary Gets a recovery point for a migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_Get.json + */ +async function getsARecoveryPointForAMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const migrationRecoveryPointName = "b22134ea-620c-474b-9fa5-3c1cb47708e3"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.migrationRecoveryPoints.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName + ); + console.log(result); +} + +getsARecoveryPointForAMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/migrationRecoveryPointsListByReplicationMigrationItemsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/migrationRecoveryPointsListByReplicationMigrationItemsSample.ts new file mode 100644 index 000000000000..0bcfd015ef62 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/migrationRecoveryPointsListByReplicationMigrationItemsSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the recovery points for a migration item. + * + * @summary Gets the recovery points for a migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json + */ +async function getsTheRecoveryPointsForAMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.migrationRecoveryPoints.listByReplicationMigrationItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheRecoveryPointsForAMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/operationsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/operationsListSample.ts new file mode 100644 index 000000000000..aa20be50077d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/operationsListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to return the list of available operations. + * + * @summary Operation to return the list of available operations. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/Operations_List.json + */ +async function returnsTheListOfAvailableOperations() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +returnsTheListOfAvailableOperations().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/recoveryPointsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/recoveryPointsGetSample.ts new file mode 100644 index 000000000000..387807a76066 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/recoveryPointsGetSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the details of specified recovery point. + * + * @summary Get the details of specified recovery point. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_Get.json + */ +async function getsARecoveryPoint() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const recoveryPointName = "b22134ea-620c-474b-9fa5-3c1cb47708e3"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.recoveryPoints.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName + ); + console.log(result); +} + +getsARecoveryPoint().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/recoveryPointsListByReplicationProtectedItemsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/recoveryPointsListByReplicationProtectedItemsSample.ts new file mode 100644 index 000000000000..bf9dc205a3af --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/recoveryPointsListByReplicationProtectedItemsSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the available recovery points for a replication protected item. + * + * @summary Lists the available recovery points for a replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json + */ +async function getsTheListOfRecoveryPointsForAReplicationProtectedItem() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.recoveryPoints.listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRecoveryPointsForAReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAlertSettingsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAlertSettingsCreateSample.ts new file mode 100644 index 000000000000..f54f4a57870a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAlertSettingsCreateSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigureAlertRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update an email notification(alert) configuration. + * + * @summary Create or update an email notification(alert) configuration. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Create.json + */ +async function configuresEmailNotificationsForThisVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const alertSettingName = "defaultAlertSetting"; + const request: ConfigureAlertRequest = { + properties: { + customEmailAddresses: ["ronehr@microsoft.com"], + locale: "", + sendToOwners: "false" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationAlertSettings.create( + resourceName, + resourceGroupName, + alertSettingName, + request + ); + console.log(result); +} + +configuresEmailNotificationsForThisVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAlertSettingsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAlertSettingsGetSample.ts new file mode 100644 index 000000000000..93efd383a375 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAlertSettingsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of the specified email notification(alert) configuration. + * + * @summary Gets the details of the specified email notification(alert) configuration. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Get.json + */ +async function getsAnEmailNotificationAlertConfiguration() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const alertSettingName = "defaultAlertSetting"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationAlertSettings.get( + resourceName, + resourceGroupName, + alertSettingName + ); + console.log(result); +} + +getsAnEmailNotificationAlertConfiguration().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAlertSettingsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAlertSettingsListSample.ts new file mode 100644 index 000000000000..0c8755d33eb7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAlertSettingsListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of email notification(alert) configurations for the vault. + * + * @summary Gets the list of email notification(alert) configurations for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_List.json + */ +async function getsTheListOfConfiguredEmailNotificationAlertConfigurations() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationAlertSettings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfConfiguredEmailNotificationAlertConfigurations().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAppliancesListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAppliancesListSample.ts new file mode 100644 index 000000000000..63bb4497c846 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationAppliancesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Azure Site Recovery appliances for the vault. + * + * @summary Gets the list of Azure Site Recovery appliances for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAppliances_List.json + */ +async function getsTheListOfAppliances() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationAppliances.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAppliances().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEligibilityResultsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEligibilityResultsGetSample.ts new file mode 100644 index 000000000000..0a4ba3e8e6c6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEligibilityResultsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @summary Validates whether a given VM can be protected or not in which case returns list of errors. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_Get.json + */ +async function getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { + const subscriptionId = "d90d145a-4cdd-45a3-b2c4-971d69775278"; + const resourceGroupName = "testRg1"; + const virtualMachineName = "testVm1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationEligibilityResultsOperations.get( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEligibilityResultsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEligibilityResultsListSample.ts new file mode 100644 index 000000000000..8cf5089bc148 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEligibilityResultsListSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @summary Validates whether a given VM can be protected or not in which case returns list of errors. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_List.json + */ +async function getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { + const subscriptionId = "d90d145a-4cdd-45a3-b2c4-971d69775278"; + const resourceGroupName = "testRg1"; + const virtualMachineName = "testVm2"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationEligibilityResultsOperations.list( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEventsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEventsGetSample.ts new file mode 100644 index 000000000000..81f8f010b271 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEventsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the details of an Azure Site recovery event. + * + * @summary The operation to get the details of an Azure Site recovery event. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_Get.json + */ +async function getTheDetailsOfAnAzureSiteRecoveryEvent() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const eventName = "654b71d0-b2ce-4e6e-a861-98528d4bd375"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationEvents.get( + resourceName, + resourceGroupName, + eventName + ); + console.log(result); +} + +getTheDetailsOfAnAzureSiteRecoveryEvent().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEventsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEventsListSample.ts new file mode 100644 index 000000000000..1ba3347edf77 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationEventsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Azure Site Recovery events for the vault. + * + * @summary Gets the list of Azure Site Recovery events for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_List.json + */ +async function getsTheListOfAzureSiteRecoveryEvents() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationEvents.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAzureSiteRecoveryEvents().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsCheckConsistencySample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsCheckConsistencySample.ts new file mode 100644 index 000000000000..4282b4608046 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsCheckConsistencySample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to perform a consistency check on the fabric. + * + * @summary The operation to perform a consistency check on the fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_CheckConsistency.json + */ +async function checksTheConsistencyOfTheAsrFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginCheckConsistencyAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +checksTheConsistencyOfTheAsrFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsCreateSample.ts new file mode 100644 index 000000000000..7386ebcb7e43 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsCreateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + FabricCreationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @summary The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Create.json + */ +async function createsAnAzureSiteRecoveryFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const input: FabricCreationInput = { + properties: { + customDetails: { instanceType: "VMwareV2" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + input + ); + console.log(result); +} + +createsAnAzureSiteRecoveryFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsDeleteSample.ts new file mode 100644 index 000000000000..6e71e455f843 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete or remove an Azure Site Recovery fabric. + * + * @summary The operation to delete or remove an Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Delete.json + */ +async function deletesTheSite() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +deletesTheSite().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsGetSample.ts new file mode 100644 index 000000000000..dcfde5f91f20 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of an Azure Site Recovery fabric. + * + * @summary Gets the details of an Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Get.json + */ +async function getsTheDetailsOfAnAsrFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.get( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +getsTheDetailsOfAnAsrFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsListSample.ts new file mode 100644 index 000000000000..f41f5fdd057e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @summary Gets a list of the Azure Site Recovery fabrics in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_List.json + */ +async function getsTheListOfAsrFabrics() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationFabrics.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAsrFabrics().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsMigrateToAadSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsMigrateToAadSample.ts new file mode 100644 index 000000000000..8ed02f892785 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsMigrateToAadSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @summary The operation to migrate an Azure Site Recovery fabric to AAD. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_MigrateToAad.json + */ +async function migratesTheSiteToAad() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginMigrateToAadAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +migratesTheSiteToAad().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsPurgeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsPurgeSample.ts new file mode 100644 index 000000000000..e92555f60e98 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsPurgeSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @summary The operation to purge(force delete) an Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Purge.json + */ +async function purgesTheSite() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +purgesTheSite().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsReassociateGatewaySample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsReassociateGatewaySample.ts new file mode 100644 index 000000000000..43a8a623cc1a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsReassociateGatewaySample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + FailoverProcessServerRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to move replications from a process server to another process server. + * + * @summary The operation to move replications from a process server to another process server. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_ReassociateGateway.json + */ +async function performFailoverOfTheProcessServer() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "GRACE-V2A-1"; + const failoverProcessServerRequest: FailoverProcessServerRequest = { + properties: { + containerName: "cloud_1f3c15af-2256-4568-9e06-e1ef4f728f75", + sourceProcessServerId: "AFA0EC54-1894-4E44-9CAB02DB8854B117", + targetProcessServerId: "5D3ED340-85AE-C646-B338641E015DA405", + updateType: "ServerLevel", + vmsToMigrate: ["Vm1", "Vm2"] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginReassociateGatewayAndWait( + resourceName, + resourceGroupName, + fabricName, + failoverProcessServerRequest + ); + console.log(result); +} + +performFailoverOfTheProcessServer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsRenewCertificateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsRenewCertificateSample.ts new file mode 100644 index 000000000000..1ec74b5f3e35 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationFabricsRenewCertificateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RenewCertificateInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Renews the connection certificate for the ASR replication fabric. + * + * @summary Renews the connection certificate for the ASR replication fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_RenewCertificate.json + */ +async function renewsCertificateForTheFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const renewCertificate: RenewCertificateInput = { + properties: { renewCertificateType: "Cloud" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginRenewCertificateAndWait( + resourceName, + resourceGroupName, + fabricName, + renewCertificate + ); + console.log(result); +} + +renewsCertificateForTheFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsCancelSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsCancelSample.ts new file mode 100644 index 000000000000..2329b0a6919a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsCancelSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to cancel an Azure Site Recovery job. + * + * @summary The operation to cancel an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Cancel.json + */ +async function cancelsTheSpecifiedJob() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "2653c648-fc72-4316-86f3-fdf8eaa0066b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginCancelAndWait( + resourceName, + resourceGroupName, + jobName + ); + console.log(result); +} + +cancelsTheSpecifiedJob().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsExportSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsExportSample.ts new file mode 100644 index 000000000000..f5329b77d957 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsExportSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + JobQueryParameter, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @summary The operation to export the details of the Azure Site Recovery jobs of the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Export.json + */ +async function exportsTheDetailsOfTheAzureSiteRecoveryJobsOfTheVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobQueryParameter: JobQueryParameter = { + affectedObjectTypes: "", + endTime: "2017-05-04T14:26:51.9161395Z", + jobStatus: "", + startTime: "2017-04-27T14:26:51.9161395Z" + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginExportAndWait( + resourceName, + resourceGroupName, + jobQueryParameter + ); + console.log(result); +} + +exportsTheDetailsOfTheAzureSiteRecoveryJobsOfTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsGetSample.ts new file mode 100644 index 000000000000..6afa4271c76f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the details of an Azure Site Recovery job. + * + * @summary Get the details of an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Get.json + */ +async function getsTheJobDetails() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "58776d0b-3141-48b2-a377-9ad863eb160d"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.get( + resourceName, + resourceGroupName, + jobName + ); + console.log(result); +} + +getsTheJobDetails().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsListSample.ts new file mode 100644 index 000000000000..f1bf5bfc6ca8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Azure Site Recovery Jobs for the vault. + * + * @summary Gets the list of Azure Site Recovery Jobs for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_List.json + */ +async function getsTheListOfJobs() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationJobs.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfJobs().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsRestartSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsRestartSample.ts new file mode 100644 index 000000000000..442faf1dd459 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsRestartSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to restart an Azure Site Recovery job. + * + * @summary The operation to restart an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Restart.json + */ +async function restartsTheSpecifiedJob() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "0664564c-353e-401a-ab0c-722257c10e25"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginRestartAndWait( + resourceName, + resourceGroupName, + jobName + ); + console.log(result); +} + +restartsTheSpecifiedJob().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsResumeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsResumeSample.ts new file mode 100644 index 000000000000..4d3db04e290f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationJobsResumeSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResumeJobParams, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to resume an Azure Site Recovery job. + * + * @summary The operation to resume an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Resume.json + */ +async function resumesTheSpecifiedJob() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "58776d0b-3141-48b2-a377-9ad863eb160d"; + const resumeJobParams: ResumeJobParams = { properties: { comments: " " } }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginResumeAndWait( + resourceName, + resourceGroupName, + jobName, + resumeJobParams + ); + console.log(result); +} + +resumesTheSpecifiedJob().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationLogicalNetworksGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationLogicalNetworksGetSample.ts new file mode 100644 index 000000000000..e2d6d9f42472 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationLogicalNetworksGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a logical network. + * + * @summary Gets the details of a logical network. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_Get.json + */ +async function getsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const logicalNetworkName = "87ab394f-165f-4aa9-bd84-b018500b4509"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationLogicalNetworks.get( + resourceName, + resourceGroupName, + fabricName, + logicalNetworkName + ); + console.log(result); +} + +getsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationLogicalNetworksListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationLogicalNetworksListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..36166a218850 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationLogicalNetworksListByReplicationFabricsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the logical networks of the Azure Site Recovery fabric. + * + * @summary Lists all the logical networks of the Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json + */ +async function getsTheListOfLogicalNetworksUnderAFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationLogicalNetworks.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfLogicalNetworksUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsCreateSample.ts new file mode 100644 index 000000000000..ecd7df8cb28f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsCreateSample.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + EnableMigrationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an ASR migration item (enable migration). + * + * @summary The operation to create an ASR migration item (enable migration). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Create.json + */ +async function enablesMigration() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const input: EnableMigrationInput = { + properties: { + policyId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1", + providerSpecificDetails: { + dataMoverRunAsAccountId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/dataMoverRunAsAccount1", + disksToInclude: [ + { + diskId: "disk1", + isOSDisk: "true", + logStorageAccountId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Storage/storageAccounts/logStorageAccount1", + logStorageAccountSasSecretName: "logStorageSas" + } + ], + instanceType: "VMwareCbt", + snapshotRunAsAccountId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/snapshotRunAsAccount1", + targetNetworkId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1", + targetResourceGroupId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1", + vmwareMachineId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/machines/virtualmachine1" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input + ); + console.log(result); +} + +enablesMigration().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsDeleteSample.ts new file mode 100644 index 000000000000..16ba6af26251 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete an ASR migration item. + * + * @summary The operation to delete an ASR migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Delete.json + */ +async function deleteTheMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName + ); + console.log(result); +} + +deleteTheMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsGetSample.ts new file mode 100644 index 000000000000..6c80125c7b6c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a migration item. + * + * @summary Gets the details of a migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Get.json + */ +async function getsTheDetailsOfAMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName + ); + console.log(result); +} + +getsTheDetailsOfAMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsListByReplicationProtectionContainersSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsListByReplicationProtectionContainersSample.ts new file mode 100644 index 000000000000..c7cc0c8196b9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsListByReplicationProtectionContainersSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of ASR migration items in the protection container. + * + * @summary Gets the list of ASR migration items in the protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfMigrationItemsInTheProtectionContainer() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationMigrationItems.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfMigrationItemsInTheProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsListSample.ts new file mode 100644 index 000000000000..000d1c28c65b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of migration items in the vault. + * + * @summary Gets the list of migration items in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_List.json + */ +async function getsTheListOfMigrationItemsInTheVault() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationMigrationItems.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfMigrationItemsInTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsMigrateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsMigrateSample.ts new file mode 100644 index 000000000000..ab9b861aa97e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsMigrateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MigrateInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate migration of the item. + * + * @summary The operation to initiate migration of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Migrate.json + */ +async function migrateItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const migrateInput: MigrateInput = { + properties: { + providerSpecificDetails: { + instanceType: "VMwareCbt", + performShutdown: "true" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginMigrateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput + ); + console.log(result); +} + +migrateItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsPauseReplicationSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsPauseReplicationSample.ts new file mode 100644 index 000000000000..ffe91ba8e8ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsPauseReplicationSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PauseReplicationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate pause replication of the item. + * + * @summary The operation to initiate pause replication of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_PauseReplication.json + */ +async function pauseReplication() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const pauseReplicationInput: PauseReplicationInput = { + properties: { instanceType: "VMwareCbt" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginPauseReplicationAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput + ); + console.log(result); +} + +pauseReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsResumeReplicationSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsResumeReplicationSample.ts new file mode 100644 index 000000000000..21e71b1b2ca0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsResumeReplicationSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResumeReplicationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate resume replication of the item. + * + * @summary The operation to initiate resume replication of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ResumeReplication.json + */ +async function resumeReplication() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const resumeReplicationInput: ResumeReplicationInput = { + properties: { + providerSpecificDetails: { + deleteMigrationResources: "false", + instanceType: "VMwareCbt" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginResumeReplicationAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput + ); + console.log(result); +} + +resumeReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsResyncSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsResyncSample.ts new file mode 100644 index 000000000000..73d43f1add5e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsResyncSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResyncInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to resynchronize replication of an ASR migration item. + * + * @summary The operation to resynchronize replication of an ASR migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Resync.json + */ +async function resynchronizesReplication() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const input: ResyncInput = { + properties: { + providerSpecificDetails: { + instanceType: "VMwareCbt", + skipCbtReset: "true" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginResyncAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input + ); + console.log(result); +} + +resynchronizesReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsTestMigrateCleanupSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsTestMigrateCleanupSample.ts new file mode 100644 index 000000000000..3712bcfd82ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsTestMigrateCleanupSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TestMigrateCleanupInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate test migrate cleanup. + * + * @summary The operation to initiate test migrate cleanup. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json + */ +async function testMigrateCleanup() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const testMigrateCleanupInput: TestMigrateCleanupInput = { + properties: { comments: "Test Failover Cleanup" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginTestMigrateCleanupAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput + ); + console.log(result); +} + +testMigrateCleanup().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsTestMigrateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsTestMigrateSample.ts new file mode 100644 index 000000000000..0b52cf966b97 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsTestMigrateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TestMigrateInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate test migration of the item. + * + * @summary The operation to initiate test migration of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrate.json + */ +async function testMigrateItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const testMigrateInput: TestMigrateInput = { + properties: { + providerSpecificDetails: { + instanceType: "VMwareCbt", + networkId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1", + recoveryPointId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/9e737191-317e-43d0-8c83-e32ac3b34686" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginTestMigrateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput + ); + console.log(result); +} + +testMigrateItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsUpdateSample.ts new file mode 100644 index 000000000000..ac2c325a8681 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationMigrationItemsUpdateSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateMigrationItemInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the recovery settings of an ASR migration item. + * + * @summary The operation to update the recovery settings of an ASR migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Update.json + */ +async function updatesMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const input: UpdateMigrationItemInput = { + properties: { providerSpecificDetails: { instanceType: "VMwareCbt" } } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input + ); + console.log(result); +} + +updatesMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsCreateSample.ts new file mode 100644 index 000000000000..64cc9dd234b5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsCreateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateNetworkMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an ASR network mapping. + * + * @summary The operation to create an ASR network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Create.json + */ +async function createsNetworkMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const input: CreateNetworkMappingInput = { + properties: { + fabricSpecificDetails: { instanceType: "VmmToAzure" }, + recoveryFabricName: "Microsoft Azure", + recoveryNetworkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + input + ); + console.log(result); +} + +createsNetworkMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsDeleteSample.ts new file mode 100644 index 000000000000..bc9eccacb18d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a network mapping. + * + * @summary The operation to delete a network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Delete.json + */ +async function deleteNetworkMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName + ); + console.log(result); +} + +deleteNetworkMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsGetSample.ts new file mode 100644 index 000000000000..6a3e57656963 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsGetSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of an ASR network mapping. + * + * @summary Gets the details of an ASR network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Get.json + */ +async function getsNetworkMappingByName() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.get( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName + ); + console.log(result); +} + +getsNetworkMappingByName().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsListByReplicationNetworksSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsListByReplicationNetworksSample.ts new file mode 100644 index 000000000000..c13d5437d43f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsListByReplicationNetworksSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all ASR network mappings for the specified network. + * + * @summary Lists all ASR network mappings for the specified network. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json + */ +async function getsAllTheNetworkMappingsUnderANetwork() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworkMappings.listByReplicationNetworks( + resourceName, + resourceGroupName, + fabricName, + networkName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsAllTheNetworkMappingsUnderANetwork().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsListSample.ts new file mode 100644 index 000000000000..9c9069c295db --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all ASR network mappings in the vault. + * + * @summary Lists all ASR network mappings in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_List.json + */ +async function getsAllTheNetworkMappingsUnderAVault() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworkMappings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsAllTheNetworkMappingsUnderAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsUpdateSample.ts new file mode 100644 index 000000000000..7bca6c4b927c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworkMappingsUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateNetworkMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update an ASR network mapping. + * + * @summary The operation to update an ASR network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Update.json + */ +async function updatesNetworkMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const input: UpdateNetworkMappingInput = { + properties: { + fabricSpecificDetails: { instanceType: "VmmToAzure" }, + recoveryFabricName: "Microsoft Azure", + recoveryNetworkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai2" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + input + ); + console.log(result); +} + +updatesNetworkMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworksGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworksGetSample.ts new file mode 100644 index 000000000000..f5dbf16ac137 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworksGetSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a network. + * + * @summary Gets the details of a network. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_Get.json + */ +async function getsANetworkWithSpecifiedServerIdAndNetworkName() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "93ce99d7-1219-4914-aa61-73fe5023988e"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworks.get( + resourceName, + resourceGroupName, + fabricName, + networkName + ); + console.log(result); +} + +getsANetworkWithSpecifiedServerIdAndNetworkName().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworksListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworksListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..ac199f1342f4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworksListByReplicationFabricsSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the networks available for a fabric. + * + * @summary Lists the networks available for a fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_ListByReplicationFabrics.json + */ +async function getsTheListOfNetworksUnderAFabric() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworks.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfNetworksUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworksListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworksListSample.ts new file mode 100644 index 000000000000..9bae52537b87 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationNetworksListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the networks available in a vault. + * + * @summary Lists the networks available in a vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_List.json + */ +async function getsTheListOfNetworksViewOnlyApi() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworks.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfNetworksViewOnlyApi().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesCreateSample.ts new file mode 100644 index 000000000000..dad4e2222182 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesCreateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreatePolicyInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a replication policy. + * + * @summary The operation to create a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Create.json + */ +async function createsThePolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const input: CreatePolicyInput = { + properties: { + providerSpecificInput: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.beginCreateAndWait( + resourceName, + resourceGroupName, + policyName, + input + ); + console.log(result); +} + +createsThePolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesDeleteSample.ts new file mode 100644 index 000000000000..49de7756fd75 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a replication policy. + * + * @summary The operation to delete a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Delete.json + */ +async function deleteThePolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.beginDeleteAndWait( + resourceName, + resourceGroupName, + policyName + ); + console.log(result); +} + +deleteThePolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesGetSample.ts new file mode 100644 index 000000000000..d1e1415f2c25 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a replication policy. + * + * @summary Gets the details of a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Get.json + */ +async function getsTheRequestedPolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.get( + resourceName, + resourceGroupName, + policyName + ); + console.log(result); +} + +getsTheRequestedPolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesListSample.ts new file mode 100644 index 000000000000..614f9699988d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the replication policies for a vault. + * + * @summary Lists the replication policies for a vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_List.json + */ +async function getsTheListOfReplicationPolicies() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationPolicies.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationPolicies().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesUpdateSample.ts new file mode 100644 index 000000000000..88d64c27f185 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationPoliciesUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdatePolicyInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a replication policy. + * + * @summary The operation to update a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Update.json + */ +async function updatesThePolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const input: UpdatePolicyInput = { + properties: { + replicationProviderSettings: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.beginUpdateAndWait( + resourceName, + resourceGroupName, + policyName, + input + ); + console.log(result); +} + +updatesThePolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectableItemsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectableItemsGetSample.ts new file mode 100644 index 000000000000..1997e489113d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectableItemsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the details of a protectable item. + * + * @summary The operation to get the details of a protectable item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_Get.json + */ +async function getsTheDetailsOfAProtectableItem() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const protectableItemName = "c0c14913-3d7a-48ea-9531-cc99e0e686e6"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectableItems.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + protectableItemName + ); + console.log(result); +} + +getsTheDetailsOfAProtectableItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectableItemsListByReplicationProtectionContainersSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectableItemsListByReplicationProtectionContainersSample.ts new file mode 100644 index 000000000000..182987913dc0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectableItemsListByReplicationProtectionContainersSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protectable items in a protection container. + * + * @summary Lists the protectable items in a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfProtectableItems() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectableItems.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfProtectableItems().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsAddDisksSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsAddDisksSample.ts new file mode 100644 index 000000000000..8f05e16040f2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsAddDisksSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AddDisksInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to add disks(s) to the replication protected item. + * + * @summary Operation to add disks(s) to the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_AddDisks.json + */ +async function addDiskSForProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const addDisksInput: AddDisksInput = { + properties: { + providerSpecificDetails: { + instanceType: "A2A", + vmDisks: [ + { + diskUri: + "https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd", + primaryStagingAzureStorageAccountId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/primaryResource/providers/Microsoft.Storage/storageAccounts/vmcachestorage", + recoveryAzureStorageAccountId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/recoveryResource/providers/Microsoft.Storage/storageAccounts/recoverystorage" + } + ] + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginAddDisksAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput + ); + console.log(result); +} + +addDiskSForProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsApplyRecoveryPointSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsApplyRecoveryPointSample.ts new file mode 100644 index 000000000000..1aec4a646a14 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsApplyRecoveryPointSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ApplyRecoveryPointInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to change the recovery point of a failed over replication protected item. + * + * @summary The operation to change the recovery point of a failed over replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json + */ +async function changeOrApplyRecoveryPoint() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const applyRecoveryPointInput: ApplyRecoveryPointInput = { + properties: { + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + recoveryPointId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/e4d05fe9-5dfd-47be-b50b-aad306b2802d" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginApplyRecoveryPointAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput + ); + console.log(result); +} + +changeOrApplyRecoveryPoint().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsCreateSample.ts new file mode 100644 index 000000000000..2be206140d4f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsCreateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + EnableProtectionInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an ASR replication protected item (Enable replication). + * + * @summary The operation to create an ASR replication protected item (Enable replication). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Create.json + */ +async function enablesProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const input: EnableProtectionInput = { + properties: { + policyId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1", + protectableItemId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input + ); + console.log(result); +} + +enablesProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsDeleteSample.ts new file mode 100644 index 000000000000..52afef5b1127 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsDeleteSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DisableProtectionInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to disable replication on a replication protected item. This will also remove the item. + * + * @summary The operation to disable replication on a replication protected item. This will also remove the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Delete.json + */ +async function disablesProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "c0c14913-3d7a-48ea-9531-cc99e0e686e6"; + const disableProtectionInput: DisableProtectionInput = { + properties: { + replicationProviderInput: { + instanceType: "InMage" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput + ); + console.log(result); +} + +disablesProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsFailoverCancelSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsFailoverCancelSample.ts new file mode 100644 index 000000000000..3da3717d50fe --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsFailoverCancelSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to cancel the failover of the replication protected item. + * + * @summary Operation to cancel the failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCancel.json + */ +async function executeCancelFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginFailoverCancelAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +executeCancelFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsFailoverCommitSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsFailoverCommitSample.ts new file mode 100644 index 000000000000..2b3800ea9350 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsFailoverCommitSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to commit the failover of the replication protected item. + * + * @summary Operation to commit the failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCommit.json + */ +async function executeCommitFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginFailoverCommitAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +executeCommitFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsGetSample.ts new file mode 100644 index 000000000000..e5feb1816b68 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of an ASR replication protected item. + * + * @summary Gets the details of an ASR replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Get.json + */ +async function getsTheDetailsOfAReplicationProtectedItem() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +getsTheDetailsOfAReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsListByReplicationProtectionContainersSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsListByReplicationProtectionContainersSample.ts new file mode 100644 index 000000000000..45ec172784a2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsListByReplicationProtectionContainersSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of ASR replication protected items in the protection container. + * + * @summary Gets the list of ASR replication protected items in the protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfReplicationProtectedItems() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectedItems.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationProtectedItems().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsListSample.ts new file mode 100644 index 000000000000..dbf46e465bb8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of ASR replication protected items in the vault. + * + * @summary Gets the list of ASR replication protected items in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_List.json + */ +async function getsTheListOfReplicationProtectedItems() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectedItems.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationProtectedItems().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsPlannedFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsPlannedFailoverSample.ts new file mode 100644 index 000000000000..453947341d25 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsPlannedFailoverSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PlannedFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to initiate a planned failover of the replication protected item. + * + * @summary Operation to initiate a planned failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_PlannedFailover.json + */ +async function executePlannedFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const failoverInput: PlannedFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginPlannedFailoverAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput + ); + console.log(result); +} + +executePlannedFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsPurgeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsPurgeSample.ts new file mode 100644 index 000000000000..b963b1a23831 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsPurgeSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item. + * + * @summary The operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Purge.json + */ +async function purgesProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "c0c14913-3d7a-48ea-9531-cc99e0e686e6"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +purgesProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsRemoveDisksSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsRemoveDisksSample.ts new file mode 100644 index 000000000000..28765a34047f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsRemoveDisksSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RemoveDisksInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to remove disk(s) from the replication protected item. + * + * @summary Operation to remove disk(s) from the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RemoveDisks.json + */ +async function removesDiskS() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const removeDisksInput: RemoveDisksInput = { + properties: { + providerSpecificDetails: { + instanceType: "A2A", + vmDisksUris: [ + "https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd" + ] + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginRemoveDisksAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput + ); + console.log(result); +} + +removesDiskS().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsRepairReplicationSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsRepairReplicationSample.ts new file mode 100644 index 000000000000..2debac87abed --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsRepairReplicationSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start resynchronize/repair replication for a replication protected item requiring resynchronization. + * + * @summary The operation to start resynchronize/repair replication for a replication protected item requiring resynchronization. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RepairReplication.json + */ +async function resynchronizeOrRepairReplication() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginRepairReplicationAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +resynchronizeOrRepairReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsReprotectSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsReprotectSample.ts new file mode 100644 index 000000000000..5df00162b2ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsReprotectSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ReverseReplicationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @summary Operation to reprotect or reverse replicate a failed over replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Reprotect.json + */ +async function executeReverseReplicationReprotect() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const reprotectInput: ReverseReplicationInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginReprotectAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput + ); + console.log(result); +} + +executeReverseReplicationReprotect().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsResolveHealthErrorsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsResolveHealthErrorsSample.ts new file mode 100644 index 000000000000..463bf3a6b5f4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsResolveHealthErrorsSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResolveHealthInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to resolve health issues of the replication protected item. + * + * @summary Operation to resolve health issues of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json + */ +async function resolveHealthErrors() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const resolveHealthInput: ResolveHealthInput = { + properties: { healthErrors: [{ healthErrorId: "3:8020" }] } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginResolveHealthErrorsAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput + ); + console.log(result); +} + +resolveHealthErrors().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsSwitchProviderSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsSwitchProviderSample.ts new file mode 100644 index 000000000000..c65896aa07b1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsSwitchProviderSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SwitchProviderInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to initiate a switch provider of the replication protected item. + * + * @summary Operation to initiate a switch provider of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_SwitchProvider.json + */ +async function executeSwitchProvider() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const switchProviderInput: SwitchProviderInput = { + properties: { + providerSpecificDetails: { + instanceType: "InMageAzureV2", + targetApplianceID: "5efaa202-e958-435e-8171-706bf735fcc4", + targetFabricID: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2", + targetVaultID: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault2" + }, + targetInstanceType: "InMageRcm" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginSwitchProviderAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput + ); + console.log(result); +} + +executeSwitchProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsTestFailoverCleanupSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsTestFailoverCleanupSample.ts new file mode 100644 index 000000000000..4892d194b248 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsTestFailoverCleanupSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TestFailoverCleanupInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to clean up the test failover of a replication protected item. + * + * @summary Operation to clean up the test failover of a replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json + */ +async function executeTestFailoverCleanup() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const cleanupInput: TestFailoverCleanupInput = { + properties: { comments: "Test Failover Cleanup" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginTestFailoverCleanupAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput + ); + console.log(result); +} + +executeTestFailoverCleanup().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsTestFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsTestFailoverSample.ts new file mode 100644 index 000000000000..0cb09409ac0b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsTestFailoverSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TestFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to perform a test failover of the replication protected item. + * + * @summary Operation to perform a test failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailover.json + */ +async function executeTestFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const testfailoverInput: TestFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + networkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + networkType: "VmNetworkAsInput", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginTestFailoverAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput + ); + console.log(result); +} + +executeTestFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUnplannedFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUnplannedFailoverSample.ts new file mode 100644 index 000000000000..3e882488c763 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUnplannedFailoverSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UnplannedFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to initiate a failover of the replication protected item. + * + * @summary Operation to initiate a failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UnplannedFailover.json + */ +async function executeUnplannedFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const failoverInput: UnplannedFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + sourceSiteOperations: "NotRequired" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUnplannedFailoverAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput + ); + console.log(result); +} + +executeUnplannedFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUpdateApplianceSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUpdateApplianceSample.ts new file mode 100644 index 000000000000..801ed6ac32a5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUpdateApplianceSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateApplianceForReplicationProtectedItemInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update appliance of an ASR replication protected item. + * + * @summary The operation to update appliance of an ASR replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateAppliance.json + */ +async function updatesApplianceForReplicationProtectedItem() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "Ayan-0106-SA-Vault"; + const resourceGroupName = "Ayan-0106-SA-RG"; + const fabricName = "Ayan-0106-SA-Vaultreplicationfabric"; + const protectionContainerName = "Ayan-0106-SA-Vaultreplicationcontainer"; + const replicatedProtectedItemName = + "idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f"; + const applianceUpdateInput: UpdateApplianceForReplicationProtectedItemInput = { + properties: { + providerSpecificDetails: { + instanceType: "InMageRcm", + runAsAccountId: "" + }, + targetApplianceId: "" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUpdateApplianceAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput + ); + console.log(result); +} + +updatesApplianceForReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUpdateMobilityServiceSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUpdateMobilityServiceSample.ts new file mode 100644 index 000000000000..9aa69d242810 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUpdateMobilityServiceSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateMobilityServiceRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update(push update) the installed mobility service software on a replication protected item to the latest available version. + * + * @summary The operation to update(push update) the installed mobility service software on a replication protected item to the latest available version. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateMobilityService.json + */ +async function updateTheMobilityServiceOnAProtectedItem() { + const subscriptionId = "b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c"; + const resourceName = "WCUSVault"; + const resourceGroupName = "wcusValidations"; + const fabricName = "WIN-JKKJ31QI8U2"; + const protectionContainerName = "cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0"; + const replicatedProtectedItemName = "79dd20ab-2b40-11e7-9791-0050568f387e"; + const updateMobilityServiceRequest: UpdateMobilityServiceRequest = { + properties: { runAsAccountId: "2" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUpdateMobilityServiceAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest + ); + console.log(result); +} + +updateTheMobilityServiceOnAProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUpdateSample.ts new file mode 100644 index 000000000000..a9f99936eb38 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectedItemsUpdateSample.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateReplicationProtectedItemInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the recovery settings of an ASR replication protected item. + * + * @summary The operation to update the recovery settings of an ASR replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Update.json + */ +async function updatesTheReplicationProtectedItemSettings() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const updateProtectionInput: UpdateReplicationProtectedItemInput = { + properties: { + licenseType: "WindowsServer", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + recoveryAzureVMName: "vm1", + recoveryAzureVMSize: "Basic_A0", + selectedRecoveryAzureNetworkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + vmNics: [ + { + ipConfigs: [ + { + ipConfigName: "ipconfig1", + isPrimary: true, + recoveryStaticIPAddress: "10.0.2.46", + recoverySubnetName: "subnet1" + } + ], + nicId: + "TWljcm9zb2Z0OkY4NDkxRTRGLTgxN0EtNDBERC1BOTBDLUFGNzczOTc4Qzc1Qlw3NjAwMzMxRS03NDk4LTQ0QTQtQjdDNy0xQjY1NkJDREQ1MkQ=", + selectionType: "SelectedByUser" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput + ); + console.log(result); +} + +updatesTheReplicationProtectedItemSettings().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsCreateSample.ts new file mode 100644 index 000000000000..6b7171db997e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsCreateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateProtectionContainerMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a protection container mapping. + * + * @summary The operation to create a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Create.json + */ +async function createProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const creationInput: CreateProtectionContainerMappingInput = { + properties: { + policyId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1", + providerSpecificInput: { + instanceType: "VMwareCbt" + }, + targetProtectionContainerId: "Microsoft Azure" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + creationInput + ); + console.log(result); +} + +createProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsDeleteSample.ts new file mode 100644 index 000000000000..571a15d453d0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsDeleteSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RemoveProtectionContainerMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete or remove a protection container mapping. + * + * @summary The operation to delete or remove a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Delete.json + */ +async function removeProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const removalInput: RemoveProtectionContainerMappingInput = { + properties: { providerSpecificInput: {} } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + removalInput + ); + console.log(result); +} + +removeProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsGetSample.ts new file mode 100644 index 000000000000..13733d635471 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a protection container mapping. + * + * @summary Gets the details of a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Get.json + */ +async function getsAProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName + ); + console.log(result); +} + +getsAProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.ts new file mode 100644 index 000000000000..fe46b6bd612f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protection container mappings for a protection container. + * + * @summary Lists the protection container mappings for a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfProtectionContainerMappingsForAProtectionContainer() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainerMappings.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfProtectionContainerMappingsForAProtectionContainer().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsListSample.ts new file mode 100644 index 000000000000..2e7b55518924 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protection container mappings in the vault. + * + * @summary Lists the protection container mappings in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_List.json + */ +async function getsTheListOfAllProtectionContainerMappingsInAVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainerMappings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAllProtectionContainerMappingsInAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsPurgeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsPurgeSample.ts new file mode 100644 index 000000000000..e0c4ac087163 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsPurgeSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to purge(force delete) a protection container mapping. + * + * @summary The operation to purge(force delete) a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Purge.json + */ +async function purgeProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName + ); + console.log(result); +} + +purgeProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsUpdateSample.ts new file mode 100644 index 000000000000..ebd70d27534e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainerMappingsUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateProtectionContainerMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update protection container mapping. + * + * @summary The operation to update protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Update.json + */ +async function updateProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const updateInput: UpdateProtectionContainerMappingInput = { + properties: { + providerSpecificInput: { + agentAutoUpdateStatus: "Enabled", + automationAccountArmId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1", + instanceType: "A2A" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + updateInput + ); + console.log(result); +} + +updateProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersCreateSample.ts new file mode 100644 index 000000000000..3d3c6f07d493 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersCreateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateProtectionContainerInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to create a protection container. + * + * @summary Operation to create a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Create.json + */ +async function createAProtectionContainer() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const creationInput: CreateProtectionContainerInput = { + properties: { + providerSpecificInput: [ + { instanceType: "A2ACrossClusterMigration" } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + creationInput + ); + console.log(result); +} + +createAProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersDeleteSample.ts new file mode 100644 index 000000000000..7676ec58b512 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to remove a protection container. + * + * @summary Operation to remove a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Delete.json + */ +async function removesAProtectionContainer() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + ); + console.log(result); +} + +removesAProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersDiscoverProtectableItemSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersDiscoverProtectableItemSample.ts new file mode 100644 index 000000000000..78ec5317b779 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersDiscoverProtectableItemSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiscoverProtectableItemRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to a add a protectable item to a protection container(Add physical server). + * + * @summary The operation to a add a protectable item to a protection container(Add physical server). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json + */ +async function addsAProtectableItemToTheReplicationProtectionContainer() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "V2A-W2K12-660"; + const protectionContainerName = "cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c"; + const discoverProtectableItemRequest: DiscoverProtectableItemRequest = { + properties: { + friendlyName: "Test", + ipAddress: "10.150.2.3", + osType: "Windows" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginDiscoverProtectableItemAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest + ); + console.log(result); +} + +addsAProtectableItemToTheReplicationProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersGetSample.ts new file mode 100644 index 000000000000..3a88f9da4827 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a protection container. + * + * @summary Gets the details of a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Get.json + */ +async function getsTheProtectionContainerDetails() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + ); + console.log(result); +} + +getsTheProtectionContainerDetails().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..356a6bb228eb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersListByReplicationFabricsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protection containers in the specified fabric. + * + * @summary Lists the protection containers in the specified fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json + */ +async function getsTheListOfProtectionContainerForAFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainers.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfProtectionContainerForAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersListSample.ts new file mode 100644 index 000000000000..56feb7d34ef9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protection containers in a vault. + * + * @summary Lists the protection containers in a vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_List.json + */ +async function getsTheListOfAllProtectionContainersInAVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainers.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAllProtectionContainersInAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersSwitchProtectionSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersSwitchProtectionSample.ts new file mode 100644 index 000000000000..ef92b9a64592 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionContainersSwitchProtectionSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SwitchProtectionInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to switch protection from one container to another or one replication provider to another. + * + * @summary Operation to switch protection from one container to another or one replication provider to another. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_SwitchProtection.json + */ +async function switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother() { + const subscriptionId = "42195872-7e70-4f8a-837f-84b28ecbb78b"; + const resourceName = "priyanponeboxvault"; + const resourceGroupName = "priyanprg"; + const fabricName = "CentralUSCanSite"; + const protectionContainerName = "CentralUSCancloud"; + const switchInput: SwitchProtectionInput = { + properties: { providerSpecificDetails: { instanceType: "A2A" } } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginSwitchProtectionAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + switchInput + ); + console.log(result); +} + +switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionIntentsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionIntentsCreateSample.ts new file mode 100644 index 000000000000..12dbd2e2c4c6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionIntentsCreateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateProtectionIntentInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an ASR replication protection intent item. + * + * @summary The operation to create an ASR replication protection intent item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Create.json + */ +async function createProtectionIntentResource() { + const subscriptionId = "509099b2-9d2c-4636-b43e-bd5cafb6be69"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const intentObjectName = "vm1"; + const input: CreateProtectionIntentInput = { + properties: { + providerSpecificDetails: { + fabricObjectId: + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne/providers/Microsoft.Compute/virtualMachines/vmPpgAv5", + instanceType: "A2A", + primaryLocation: "eastUs2", + recoveryAvailabilityType: "Single", + recoveryLocation: "westus2", + recoveryResourceGroupId: + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne-asr", + recoverySubscriptionId: "ed5bcdf6-d61e-47bd-8ea9-f2bd379a2640" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionIntents.create( + resourceName, + resourceGroupName, + intentObjectName, + input + ); + console.log(result); +} + +createProtectionIntentResource().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionIntentsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionIntentsGetSample.ts new file mode 100644 index 000000000000..d45adf14c748 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionIntentsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of an ASR replication protection intent. + * + * @summary Gets the details of an ASR replication protection intent. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Get.json + */ +async function getsTheDetailsOfAReplicationProtectionIntentItem() { + const subscriptionId = "509099b2-9d2c-4636-b43e-bd5cafb6be69"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const intentObjectName = "vm1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionIntents.get( + resourceName, + resourceGroupName, + intentObjectName + ); + console.log(result); +} + +getsTheDetailsOfAReplicationProtectionIntentItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionIntentsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionIntentsListSample.ts new file mode 100644 index 000000000000..a2bb8f02e922 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationProtectionIntentsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of ASR replication protection intent objects in the vault. + * + * @summary Gets the list of ASR replication protection intent objects in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_List.json + */ +async function getsTheListOfReplicationProtectionIntentObjects() { + const subscriptionId = "509099b2-9d2c-4636-b43e-bd5cafb6be69"; + const resourceName = "2007vttp"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionIntents.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationProtectionIntentObjects().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansCreateSample.ts new file mode 100644 index 000000000000..530c91adf861 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansCreateSample.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateRecoveryPlanInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a recovery plan. + * + * @summary The operation to create a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Create.json + */ +async function createsARecoveryPlanWithTheGivenDetails() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: CreateRecoveryPlanInput = { + properties: { + failoverDeploymentModel: "ResourceManager", + groups: [ + { + endGroupActions: [], + groupType: "Boot", + replicationProtectedItems: [ + { + id: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b", + virtualMachineId: "f8491e4f-817a-40dd-a90c-af773978c75b" + } + ], + startGroupActions: [] + } + ], + primaryFabricId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1", + recoveryFabricId: "Microsoft Azure" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginCreateAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +createsARecoveryPlanWithTheGivenDetails().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansDeleteSample.ts new file mode 100644 index 000000000000..3ea2252dcf78 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a recovery plan. + * + * @summary Delete a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Delete.json + */ +async function deletesTheSpecifiedRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginDeleteAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +deletesTheSpecifiedRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansFailoverCancelSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansFailoverCancelSample.ts new file mode 100644 index 000000000000..6c7478f7f6c4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansFailoverCancelSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to cancel the failover of a recovery plan. + * + * @summary The operation to cancel the failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCancel.json + */ +async function executeCancelFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginFailoverCancelAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +executeCancelFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansFailoverCommitSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansFailoverCommitSample.ts new file mode 100644 index 000000000000..b2a68ff96610 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansFailoverCommitSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to commit the failover of a recovery plan. + * + * @summary The operation to commit the failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCommit.json + */ +async function executeCommitFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginFailoverCommitAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +executeCommitFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansGetSample.ts new file mode 100644 index 000000000000..e8667d8395ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of the recovery plan. + * + * @summary Gets the details of the recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Get.json + */ +async function getsTheRequestedRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.get( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +getsTheRequestedRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansListSample.ts new file mode 100644 index 000000000000..96720aa2b0f0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the recovery plans in the vault. + * + * @summary Lists the recovery plans in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_List.json + */ +async function getsTheListOfRecoveryPlans() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationRecoveryPlans.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRecoveryPlans().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansPlannedFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansPlannedFailoverSample.ts new file mode 100644 index 000000000000..32dcf3a219dd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansPlannedFailoverSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RecoveryPlanPlannedFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start the planned failover of a recovery plan. + * + * @summary The operation to start the planned failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_PlannedFailover.json + */ +async function executePlannedFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: RecoveryPlanPlannedFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: [{ instanceType: "HyperVReplicaAzure" }] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginPlannedFailoverAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executePlannedFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansReprotectSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansReprotectSample.ts new file mode 100644 index 000000000000..a10db922a8ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansReprotectSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to reprotect(reverse replicate) a recovery plan. + * + * @summary The operation to reprotect(reverse replicate) a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Reprotect.json + */ +async function executeReprotectOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginReprotectAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +executeReprotectOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansTestFailoverCleanupSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansTestFailoverCleanupSample.ts new file mode 100644 index 000000000000..5d0bf6ac9c34 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansTestFailoverCleanupSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RecoveryPlanTestFailoverCleanupInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to cleanup test failover of a recovery plan. + * + * @summary The operation to cleanup test failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json + */ +async function executeTestFailoverCleanupOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: RecoveryPlanTestFailoverCleanupInput = { + properties: { comments: "Test Failover Cleanup" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginTestFailoverCleanupAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executeTestFailoverCleanupOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansTestFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansTestFailoverSample.ts new file mode 100644 index 000000000000..f4f4e1ce9f47 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansTestFailoverSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RecoveryPlanTestFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start the test failover of a recovery plan. + * + * @summary The operation to start the test failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailover.json + */ +async function executeTestFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: RecoveryPlanTestFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + networkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + networkType: "VmNetworkAsInput", + providerSpecificDetails: [{ instanceType: "HyperVReplicaAzure" }] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginTestFailoverAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executeTestFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansUnplannedFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansUnplannedFailoverSample.ts new file mode 100644 index 000000000000..ea3aa4e828e9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansUnplannedFailoverSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RecoveryPlanUnplannedFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start the unplanned failover of a recovery plan. + * + * @summary The operation to start the unplanned failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json + */ +async function executeUnplannedFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: RecoveryPlanUnplannedFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: [{ instanceType: "HyperVReplicaAzure" }], + sourceSiteOperations: "Required" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginUnplannedFailoverAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executeUnplannedFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansUpdateSample.ts new file mode 100644 index 000000000000..19863855430b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryPlansUpdateSample.ts @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateRecoveryPlanInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a recovery plan. + * + * @summary The operation to update a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Update.json + */ +async function updatesTheGivenRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: UpdateRecoveryPlanInput = { + properties: { + groups: [ + { + endGroupActions: [], + groupType: "Shutdown", + replicationProtectedItems: [], + startGroupActions: [] + }, + { + endGroupActions: [], + groupType: "Failover", + replicationProtectedItems: [], + startGroupActions: [] + }, + { + endGroupActions: [], + groupType: "Boot", + replicationProtectedItems: [ + { + id: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b", + virtualMachineId: "f8491e4f-817a-40dd-a90c-af773978c75b" + } + ], + startGroupActions: [] + }, + { + endGroupActions: [], + groupType: "Boot", + replicationProtectedItems: [ + { + id: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6", + virtualMachineId: "c0c14913-3d7a-48ea-9531-cc99e0e686e6" + } + ], + startGroupActions: [] + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginUpdateAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +updatesTheGivenRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersCreateSample.ts new file mode 100644 index 000000000000..dd7b3ff744b8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersCreateSample.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AddRecoveryServicesProviderInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to add a recovery services provider. + * + * @summary The operation to add a recovery services provider. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Create.json + */ +async function addsARecoveryServicesProvider() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const providerName = "vmwareprovider1"; + const addProviderInput: AddRecoveryServicesProviderInput = { + properties: { + authenticationIdentityInput: { + aadAuthority: "https://login.microsoftonline.com", + applicationId: "f66fce08-c0c6-47a1-beeb-0ede5ea94f90", + audience: + "https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874", + objectId: "141360b8-5686-4240-a027-5e24e6affeba", + tenantId: "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + machineName: "vmwareprovider1", + resourceAccessIdentityInput: { + aadAuthority: "https://login.microsoftonline.com", + applicationId: "f66fce08-c0c6-47a1-beeb-0ede5ea94f90", + audience: + "https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874", + objectId: "141360b8-5686-4240-a027-5e24e6affeba", + tenantId: "72f988bf-86f1-41af-91ab-2d7cd011db47" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName, + addProviderInput + ); + console.log(result); +} + +addsARecoveryServicesProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersDeleteSample.ts new file mode 100644 index 000000000000..f3d9c70877c6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @summary The operation to removes/delete(unregister) a recovery services provider from the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Delete.json + */ +async function deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersGetSample.ts new file mode 100644 index 000000000000..780494796678 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of registered recovery services provider. + * + * @summary Gets the details of registered recovery services provider. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Get.json + */ +async function getsTheDetailsOfARecoveryServicesProvider() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.get( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +getsTheDetailsOfARecoveryServicesProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..b331187b5cb1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersListByReplicationFabricsSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the registered recovery services providers for the specified fabric. + * + * @summary Lists the registered recovery services providers for the specified fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json + */ +async function getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationRecoveryServicesProviders.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersListSample.ts new file mode 100644 index 000000000000..64745f53a0de --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the registered recovery services providers in the vault. + * + * @summary Lists the registered recovery services providers in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_List.json + */ +async function getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationRecoveryServicesProviders.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersPurgeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersPurgeSample.ts new file mode 100644 index 000000000000..0606e4d4f24b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersPurgeSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to purge(force delete) a recovery services provider from the vault. + * + * @summary The operation to purge(force delete) a recovery services provider from the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Purge.json + */ +async function purgesRecoveryServiceProviderFromFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +purgesRecoveryServiceProviderFromFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersRefreshProviderSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersRefreshProviderSample.ts new file mode 100644 index 000000000000..f836ca3267c2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationRecoveryServicesProvidersRefreshProviderSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to refresh the information from the recovery services provider. + * + * @summary The operation to refresh the information from the recovery services provider. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json + */ +async function refreshDetailsFromTheRecoveryServicesProvider() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginRefreshProviderAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +refreshDetailsFromTheRecoveryServicesProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsCreateSample.ts new file mode 100644 index 000000000000..f317663dfbce --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsCreateSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageClassificationMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a storage classification mapping. + * + * @summary The operation to create a storage classification mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Create.json + */ +async function createStorageClassificationMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const storageClassificationMappingName = "testStorageMapping"; + const pairingInput: StorageClassificationMappingInput = { + properties: { + targetStorageClassificationId: + "/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassificationMappings.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput + ); + console.log(result); +} + +createStorageClassificationMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsDeleteSample.ts new file mode 100644 index 000000000000..a54d64c53e8d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a storage classification mapping. + * + * @summary The operation to delete a storage classification mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Delete.json + */ +async function deleteAStorageClassificationMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const storageClassificationMappingName = "testStorageMapping"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassificationMappings.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName + ); + console.log(result); +} + +deleteAStorageClassificationMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsGetSample.ts new file mode 100644 index 000000000000..4da6522debe8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsGetSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of the specified storage classification mapping. + * + * @summary Gets the details of the specified storage classification mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Get.json + */ +async function getsTheDetailsOfAStorageClassificationMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const storageClassificationMappingName = "testStorageMapping"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassificationMappings.get( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName + ); + console.log(result); +} + +getsTheDetailsOfAStorageClassificationMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.ts new file mode 100644 index 000000000000..bc865654bd80 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the storage classification mappings for the fabric. + * + * @summary Lists the storage classification mappings for the fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json + */ +async function getsTheListOfStorageClassificationMappingsObjectsUnderAStorage() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassificationMappings.listByReplicationStorageClassifications( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationMappingsObjectsUnderAStorage().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsListSample.ts new file mode 100644 index 000000000000..1da1ac312b81 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationMappingsListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the storage classification mappings in the vault. + * + * @summary Lists the storage classification mappings in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_List.json + */ +async function getsTheListOfStorageClassificationMappingsObjectsUnderAVault() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassificationMappings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationMappingsObjectsUnderAVault().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationsGetSample.ts new file mode 100644 index 000000000000..8fe2b3ab59d0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationsGetSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of the specified storage classification. + * + * @summary Gets the details of the specified storage classification. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_Get.json + */ +async function getsTheDetailsOfAStorageClassification() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassifications.get( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName + ); + console.log(result); +} + +getsTheDetailsOfAStorageClassification().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationsListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationsListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..05dd52546a59 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationsListByReplicationFabricsSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the storage classifications available in the specified fabric. + * + * @summary Lists the storage classifications available in the specified fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json + */ +async function getsTheListOfStorageClassificationObjectsUnderAFabric() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassifications.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationObjectsUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationsListSample.ts new file mode 100644 index 000000000000..dce2d91e42b5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationStorageClassificationsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the storage classifications in the vault. + * + * @summary Lists the storage classifications in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_List.json + */ +async function getsTheListOfStorageClassificationObjectsUnderAVault() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassifications.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationObjectsUnderAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultHealthGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultHealthGetSample.ts new file mode 100644 index 000000000000..835e6cfb7e4a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultHealthGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the health details of the vault. + * + * @summary Gets the health details of the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Get.json + */ +async function getsTheHealthSummaryForTheVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultHealth.get( + resourceName, + resourceGroupName + ); + console.log(result); +} + +getsTheHealthSummaryForTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultHealthRefreshSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultHealthRefreshSample.ts new file mode 100644 index 000000000000..60083d6ba4f3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultHealthRefreshSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Refreshes health summary of the vault. + * + * @summary Refreshes health summary of the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Refresh.json + */ +async function refreshesHealthSummaryOfTheVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultHealth.beginRefreshAndWait( + resourceName, + resourceGroupName + ); + console.log(result); +} + +refreshesHealthSummaryOfTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultSettingCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultSettingCreateSample.ts new file mode 100644 index 000000000000..d199b101bfe8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultSettingCreateSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VaultSettingCreationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to configure vault setting. + * + * @summary The operation to configure vault setting. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Create.json + */ +async function updatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const vaultSettingName = "default"; + const input: VaultSettingCreationInput = { + properties: { + migrationSolutionId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.Migrate/MigrateProjects/resourceGroupPS1-MigrateProject/Solutions/Servers-Migration-ServerMigration" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultSetting.beginCreateAndWait( + resourceName, + resourceGroupName, + vaultSettingName, + input + ); + console.log(result); +} + +updatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultSettingGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultSettingGetSample.ts new file mode 100644 index 000000000000..12395932e52b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultSettingGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the vault setting. This includes the Migration Hub connection settings. + * + * @summary Gets the vault setting. This includes the Migration Hub connection settings. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Get.json + */ +async function getsTheVaultSetting() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const vaultSettingName = "default"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultSetting.get( + resourceName, + resourceGroupName, + vaultSettingName + ); + console.log(result); +} + +getsTheVaultSetting().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultSettingListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultSettingListSample.ts new file mode 100644 index 000000000000..c5e3b61c5804 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationVaultSettingListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @summary Gets the list of vault setting. This includes the Migration Hub connection settings. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_List.json + */ +async function getsTheListOfVaultSetting() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationVaultSetting.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfVaultSetting().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersCreateSample.ts new file mode 100644 index 000000000000..e113bbee9bfc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersCreateSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AddVCenterRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a vCenter object.. + * + * @summary The operation to create a vCenter object.. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Create.json + */ +async function addVCenter() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const addVCenterRequest: AddVCenterRequest = { + properties: { + friendlyName: "esx-78", + ipAddress: "inmtest78", + port: "443", + processServerId: "5A720CAB-39CB-F445-BD1662B0B33164B5", + runAsAccountId: "2" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + vcenterName, + addVCenterRequest + ); + console.log(result); +} + +addVCenter().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersDeleteSample.ts new file mode 100644 index 000000000000..63e685b42572 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to remove(unregister) a registered vCenter server from the vault. + * + * @summary The operation to remove(unregister) a registered vCenter server from the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Delete.json + */ +async function removeVCenterOperation() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + vcenterName + ); + console.log(result); +} + +removeVCenterOperation().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersGetSample.ts new file mode 100644 index 000000000000..aaa72abdda45 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a registered vCenter server(Add vCenter server). + * + * @summary Gets the details of a registered vCenter server(Add vCenter server). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Get.json + */ +async function getsTheDetailsOfAVCenter() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.get( + resourceName, + resourceGroupName, + fabricName, + vcenterName + ); + console.log(result); +} + +getsTheDetailsOfAVCenter().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..357dd26cb176 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersListByReplicationFabricsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the vCenter servers registered in a fabric. + * + * @summary Lists the vCenter servers registered in a fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_ListByReplicationFabrics.json + */ +async function getsTheListOfVCenterRegisteredUnderAFabric() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationvCenters.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfVCenterRegisteredUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersListSample.ts new file mode 100644 index 000000000000..cddacb0618e8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the vCenter servers registered in the vault. + * + * @summary Lists the vCenter servers registered in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_List.json + */ +async function getsTheListOfVCenterRegisteredUnderTheVault() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationvCenters.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfVCenterRegisteredUnderTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersUpdateSample.ts new file mode 100644 index 000000000000..4133ba16f856 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/replicationvCentersUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateVCenterRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a registered vCenter. + * + * @summary The operation to update a registered vCenter. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Update.json + */ +async function updateVCenterOperation() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const updateVCenterRequest: UpdateVCenterRequest = { + properties: { ipAddress: "10.150.109.25" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + vcenterName, + updateVCenterRequest + ); + console.log(result); +} + +updateVCenterOperation().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/supportedOperatingSystemsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/supportedOperatingSystemsGetSample.ts new file mode 100644 index 000000000000..6b012968ea42 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/supportedOperatingSystemsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the data of supported operating systems by SRS. + * + * @summary Gets the data of supported operating systems by SRS. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/SupportedOperatingSystems_Get.json + */ +async function getsTheDataOfSupportedOperatingSystemsBySrs() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.supportedOperatingSystemsOperations.get( + resourceName, + resourceGroupName + ); + console.log(result); +} + +getsTheDataOfSupportedOperatingSystemsBySrs().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/targetComputeSizesListByReplicationProtectedItemsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/targetComputeSizesListByReplicationProtectedItemsSample.ts new file mode 100644 index 000000000000..23bd00ac86f9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples-dev/targetComputeSizesListByReplicationProtectedItemsSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the available target compute sizes for a replication protected item. + * + * @summary Lists the available target compute sizes for a replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json + */ +async function getsTheListOfTargetComputeSizesForTheReplicationProtectedItem() { + const subscriptionId = "6808dbbc-98c7-431f-a1b1-9580902423b7"; + const resourceName = "avraiMgDiskVault"; + const resourceGroupName = "avraiMgDiskVaultRG"; + const fabricName = "asr-a2a-default-centraluseuap"; + const protectionContainerName = "asr-a2a-default-centraluseuap-container"; + const replicatedProtectedItemName = "468c912d-b1ab-4ea2-97eb-4b5095155db2"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.targetComputeSizes.listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfTargetComputeSizesForTheReplicationProtectedItem().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/README.md b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/README.md new file mode 100644 index 000000000000..32405fc5028a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/README.md @@ -0,0 +1,322 @@ +# client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [migrationRecoveryPointsGetSample.js][migrationrecoverypointsgetsample] | Gets a recovery point for a migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_Get.json | +| [migrationRecoveryPointsListByReplicationMigrationItemsSample.js][migrationrecoverypointslistbyreplicationmigrationitemssample] | Gets the recovery points for a migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json | +| [operationsListSample.js][operationslistsample] | Operation to return the list of available operations. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/Operations_List.json | +| [recoveryPointsGetSample.js][recoverypointsgetsample] | Get the details of specified recovery point. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_Get.json | +| [recoveryPointsListByReplicationProtectedItemsSample.js][recoverypointslistbyreplicationprotecteditemssample] | Lists the available recovery points for a replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json | +| [replicationAlertSettingsCreateSample.js][replicationalertsettingscreatesample] | Create or update an email notification(alert) configuration. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Create.json | +| [replicationAlertSettingsGetSample.js][replicationalertsettingsgetsample] | Gets the details of the specified email notification(alert) configuration. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Get.json | +| [replicationAlertSettingsListSample.js][replicationalertsettingslistsample] | Gets the list of email notification(alert) configurations for the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_List.json | +| [replicationAppliancesListSample.js][replicationapplianceslistsample] | Gets the list of Azure Site Recovery appliances for the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAppliances_List.json | +| [replicationEligibilityResultsGetSample.js][replicationeligibilityresultsgetsample] | Validates whether a given VM can be protected or not in which case returns list of errors. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_Get.json | +| [replicationEligibilityResultsListSample.js][replicationeligibilityresultslistsample] | Validates whether a given VM can be protected or not in which case returns list of errors. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_List.json | +| [replicationEventsGetSample.js][replicationeventsgetsample] | The operation to get the details of an Azure Site recovery event. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_Get.json | +| [replicationEventsListSample.js][replicationeventslistsample] | Gets the list of Azure Site Recovery events for the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_List.json | +| [replicationFabricsCheckConsistencySample.js][replicationfabricscheckconsistencysample] | The operation to perform a consistency check on the fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_CheckConsistency.json | +| [replicationFabricsCreateSample.js][replicationfabricscreatesample] | The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Create.json | +| [replicationFabricsDeleteSample.js][replicationfabricsdeletesample] | The operation to delete or remove an Azure Site Recovery fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Delete.json | +| [replicationFabricsGetSample.js][replicationfabricsgetsample] | Gets the details of an Azure Site Recovery fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Get.json | +| [replicationFabricsListSample.js][replicationfabricslistsample] | Gets a list of the Azure Site Recovery fabrics in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_List.json | +| [replicationFabricsMigrateToAadSample.js][replicationfabricsmigratetoaadsample] | The operation to migrate an Azure Site Recovery fabric to AAD. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_MigrateToAad.json | +| [replicationFabricsPurgeSample.js][replicationfabricspurgesample] | The operation to purge(force delete) an Azure Site Recovery fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Purge.json | +| [replicationFabricsReassociateGatewaySample.js][replicationfabricsreassociategatewaysample] | The operation to move replications from a process server to another process server. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_ReassociateGateway.json | +| [replicationFabricsRenewCertificateSample.js][replicationfabricsrenewcertificatesample] | Renews the connection certificate for the ASR replication fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_RenewCertificate.json | +| [replicationJobsCancelSample.js][replicationjobscancelsample] | The operation to cancel an Azure Site Recovery job. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Cancel.json | +| [replicationJobsExportSample.js][replicationjobsexportsample] | The operation to export the details of the Azure Site Recovery jobs of the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Export.json | +| [replicationJobsGetSample.js][replicationjobsgetsample] | Get the details of an Azure Site Recovery job. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Get.json | +| [replicationJobsListSample.js][replicationjobslistsample] | Gets the list of Azure Site Recovery Jobs for the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_List.json | +| [replicationJobsRestartSample.js][replicationjobsrestartsample] | The operation to restart an Azure Site Recovery job. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Restart.json | +| [replicationJobsResumeSample.js][replicationjobsresumesample] | The operation to resume an Azure Site Recovery job. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Resume.json | +| [replicationLogicalNetworksGetSample.js][replicationlogicalnetworksgetsample] | Gets the details of a logical network. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_Get.json | +| [replicationLogicalNetworksListByReplicationFabricsSample.js][replicationlogicalnetworkslistbyreplicationfabricssample] | Lists all the logical networks of the Azure Site Recovery fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json | +| [replicationMigrationItemsCreateSample.js][replicationmigrationitemscreatesample] | The operation to create an ASR migration item (enable migration). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Create.json | +| [replicationMigrationItemsDeleteSample.js][replicationmigrationitemsdeletesample] | The operation to delete an ASR migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Delete.json | +| [replicationMigrationItemsGetSample.js][replicationmigrationitemsgetsample] | Gets the details of a migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Get.json | +| [replicationMigrationItemsListByReplicationProtectionContainersSample.js][replicationmigrationitemslistbyreplicationprotectioncontainerssample] | Gets the list of ASR migration items in the protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json | +| [replicationMigrationItemsListSample.js][replicationmigrationitemslistsample] | Gets the list of migration items in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_List.json | +| [replicationMigrationItemsMigrateSample.js][replicationmigrationitemsmigratesample] | The operation to initiate migration of the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Migrate.json | +| [replicationMigrationItemsPauseReplicationSample.js][replicationmigrationitemspausereplicationsample] | The operation to initiate pause replication of the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_PauseReplication.json | +| [replicationMigrationItemsResumeReplicationSample.js][replicationmigrationitemsresumereplicationsample] | The operation to initiate resume replication of the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ResumeReplication.json | +| [replicationMigrationItemsResyncSample.js][replicationmigrationitemsresyncsample] | The operation to resynchronize replication of an ASR migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Resync.json | +| [replicationMigrationItemsTestMigrateCleanupSample.js][replicationmigrationitemstestmigratecleanupsample] | The operation to initiate test migrate cleanup. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json | +| [replicationMigrationItemsTestMigrateSample.js][replicationmigrationitemstestmigratesample] | The operation to initiate test migration of the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrate.json | +| [replicationMigrationItemsUpdateSample.js][replicationmigrationitemsupdatesample] | The operation to update the recovery settings of an ASR migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Update.json | +| [replicationNetworkMappingsCreateSample.js][replicationnetworkmappingscreatesample] | The operation to create an ASR network mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Create.json | +| [replicationNetworkMappingsDeleteSample.js][replicationnetworkmappingsdeletesample] | The operation to delete a network mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Delete.json | +| [replicationNetworkMappingsGetSample.js][replicationnetworkmappingsgetsample] | Gets the details of an ASR network mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Get.json | +| [replicationNetworkMappingsListByReplicationNetworksSample.js][replicationnetworkmappingslistbyreplicationnetworkssample] | Lists all ASR network mappings for the specified network. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json | +| [replicationNetworkMappingsListSample.js][replicationnetworkmappingslistsample] | Lists all ASR network mappings in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_List.json | +| [replicationNetworkMappingsUpdateSample.js][replicationnetworkmappingsupdatesample] | The operation to update an ASR network mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Update.json | +| [replicationNetworksGetSample.js][replicationnetworksgetsample] | Gets the details of a network. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_Get.json | +| [replicationNetworksListByReplicationFabricsSample.js][replicationnetworkslistbyreplicationfabricssample] | Lists the networks available for a fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_ListByReplicationFabrics.json | +| [replicationNetworksListSample.js][replicationnetworkslistsample] | Lists the networks available in a vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_List.json | +| [replicationPoliciesCreateSample.js][replicationpoliciescreatesample] | The operation to create a replication policy. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Create.json | +| [replicationPoliciesDeleteSample.js][replicationpoliciesdeletesample] | The operation to delete a replication policy. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Delete.json | +| [replicationPoliciesGetSample.js][replicationpoliciesgetsample] | Gets the details of a replication policy. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Get.json | +| [replicationPoliciesListSample.js][replicationpolicieslistsample] | Lists the replication policies for a vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_List.json | +| [replicationPoliciesUpdateSample.js][replicationpoliciesupdatesample] | The operation to update a replication policy. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Update.json | +| [replicationProtectableItemsGetSample.js][replicationprotectableitemsgetsample] | The operation to get the details of a protectable item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_Get.json | +| [replicationProtectableItemsListByReplicationProtectionContainersSample.js][replicationprotectableitemslistbyreplicationprotectioncontainerssample] | Lists the protectable items in a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json | +| [replicationProtectedItemsAddDisksSample.js][replicationprotecteditemsadddiskssample] | Operation to add disks(s) to the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_AddDisks.json | +| [replicationProtectedItemsApplyRecoveryPointSample.js][replicationprotecteditemsapplyrecoverypointsample] | The operation to change the recovery point of a failed over replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json | +| [replicationProtectedItemsCreateSample.js][replicationprotecteditemscreatesample] | The operation to create an ASR replication protected item (Enable replication). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Create.json | +| [replicationProtectedItemsDeleteSample.js][replicationprotecteditemsdeletesample] | The operation to disable replication on a replication protected item. This will also remove the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Delete.json | +| [replicationProtectedItemsFailoverCancelSample.js][replicationprotecteditemsfailovercancelsample] | Operation to cancel the failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCancel.json | +| [replicationProtectedItemsFailoverCommitSample.js][replicationprotecteditemsfailovercommitsample] | Operation to commit the failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCommit.json | +| [replicationProtectedItemsGetSample.js][replicationprotecteditemsgetsample] | Gets the details of an ASR replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Get.json | +| [replicationProtectedItemsListByReplicationProtectionContainersSample.js][replicationprotecteditemslistbyreplicationprotectioncontainerssample] | Gets the list of ASR replication protected items in the protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json | +| [replicationProtectedItemsListSample.js][replicationprotecteditemslistsample] | Gets the list of ASR replication protected items in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_List.json | +| [replicationProtectedItemsPlannedFailoverSample.js][replicationprotecteditemsplannedfailoversample] | Operation to initiate a planned failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_PlannedFailover.json | +| [replicationProtectedItemsPurgeSample.js][replicationprotecteditemspurgesample] | The operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Purge.json | +| [replicationProtectedItemsRemoveDisksSample.js][replicationprotecteditemsremovediskssample] | Operation to remove disk(s) from the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RemoveDisks.json | +| [replicationProtectedItemsRepairReplicationSample.js][replicationprotecteditemsrepairreplicationsample] | The operation to start resynchronize/repair replication for a replication protected item requiring resynchronization. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RepairReplication.json | +| [replicationProtectedItemsReprotectSample.js][replicationprotecteditemsreprotectsample] | Operation to reprotect or reverse replicate a failed over replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Reprotect.json | +| [replicationProtectedItemsResolveHealthErrorsSample.js][replicationprotecteditemsresolvehealtherrorssample] | Operation to resolve health issues of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json | +| [replicationProtectedItemsSwitchProviderSample.js][replicationprotecteditemsswitchprovidersample] | Operation to initiate a switch provider of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_SwitchProvider.json | +| [replicationProtectedItemsTestFailoverCleanupSample.js][replicationprotecteditemstestfailovercleanupsample] | Operation to clean up the test failover of a replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json | +| [replicationProtectedItemsTestFailoverSample.js][replicationprotecteditemstestfailoversample] | Operation to perform a test failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailover.json | +| [replicationProtectedItemsUnplannedFailoverSample.js][replicationprotecteditemsunplannedfailoversample] | Operation to initiate a failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UnplannedFailover.json | +| [replicationProtectedItemsUpdateApplianceSample.js][replicationprotecteditemsupdateappliancesample] | The operation to update appliance of an ASR replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateAppliance.json | +| [replicationProtectedItemsUpdateMobilityServiceSample.js][replicationprotecteditemsupdatemobilityservicesample] | The operation to update(push update) the installed mobility service software on a replication protected item to the latest available version. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateMobilityService.json | +| [replicationProtectedItemsUpdateSample.js][replicationprotecteditemsupdatesample] | The operation to update the recovery settings of an ASR replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Update.json | +| [replicationProtectionContainerMappingsCreateSample.js][replicationprotectioncontainermappingscreatesample] | The operation to create a protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Create.json | +| [replicationProtectionContainerMappingsDeleteSample.js][replicationprotectioncontainermappingsdeletesample] | The operation to delete or remove a protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Delete.json | +| [replicationProtectionContainerMappingsGetSample.js][replicationprotectioncontainermappingsgetsample] | Gets the details of a protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Get.json | +| [replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.js][replicationprotectioncontainermappingslistbyreplicationprotectioncontainerssample] | Lists the protection container mappings for a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json | +| [replicationProtectionContainerMappingsListSample.js][replicationprotectioncontainermappingslistsample] | Lists the protection container mappings in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_List.json | +| [replicationProtectionContainerMappingsPurgeSample.js][replicationprotectioncontainermappingspurgesample] | The operation to purge(force delete) a protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Purge.json | +| [replicationProtectionContainerMappingsUpdateSample.js][replicationprotectioncontainermappingsupdatesample] | The operation to update protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Update.json | +| [replicationProtectionContainersCreateSample.js][replicationprotectioncontainerscreatesample] | Operation to create a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Create.json | +| [replicationProtectionContainersDeleteSample.js][replicationprotectioncontainersdeletesample] | Operation to remove a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Delete.json | +| [replicationProtectionContainersDiscoverProtectableItemSample.js][replicationprotectioncontainersdiscoverprotectableitemsample] | The operation to a add a protectable item to a protection container(Add physical server). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json | +| [replicationProtectionContainersGetSample.js][replicationprotectioncontainersgetsample] | Gets the details of a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Get.json | +| [replicationProtectionContainersListByReplicationFabricsSample.js][replicationprotectioncontainerslistbyreplicationfabricssample] | Lists the protection containers in the specified fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json | +| [replicationProtectionContainersListSample.js][replicationprotectioncontainerslistsample] | Lists the protection containers in a vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_List.json | +| [replicationProtectionContainersSwitchProtectionSample.js][replicationprotectioncontainersswitchprotectionsample] | Operation to switch protection from one container to another or one replication provider to another. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_SwitchProtection.json | +| [replicationProtectionIntentsCreateSample.js][replicationprotectionintentscreatesample] | The operation to create an ASR replication protection intent item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Create.json | +| [replicationProtectionIntentsGetSample.js][replicationprotectionintentsgetsample] | Gets the details of an ASR replication protection intent. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Get.json | +| [replicationProtectionIntentsListSample.js][replicationprotectionintentslistsample] | Gets the list of ASR replication protection intent objects in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_List.json | +| [replicationRecoveryPlansCreateSample.js][replicationrecoveryplanscreatesample] | The operation to create a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Create.json | +| [replicationRecoveryPlansDeleteSample.js][replicationrecoveryplansdeletesample] | Delete a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Delete.json | +| [replicationRecoveryPlansFailoverCancelSample.js][replicationrecoveryplansfailovercancelsample] | The operation to cancel the failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCancel.json | +| [replicationRecoveryPlansFailoverCommitSample.js][replicationrecoveryplansfailovercommitsample] | The operation to commit the failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCommit.json | +| [replicationRecoveryPlansGetSample.js][replicationrecoveryplansgetsample] | Gets the details of the recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Get.json | +| [replicationRecoveryPlansListSample.js][replicationrecoveryplanslistsample] | Lists the recovery plans in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_List.json | +| [replicationRecoveryPlansPlannedFailoverSample.js][replicationrecoveryplansplannedfailoversample] | The operation to start the planned failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_PlannedFailover.json | +| [replicationRecoveryPlansReprotectSample.js][replicationrecoveryplansreprotectsample] | The operation to reprotect(reverse replicate) a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Reprotect.json | +| [replicationRecoveryPlansTestFailoverCleanupSample.js][replicationrecoveryplanstestfailovercleanupsample] | The operation to cleanup test failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json | +| [replicationRecoveryPlansTestFailoverSample.js][replicationrecoveryplanstestfailoversample] | The operation to start the test failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailover.json | +| [replicationRecoveryPlansUnplannedFailoverSample.js][replicationrecoveryplansunplannedfailoversample] | The operation to start the unplanned failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json | +| [replicationRecoveryPlansUpdateSample.js][replicationrecoveryplansupdatesample] | The operation to update a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Update.json | +| [replicationRecoveryServicesProvidersCreateSample.js][replicationrecoveryservicesproviderscreatesample] | The operation to add a recovery services provider. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Create.json | +| [replicationRecoveryServicesProvidersDeleteSample.js][replicationrecoveryservicesprovidersdeletesample] | The operation to removes/delete(unregister) a recovery services provider from the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Delete.json | +| [replicationRecoveryServicesProvidersGetSample.js][replicationrecoveryservicesprovidersgetsample] | Gets the details of registered recovery services provider. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Get.json | +| [replicationRecoveryServicesProvidersListByReplicationFabricsSample.js][replicationrecoveryservicesproviderslistbyreplicationfabricssample] | Lists the registered recovery services providers for the specified fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json | +| [replicationRecoveryServicesProvidersListSample.js][replicationrecoveryservicesproviderslistsample] | Lists the registered recovery services providers in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_List.json | +| [replicationRecoveryServicesProvidersPurgeSample.js][replicationrecoveryservicesproviderspurgesample] | The operation to purge(force delete) a recovery services provider from the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Purge.json | +| [replicationRecoveryServicesProvidersRefreshProviderSample.js][replicationrecoveryservicesprovidersrefreshprovidersample] | The operation to refresh the information from the recovery services provider. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json | +| [replicationStorageClassificationMappingsCreateSample.js][replicationstorageclassificationmappingscreatesample] | The operation to create a storage classification mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Create.json | +| [replicationStorageClassificationMappingsDeleteSample.js][replicationstorageclassificationmappingsdeletesample] | The operation to delete a storage classification mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Delete.json | +| [replicationStorageClassificationMappingsGetSample.js][replicationstorageclassificationmappingsgetsample] | Gets the details of the specified storage classification mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Get.json | +| [replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.js][replicationstorageclassificationmappingslistbyreplicationstorageclassificationssample] | Lists the storage classification mappings for the fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json | +| [replicationStorageClassificationMappingsListSample.js][replicationstorageclassificationmappingslistsample] | Lists the storage classification mappings in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_List.json | +| [replicationStorageClassificationsGetSample.js][replicationstorageclassificationsgetsample] | Gets the details of the specified storage classification. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_Get.json | +| [replicationStorageClassificationsListByReplicationFabricsSample.js][replicationstorageclassificationslistbyreplicationfabricssample] | Lists the storage classifications available in the specified fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json | +| [replicationStorageClassificationsListSample.js][replicationstorageclassificationslistsample] | Lists the storage classifications in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_List.json | +| [replicationVaultHealthGetSample.js][replicationvaulthealthgetsample] | Gets the health details of the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Get.json | +| [replicationVaultHealthRefreshSample.js][replicationvaulthealthrefreshsample] | Refreshes health summary of the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Refresh.json | +| [replicationVaultSettingCreateSample.js][replicationvaultsettingcreatesample] | The operation to configure vault setting. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Create.json | +| [replicationVaultSettingGetSample.js][replicationvaultsettinggetsample] | Gets the vault setting. This includes the Migration Hub connection settings. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Get.json | +| [replicationVaultSettingListSample.js][replicationvaultsettinglistsample] | Gets the list of vault setting. This includes the Migration Hub connection settings. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_List.json | +| [replicationvCentersCreateSample.js][replicationvcenterscreatesample] | The operation to create a vCenter object.. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Create.json | +| [replicationvCentersDeleteSample.js][replicationvcentersdeletesample] | The operation to remove(unregister) a registered vCenter server from the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Delete.json | +| [replicationvCentersGetSample.js][replicationvcentersgetsample] | Gets the details of a registered vCenter server(Add vCenter server). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Get.json | +| [replicationvCentersListByReplicationFabricsSample.js][replicationvcenterslistbyreplicationfabricssample] | Lists the vCenter servers registered in a fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_ListByReplicationFabrics.json | +| [replicationvCentersListSample.js][replicationvcenterslistsample] | Lists the vCenter servers registered in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_List.json | +| [replicationvCentersUpdateSample.js][replicationvcentersupdatesample] | The operation to update a registered vCenter. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Update.json | +| [supportedOperatingSystemsGetSample.js][supportedoperatingsystemsgetsample] | Gets the data of supported operating systems by SRS. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/SupportedOperatingSystems_Get.json | +| [targetComputeSizesListByReplicationProtectedItemsSample.js][targetcomputesizeslistbyreplicationprotecteditemssample] | Lists the available target compute sizes for a replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node migrationRecoveryPointsGetSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node migrationRecoveryPointsGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[migrationrecoverypointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/migrationRecoveryPointsGetSample.js +[migrationrecoverypointslistbyreplicationmigrationitemssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/migrationRecoveryPointsListByReplicationMigrationItemsSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/operationsListSample.js +[recoverypointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/recoveryPointsGetSample.js +[recoverypointslistbyreplicationprotecteditemssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/recoveryPointsListByReplicationProtectedItemsSample.js +[replicationalertsettingscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsCreateSample.js +[replicationalertsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsGetSample.js +[replicationalertsettingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsListSample.js +[replicationapplianceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAppliancesListSample.js +[replicationeligibilityresultsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEligibilityResultsGetSample.js +[replicationeligibilityresultslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEligibilityResultsListSample.js +[replicationeventsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEventsGetSample.js +[replicationeventslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEventsListSample.js +[replicationfabricscheckconsistencysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsCheckConsistencySample.js +[replicationfabricscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsCreateSample.js +[replicationfabricsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsDeleteSample.js +[replicationfabricsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsGetSample.js +[replicationfabricslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsListSample.js +[replicationfabricsmigratetoaadsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsMigrateToAadSample.js +[replicationfabricspurgesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsPurgeSample.js +[replicationfabricsreassociategatewaysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsReassociateGatewaySample.js +[replicationfabricsrenewcertificatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsRenewCertificateSample.js +[replicationjobscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsCancelSample.js +[replicationjobsexportsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsExportSample.js +[replicationjobsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsGetSample.js +[replicationjobslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsListSample.js +[replicationjobsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsRestartSample.js +[replicationjobsresumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsResumeSample.js +[replicationlogicalnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationLogicalNetworksGetSample.js +[replicationlogicalnetworkslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationLogicalNetworksListByReplicationFabricsSample.js +[replicationmigrationitemscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsCreateSample.js +[replicationmigrationitemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsDeleteSample.js +[replicationmigrationitemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsGetSample.js +[replicationmigrationitemslistbyreplicationprotectioncontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsListByReplicationProtectionContainersSample.js +[replicationmigrationitemslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsListSample.js +[replicationmigrationitemsmigratesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsMigrateSample.js +[replicationmigrationitemspausereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsPauseReplicationSample.js +[replicationmigrationitemsresumereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsResumeReplicationSample.js +[replicationmigrationitemsresyncsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsResyncSample.js +[replicationmigrationitemstestmigratecleanupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsTestMigrateCleanupSample.js +[replicationmigrationitemstestmigratesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsTestMigrateSample.js +[replicationmigrationitemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsUpdateSample.js +[replicationnetworkmappingscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsCreateSample.js +[replicationnetworkmappingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsDeleteSample.js +[replicationnetworkmappingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsGetSample.js +[replicationnetworkmappingslistbyreplicationnetworkssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsListByReplicationNetworksSample.js +[replicationnetworkmappingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsListSample.js +[replicationnetworkmappingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsUpdateSample.js +[replicationnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksGetSample.js +[replicationnetworkslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksListByReplicationFabricsSample.js +[replicationnetworkslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksListSample.js +[replicationpoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesCreateSample.js +[replicationpoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesDeleteSample.js +[replicationpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesGetSample.js +[replicationpolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesListSample.js +[replicationpoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesUpdateSample.js +[replicationprotectableitemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectableItemsGetSample.js +[replicationprotectableitemslistbyreplicationprotectioncontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectableItemsListByReplicationProtectionContainersSample.js +[replicationprotecteditemsadddiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsAddDisksSample.js +[replicationprotecteditemsapplyrecoverypointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsApplyRecoveryPointSample.js +[replicationprotecteditemscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsCreateSample.js +[replicationprotecteditemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsDeleteSample.js +[replicationprotecteditemsfailovercancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsFailoverCancelSample.js +[replicationprotecteditemsfailovercommitsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsFailoverCommitSample.js +[replicationprotecteditemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsGetSample.js +[replicationprotecteditemslistbyreplicationprotectioncontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsListByReplicationProtectionContainersSample.js +[replicationprotecteditemslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsListSample.js +[replicationprotecteditemsplannedfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsPlannedFailoverSample.js +[replicationprotecteditemspurgesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsPurgeSample.js +[replicationprotecteditemsremovediskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsRemoveDisksSample.js +[replicationprotecteditemsrepairreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsRepairReplicationSample.js +[replicationprotecteditemsreprotectsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsReprotectSample.js +[replicationprotecteditemsresolvehealtherrorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsResolveHealthErrorsSample.js +[replicationprotecteditemsswitchprovidersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsSwitchProviderSample.js +[replicationprotecteditemstestfailovercleanupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsTestFailoverCleanupSample.js +[replicationprotecteditemstestfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsTestFailoverSample.js +[replicationprotecteditemsunplannedfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUnplannedFailoverSample.js +[replicationprotecteditemsupdateappliancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateApplianceSample.js +[replicationprotecteditemsupdatemobilityservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateMobilityServiceSample.js +[replicationprotecteditemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateSample.js +[replicationprotectioncontainermappingscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsCreateSample.js +[replicationprotectioncontainermappingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsDeleteSample.js +[replicationprotectioncontainermappingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsGetSample.js +[replicationprotectioncontainermappingslistbyreplicationprotectioncontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.js +[replicationprotectioncontainermappingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsListSample.js +[replicationprotectioncontainermappingspurgesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsPurgeSample.js +[replicationprotectioncontainermappingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsUpdateSample.js +[replicationprotectioncontainerscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersCreateSample.js +[replicationprotectioncontainersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersDeleteSample.js +[replicationprotectioncontainersdiscoverprotectableitemsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersDiscoverProtectableItemSample.js +[replicationprotectioncontainersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersGetSample.js +[replicationprotectioncontainerslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersListByReplicationFabricsSample.js +[replicationprotectioncontainerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersListSample.js +[replicationprotectioncontainersswitchprotectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersSwitchProtectionSample.js +[replicationprotectionintentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsCreateSample.js +[replicationprotectionintentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsGetSample.js +[replicationprotectionintentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsListSample.js +[replicationrecoveryplanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansCreateSample.js +[replicationrecoveryplansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansDeleteSample.js +[replicationrecoveryplansfailovercancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansFailoverCancelSample.js +[replicationrecoveryplansfailovercommitsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansFailoverCommitSample.js +[replicationrecoveryplansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansGetSample.js +[replicationrecoveryplanslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansListSample.js +[replicationrecoveryplansplannedfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansPlannedFailoverSample.js +[replicationrecoveryplansreprotectsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansReprotectSample.js +[replicationrecoveryplanstestfailovercleanupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansTestFailoverCleanupSample.js +[replicationrecoveryplanstestfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansTestFailoverSample.js +[replicationrecoveryplansunplannedfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansUnplannedFailoverSample.js +[replicationrecoveryplansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansUpdateSample.js +[replicationrecoveryservicesproviderscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersCreateSample.js +[replicationrecoveryservicesprovidersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersDeleteSample.js +[replicationrecoveryservicesprovidersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersGetSample.js +[replicationrecoveryservicesproviderslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersListByReplicationFabricsSample.js +[replicationrecoveryservicesproviderslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersListSample.js +[replicationrecoveryservicesproviderspurgesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersPurgeSample.js +[replicationrecoveryservicesprovidersrefreshprovidersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersRefreshProviderSample.js +[replicationstorageclassificationmappingscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsCreateSample.js +[replicationstorageclassificationmappingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsDeleteSample.js +[replicationstorageclassificationmappingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsGetSample.js +[replicationstorageclassificationmappingslistbyreplicationstorageclassificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.js +[replicationstorageclassificationmappingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsListSample.js +[replicationstorageclassificationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsGetSample.js +[replicationstorageclassificationslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsListByReplicationFabricsSample.js +[replicationstorageclassificationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsListSample.js +[replicationvaulthealthgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultHealthGetSample.js +[replicationvaulthealthrefreshsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultHealthRefreshSample.js +[replicationvaultsettingcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingCreateSample.js +[replicationvaultsettinggetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingGetSample.js +[replicationvaultsettinglistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingListSample.js +[replicationvcenterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersCreateSample.js +[replicationvcentersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersDeleteSample.js +[replicationvcentersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersGetSample.js +[replicationvcenterslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersListByReplicationFabricsSample.js +[replicationvcenterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersListSample.js +[replicationvcentersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersUpdateSample.js +[supportedoperatingsystemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/supportedOperatingSystemsGetSample.js +[targetcomputesizeslistbyreplicationprotecteditemssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/targetComputeSizesListByReplicationProtectedItemsSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-recoveryservices-siterecovery?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/README.md diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/migrationRecoveryPointsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/migrationRecoveryPointsGetSample.js new file mode 100644 index 000000000000..6a92568995ca --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/migrationRecoveryPointsGetSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a recovery point for a migration item. + * + * @summary Gets a recovery point for a migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_Get.json + */ +async function getsARecoveryPointForAMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const migrationRecoveryPointName = "b22134ea-620c-474b-9fa5-3c1cb47708e3"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.migrationRecoveryPoints.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName + ); + console.log(result); +} + +getsARecoveryPointForAMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/migrationRecoveryPointsListByReplicationMigrationItemsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/migrationRecoveryPointsListByReplicationMigrationItemsSample.js new file mode 100644 index 000000000000..4642fb1bf5fb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/migrationRecoveryPointsListByReplicationMigrationItemsSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the recovery points for a migration item. + * + * @summary Gets the recovery points for a migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json + */ +async function getsTheRecoveryPointsForAMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.migrationRecoveryPoints.listByReplicationMigrationItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheRecoveryPointsForAMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/operationsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/operationsListSample.js new file mode 100644 index 000000000000..6ced7391214a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/operationsListSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to return the list of available operations. + * + * @summary Operation to return the list of available operations. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/Operations_List.json + */ +async function returnsTheListOfAvailableOperations() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +returnsTheListOfAvailableOperations().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/package.json b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/package.json new file mode 100644 index 000000000000..066aed24256f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-recoveryservices-siterecovery-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "engines": { + "node": ">=14.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery", + "dependencies": { + "@azure/arm-recoveryservices-siterecovery": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/recoveryPointsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/recoveryPointsGetSample.js new file mode 100644 index 000000000000..327293b24d25 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/recoveryPointsGetSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the details of specified recovery point. + * + * @summary Get the details of specified recovery point. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_Get.json + */ +async function getsARecoveryPoint() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const recoveryPointName = "b22134ea-620c-474b-9fa5-3c1cb47708e3"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.recoveryPoints.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName + ); + console.log(result); +} + +getsARecoveryPoint().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/recoveryPointsListByReplicationProtectedItemsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/recoveryPointsListByReplicationProtectedItemsSample.js new file mode 100644 index 000000000000..3235ca663ba8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/recoveryPointsListByReplicationProtectedItemsSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the available recovery points for a replication protected item. + * + * @summary Lists the available recovery points for a replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json + */ +async function getsTheListOfRecoveryPointsForAReplicationProtectedItem() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.recoveryPoints.listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRecoveryPointsForAReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsCreateSample.js new file mode 100644 index 000000000000..c95c486a3801 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsCreateSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update an email notification(alert) configuration. + * + * @summary Create or update an email notification(alert) configuration. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Create.json + */ +async function configuresEmailNotificationsForThisVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const alertSettingName = "defaultAlertSetting"; + const request = { + properties: { + customEmailAddresses: ["ronehr@microsoft.com"], + locale: "", + sendToOwners: "false", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationAlertSettings.create( + resourceName, + resourceGroupName, + alertSettingName, + request + ); + console.log(result); +} + +configuresEmailNotificationsForThisVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsGetSample.js new file mode 100644 index 000000000000..3d83a01324ca --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of the specified email notification(alert) configuration. + * + * @summary Gets the details of the specified email notification(alert) configuration. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Get.json + */ +async function getsAnEmailNotificationAlertConfiguration() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const alertSettingName = "defaultAlertSetting"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationAlertSettings.get( + resourceName, + resourceGroupName, + alertSettingName + ); + console.log(result); +} + +getsAnEmailNotificationAlertConfiguration().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsListSample.js new file mode 100644 index 000000000000..c6460d661844 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAlertSettingsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of email notification(alert) configurations for the vault. + * + * @summary Gets the list of email notification(alert) configurations for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_List.json + */ +async function getsTheListOfConfiguredEmailNotificationAlertConfigurations() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationAlertSettings.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfConfiguredEmailNotificationAlertConfigurations().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAppliancesListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAppliancesListSample.js new file mode 100644 index 000000000000..44a2506a24ca --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationAppliancesListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of Azure Site Recovery appliances for the vault. + * + * @summary Gets the list of Azure Site Recovery appliances for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAppliances_List.json + */ +async function getsTheListOfAppliances() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationAppliances.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAppliances().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEligibilityResultsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEligibilityResultsGetSample.js new file mode 100644 index 000000000000..0ab75cf7f852 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEligibilityResultsGetSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @summary Validates whether a given VM can be protected or not in which case returns list of errors. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_Get.json + */ +async function getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { + const subscriptionId = "d90d145a-4cdd-45a3-b2c4-971d69775278"; + const resourceGroupName = "testRg1"; + const virtualMachineName = "testVm1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationEligibilityResultsOperations.get( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEligibilityResultsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEligibilityResultsListSample.js new file mode 100644 index 000000000000..e4abec51df3b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEligibilityResultsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @summary Validates whether a given VM can be protected or not in which case returns list of errors. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_List.json + */ +async function getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { + const subscriptionId = "d90d145a-4cdd-45a3-b2c4-971d69775278"; + const resourceGroupName = "testRg1"; + const virtualMachineName = "testVm2"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationEligibilityResultsOperations.list( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEventsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEventsGetSample.js new file mode 100644 index 000000000000..8252ea44d481 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEventsGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the details of an Azure Site recovery event. + * + * @summary The operation to get the details of an Azure Site recovery event. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_Get.json + */ +async function getTheDetailsOfAnAzureSiteRecoveryEvent() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const eventName = "654b71d0-b2ce-4e6e-a861-98528d4bd375"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationEvents.get(resourceName, resourceGroupName, eventName); + console.log(result); +} + +getTheDetailsOfAnAzureSiteRecoveryEvent().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEventsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEventsListSample.js new file mode 100644 index 000000000000..7552a840c840 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationEventsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of Azure Site Recovery events for the vault. + * + * @summary Gets the list of Azure Site Recovery events for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_List.json + */ +async function getsTheListOfAzureSiteRecoveryEvents() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationEvents.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAzureSiteRecoveryEvents().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsCheckConsistencySample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsCheckConsistencySample.js new file mode 100644 index 000000000000..b88cc26afd1b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsCheckConsistencySample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to perform a consistency check on the fabric. + * + * @summary The operation to perform a consistency check on the fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_CheckConsistency.json + */ +async function checksTheConsistencyOfTheAsrFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginCheckConsistencyAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +checksTheConsistencyOfTheAsrFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsCreateSample.js new file mode 100644 index 000000000000..8518b410df4d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsCreateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @summary The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Create.json + */ +async function createsAnAzureSiteRecoveryFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const input = { + properties: { + customDetails: { instanceType: "VMwareV2" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + input + ); + console.log(result); +} + +createsAnAzureSiteRecoveryFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsDeleteSample.js new file mode 100644 index 000000000000..c3acef962ac9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete or remove an Azure Site Recovery fabric. + * + * @summary The operation to delete or remove an Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Delete.json + */ +async function deletesTheSite() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +deletesTheSite().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsGetSample.js new file mode 100644 index 000000000000..8d44d4d8a823 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of an Azure Site Recovery fabric. + * + * @summary Gets the details of an Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Get.json + */ +async function getsTheDetailsOfAnAsrFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.get(resourceName, resourceGroupName, fabricName); + console.log(result); +} + +getsTheDetailsOfAnAsrFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsListSample.js new file mode 100644 index 000000000000..74885ffab87b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @summary Gets a list of the Azure Site Recovery fabrics in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_List.json + */ +async function getsTheListOfAsrFabrics() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationFabrics.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAsrFabrics().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsMigrateToAadSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsMigrateToAadSample.js new file mode 100644 index 000000000000..351bafd50b31 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsMigrateToAadSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @summary The operation to migrate an Azure Site Recovery fabric to AAD. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_MigrateToAad.json + */ +async function migratesTheSiteToAad() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginMigrateToAadAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +migratesTheSiteToAad().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsPurgeSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsPurgeSample.js new file mode 100644 index 000000000000..9c44ece00ee8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsPurgeSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @summary The operation to purge(force delete) an Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Purge.json + */ +async function purgesTheSite() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +purgesTheSite().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsReassociateGatewaySample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsReassociateGatewaySample.js new file mode 100644 index 000000000000..2ae002feb243 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsReassociateGatewaySample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to move replications from a process server to another process server. + * + * @summary The operation to move replications from a process server to another process server. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_ReassociateGateway.json + */ +async function performFailoverOfTheProcessServer() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "GRACE-V2A-1"; + const failoverProcessServerRequest = { + properties: { + containerName: "cloud_1f3c15af-2256-4568-9e06-e1ef4f728f75", + sourceProcessServerId: "AFA0EC54-1894-4E44-9CAB02DB8854B117", + targetProcessServerId: "5D3ED340-85AE-C646-B338641E015DA405", + updateType: "ServerLevel", + vmsToMigrate: ["Vm1", "Vm2"], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginReassociateGatewayAndWait( + resourceName, + resourceGroupName, + fabricName, + failoverProcessServerRequest + ); + console.log(result); +} + +performFailoverOfTheProcessServer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsRenewCertificateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsRenewCertificateSample.js new file mode 100644 index 000000000000..e5361528ff0b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationFabricsRenewCertificateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Renews the connection certificate for the ASR replication fabric. + * + * @summary Renews the connection certificate for the ASR replication fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_RenewCertificate.json + */ +async function renewsCertificateForTheFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const renewCertificate = { + properties: { renewCertificateType: "Cloud" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginRenewCertificateAndWait( + resourceName, + resourceGroupName, + fabricName, + renewCertificate + ); + console.log(result); +} + +renewsCertificateForTheFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsCancelSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsCancelSample.js new file mode 100644 index 000000000000..d4421dd4a01c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsCancelSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to cancel an Azure Site Recovery job. + * + * @summary The operation to cancel an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Cancel.json + */ +async function cancelsTheSpecifiedJob() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "2653c648-fc72-4316-86f3-fdf8eaa0066b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginCancelAndWait( + resourceName, + resourceGroupName, + jobName + ); + console.log(result); +} + +cancelsTheSpecifiedJob().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsExportSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsExportSample.js new file mode 100644 index 000000000000..67a757c13659 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsExportSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @summary The operation to export the details of the Azure Site Recovery jobs of the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Export.json + */ +async function exportsTheDetailsOfTheAzureSiteRecoveryJobsOfTheVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobQueryParameter = { + affectedObjectTypes: "", + endTime: "2017-05-04T14:26:51.9161395Z", + jobStatus: "", + startTime: "2017-04-27T14:26:51.9161395Z", + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginExportAndWait( + resourceName, + resourceGroupName, + jobQueryParameter + ); + console.log(result); +} + +exportsTheDetailsOfTheAzureSiteRecoveryJobsOfTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsGetSample.js new file mode 100644 index 000000000000..d5a47c182bf4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the details of an Azure Site Recovery job. + * + * @summary Get the details of an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Get.json + */ +async function getsTheJobDetails() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "58776d0b-3141-48b2-a377-9ad863eb160d"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.get(resourceName, resourceGroupName, jobName); + console.log(result); +} + +getsTheJobDetails().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsListSample.js new file mode 100644 index 000000000000..9221ac7d4359 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of Azure Site Recovery Jobs for the vault. + * + * @summary Gets the list of Azure Site Recovery Jobs for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_List.json + */ +async function getsTheListOfJobs() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationJobs.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfJobs().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsRestartSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsRestartSample.js new file mode 100644 index 000000000000..c490a84aeee7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsRestartSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to restart an Azure Site Recovery job. + * + * @summary The operation to restart an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Restart.json + */ +async function restartsTheSpecifiedJob() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "0664564c-353e-401a-ab0c-722257c10e25"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginRestartAndWait( + resourceName, + resourceGroupName, + jobName + ); + console.log(result); +} + +restartsTheSpecifiedJob().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsResumeSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsResumeSample.js new file mode 100644 index 000000000000..da1a7b77797b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationJobsResumeSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to resume an Azure Site Recovery job. + * + * @summary The operation to resume an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Resume.json + */ +async function resumesTheSpecifiedJob() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "58776d0b-3141-48b2-a377-9ad863eb160d"; + const resumeJobParams = { properties: { comments: " " } }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginResumeAndWait( + resourceName, + resourceGroupName, + jobName, + resumeJobParams + ); + console.log(result); +} + +resumesTheSpecifiedJob().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationLogicalNetworksGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationLogicalNetworksGetSample.js new file mode 100644 index 000000000000..d6597c9cb1c5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationLogicalNetworksGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of a logical network. + * + * @summary Gets the details of a logical network. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_Get.json + */ +async function getsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const logicalNetworkName = "87ab394f-165f-4aa9-bd84-b018500b4509"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationLogicalNetworks.get( + resourceName, + resourceGroupName, + fabricName, + logicalNetworkName + ); + console.log(result); +} + +getsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationLogicalNetworksListByReplicationFabricsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationLogicalNetworksListByReplicationFabricsSample.js new file mode 100644 index 000000000000..3fbe2a7c370b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationLogicalNetworksListByReplicationFabricsSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all the logical networks of the Azure Site Recovery fabric. + * + * @summary Lists all the logical networks of the Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json + */ +async function getsTheListOfLogicalNetworksUnderAFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationLogicalNetworks.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfLogicalNetworksUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsCreateSample.js new file mode 100644 index 000000000000..8787fb582238 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsCreateSample.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create an ASR migration item (enable migration). + * + * @summary The operation to create an ASR migration item (enable migration). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Create.json + */ +async function enablesMigration() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const input = { + properties: { + policyId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1", + providerSpecificDetails: { + dataMoverRunAsAccountId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/dataMoverRunAsAccount1", + disksToInclude: [ + { + diskId: "disk1", + isOSDisk: "true", + logStorageAccountId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Storage/storageAccounts/logStorageAccount1", + logStorageAccountSasSecretName: "logStorageSas", + }, + ], + instanceType: "VMwareCbt", + snapshotRunAsAccountId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/snapshotRunAsAccount1", + targetNetworkId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1", + targetResourceGroupId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1", + vmwareMachineId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/machines/virtualmachine1", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input + ); + console.log(result); +} + +enablesMigration().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsDeleteSample.js new file mode 100644 index 000000000000..12b554f58c2c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsDeleteSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete an ASR migration item. + * + * @summary The operation to delete an ASR migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Delete.json + */ +async function deleteTheMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName + ); + console.log(result); +} + +deleteTheMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsGetSample.js new file mode 100644 index 000000000000..dd3117eabb08 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsGetSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of a migration item. + * + * @summary Gets the details of a migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Get.json + */ +async function getsTheDetailsOfAMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName + ); + console.log(result); +} + +getsTheDetailsOfAMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsListByReplicationProtectionContainersSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsListByReplicationProtectionContainersSample.js new file mode 100644 index 000000000000..a587cafcdf70 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsListByReplicationProtectionContainersSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of ASR migration items in the protection container. + * + * @summary Gets the list of ASR migration items in the protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfMigrationItemsInTheProtectionContainer() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationMigrationItems.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfMigrationItemsInTheProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsListSample.js new file mode 100644 index 000000000000..cc81764c724f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of migration items in the vault. + * + * @summary Gets the list of migration items in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_List.json + */ +async function getsTheListOfMigrationItemsInTheVault() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationMigrationItems.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfMigrationItemsInTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsMigrateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsMigrateSample.js new file mode 100644 index 000000000000..8bb8f3320edb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsMigrateSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to initiate migration of the item. + * + * @summary The operation to initiate migration of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Migrate.json + */ +async function migrateItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const migrateInput = { + properties: { + providerSpecificDetails: { + instanceType: "VMwareCbt", + performShutdown: "true", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginMigrateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput + ); + console.log(result); +} + +migrateItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsPauseReplicationSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsPauseReplicationSample.js new file mode 100644 index 000000000000..546dccf0ff78 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsPauseReplicationSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to initiate pause replication of the item. + * + * @summary The operation to initiate pause replication of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_PauseReplication.json + */ +async function pauseReplication() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const pauseReplicationInput = { + properties: { instanceType: "VMwareCbt" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginPauseReplicationAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput + ); + console.log(result); +} + +pauseReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsResumeReplicationSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsResumeReplicationSample.js new file mode 100644 index 000000000000..322a0c5fdd47 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsResumeReplicationSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to initiate resume replication of the item. + * + * @summary The operation to initiate resume replication of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ResumeReplication.json + */ +async function resumeReplication() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const resumeReplicationInput = { + properties: { + providerSpecificDetails: { + deleteMigrationResources: "false", + instanceType: "VMwareCbt", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginResumeReplicationAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput + ); + console.log(result); +} + +resumeReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsResyncSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsResyncSample.js new file mode 100644 index 000000000000..7fa6214289df --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsResyncSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to resynchronize replication of an ASR migration item. + * + * @summary The operation to resynchronize replication of an ASR migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Resync.json + */ +async function resynchronizesReplication() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const input = { + properties: { + providerSpecificDetails: { + instanceType: "VMwareCbt", + skipCbtReset: "true", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginResyncAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input + ); + console.log(result); +} + +resynchronizesReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsTestMigrateCleanupSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsTestMigrateCleanupSample.js new file mode 100644 index 000000000000..274a18e91a0d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsTestMigrateCleanupSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to initiate test migrate cleanup. + * + * @summary The operation to initiate test migrate cleanup. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json + */ +async function testMigrateCleanup() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const testMigrateCleanupInput = { + properties: { comments: "Test Failover Cleanup" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginTestMigrateCleanupAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput + ); + console.log(result); +} + +testMigrateCleanup().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsTestMigrateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsTestMigrateSample.js new file mode 100644 index 000000000000..92ce4a5d6781 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsTestMigrateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to initiate test migration of the item. + * + * @summary The operation to initiate test migration of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrate.json + */ +async function testMigrateItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const testMigrateInput = { + properties: { + providerSpecificDetails: { + instanceType: "VMwareCbt", + networkId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1", + recoveryPointId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/9e737191-317e-43d0-8c83-e32ac3b34686", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginTestMigrateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput + ); + console.log(result); +} + +testMigrateItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsUpdateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsUpdateSample.js new file mode 100644 index 000000000000..e34c8309abb2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationMigrationItemsUpdateSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update the recovery settings of an ASR migration item. + * + * @summary The operation to update the recovery settings of an ASR migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Update.json + */ +async function updatesMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const input = { + properties: { providerSpecificDetails: { instanceType: "VMwareCbt" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input + ); + console.log(result); +} + +updatesMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsCreateSample.js new file mode 100644 index 000000000000..d7b1ba72b53f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsCreateSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create an ASR network mapping. + * + * @summary The operation to create an ASR network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Create.json + */ +async function createsNetworkMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const input = { + properties: { + fabricSpecificDetails: { instanceType: "VmmToAzure" }, + recoveryFabricName: "Microsoft Azure", + recoveryNetworkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + input + ); + console.log(result); +} + +createsNetworkMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsDeleteSample.js new file mode 100644 index 000000000000..0dbc7f9dfbf6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsDeleteSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete a network mapping. + * + * @summary The operation to delete a network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Delete.json + */ +async function deleteNetworkMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName + ); + console.log(result); +} + +deleteNetworkMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsGetSample.js new file mode 100644 index 000000000000..f8601a0dfd50 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsGetSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of an ASR network mapping. + * + * @summary Gets the details of an ASR network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Get.json + */ +async function getsNetworkMappingByName() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.get( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName + ); + console.log(result); +} + +getsNetworkMappingByName().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsListByReplicationNetworksSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsListByReplicationNetworksSample.js new file mode 100644 index 000000000000..211f10ddaf43 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsListByReplicationNetworksSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all ASR network mappings for the specified network. + * + * @summary Lists all ASR network mappings for the specified network. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json + */ +async function getsAllTheNetworkMappingsUnderANetwork() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworkMappings.listByReplicationNetworks( + resourceName, + resourceGroupName, + fabricName, + networkName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsAllTheNetworkMappingsUnderANetwork().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsListSample.js new file mode 100644 index 000000000000..36e7244f20c0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all ASR network mappings in the vault. + * + * @summary Lists all ASR network mappings in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_List.json + */ +async function getsAllTheNetworkMappingsUnderAVault() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworkMappings.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsAllTheNetworkMappingsUnderAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsUpdateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsUpdateSample.js new file mode 100644 index 000000000000..1f144484bc5a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworkMappingsUpdateSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update an ASR network mapping. + * + * @summary The operation to update an ASR network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Update.json + */ +async function updatesNetworkMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const input = { + properties: { + fabricSpecificDetails: { instanceType: "VmmToAzure" }, + recoveryFabricName: "Microsoft Azure", + recoveryNetworkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai2", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + input + ); + console.log(result); +} + +updatesNetworkMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksGetSample.js new file mode 100644 index 000000000000..4751a173365b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of a network. + * + * @summary Gets the details of a network. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_Get.json + */ +async function getsANetworkWithSpecifiedServerIdAndNetworkName() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "93ce99d7-1219-4914-aa61-73fe5023988e"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworks.get( + resourceName, + resourceGroupName, + fabricName, + networkName + ); + console.log(result); +} + +getsANetworkWithSpecifiedServerIdAndNetworkName().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksListByReplicationFabricsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksListByReplicationFabricsSample.js new file mode 100644 index 000000000000..438ac773c469 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksListByReplicationFabricsSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the networks available for a fabric. + * + * @summary Lists the networks available for a fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_ListByReplicationFabrics.json + */ +async function getsTheListOfNetworksUnderAFabric() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworks.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfNetworksUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksListSample.js new file mode 100644 index 000000000000..b9f8ffdb9523 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationNetworksListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the networks available in a vault. + * + * @summary Lists the networks available in a vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_List.json + */ +async function getsTheListOfNetworksViewOnlyApi() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworks.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfNetworksViewOnlyApi().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesCreateSample.js new file mode 100644 index 000000000000..c777ab9ee498 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesCreateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create a replication policy. + * + * @summary The operation to create a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Create.json + */ +async function createsThePolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const input = { + properties: { + providerSpecificInput: { instanceType: "HyperVReplicaAzure" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.beginCreateAndWait( + resourceName, + resourceGroupName, + policyName, + input + ); + console.log(result); +} + +createsThePolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesDeleteSample.js new file mode 100644 index 000000000000..94bbdfbcc65c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete a replication policy. + * + * @summary The operation to delete a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Delete.json + */ +async function deleteThePolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.beginDeleteAndWait( + resourceName, + resourceGroupName, + policyName + ); + console.log(result); +} + +deleteThePolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesGetSample.js new file mode 100644 index 000000000000..7d41e1a09e4c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of a replication policy. + * + * @summary Gets the details of a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Get.json + */ +async function getsTheRequestedPolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.get(resourceName, resourceGroupName, policyName); + console.log(result); +} + +getsTheRequestedPolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesListSample.js new file mode 100644 index 000000000000..900c21d06773 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the replication policies for a vault. + * + * @summary Lists the replication policies for a vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_List.json + */ +async function getsTheListOfReplicationPolicies() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationPolicies.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationPolicies().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesUpdateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesUpdateSample.js new file mode 100644 index 000000000000..1b329abc2b72 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationPoliciesUpdateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update a replication policy. + * + * @summary The operation to update a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Update.json + */ +async function updatesThePolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const input = { + properties: { + replicationProviderSettings: { instanceType: "HyperVReplicaAzure" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.beginUpdateAndWait( + resourceName, + resourceGroupName, + policyName, + input + ); + console.log(result); +} + +updatesThePolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectableItemsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectableItemsGetSample.js new file mode 100644 index 000000000000..79776db2b24c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectableItemsGetSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to get the details of a protectable item. + * + * @summary The operation to get the details of a protectable item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_Get.json + */ +async function getsTheDetailsOfAProtectableItem() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const protectableItemName = "c0c14913-3d7a-48ea-9531-cc99e0e686e6"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectableItems.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + protectableItemName + ); + console.log(result); +} + +getsTheDetailsOfAProtectableItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectableItemsListByReplicationProtectionContainersSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectableItemsListByReplicationProtectionContainersSample.js new file mode 100644 index 000000000000..26a759c90776 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectableItemsListByReplicationProtectionContainersSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the protectable items in a protection container. + * + * @summary Lists the protectable items in a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfProtectableItems() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectableItems.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfProtectableItems().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsAddDisksSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsAddDisksSample.js new file mode 100644 index 000000000000..3b9f3fd36881 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsAddDisksSample.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to add disks(s) to the replication protected item. + * + * @summary Operation to add disks(s) to the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_AddDisks.json + */ +async function addDiskSForProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const addDisksInput = { + properties: { + providerSpecificDetails: { + instanceType: "A2A", + vmDisks: [ + { + diskUri: "https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd", + primaryStagingAzureStorageAccountId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/primaryResource/providers/Microsoft.Storage/storageAccounts/vmcachestorage", + recoveryAzureStorageAccountId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/recoveryResource/providers/Microsoft.Storage/storageAccounts/recoverystorage", + }, + ], + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginAddDisksAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput + ); + console.log(result); +} + +addDiskSForProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsApplyRecoveryPointSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsApplyRecoveryPointSample.js new file mode 100644 index 000000000000..f60ab9cd5117 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsApplyRecoveryPointSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to change the recovery point of a failed over replication protected item. + * + * @summary The operation to change the recovery point of a failed over replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json + */ +async function changeOrApplyRecoveryPoint() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const applyRecoveryPointInput = { + properties: { + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + recoveryPointId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/e4d05fe9-5dfd-47be-b50b-aad306b2802d", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginApplyRecoveryPointAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput + ); + console.log(result); +} + +changeOrApplyRecoveryPoint().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsCreateSample.js new file mode 100644 index 000000000000..1274703a682e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsCreateSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create an ASR replication protected item (Enable replication). + * + * @summary The operation to create an ASR replication protected item (Enable replication). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Create.json + */ +async function enablesProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const input = { + properties: { + policyId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1", + protectableItemId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input + ); + console.log(result); +} + +enablesProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsDeleteSample.js new file mode 100644 index 000000000000..aad2ea61328a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsDeleteSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to disable replication on a replication protected item. This will also remove the item. + * + * @summary The operation to disable replication on a replication protected item. This will also remove the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Delete.json + */ +async function disablesProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "c0c14913-3d7a-48ea-9531-cc99e0e686e6"; + const disableProtectionInput = { + properties: { + replicationProviderInput: { + instanceType: "InMage", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput + ); + console.log(result); +} + +disablesProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsFailoverCancelSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsFailoverCancelSample.js new file mode 100644 index 000000000000..49cc6603260b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsFailoverCancelSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to cancel the failover of the replication protected item. + * + * @summary Operation to cancel the failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCancel.json + */ +async function executeCancelFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginFailoverCancelAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +executeCancelFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsFailoverCommitSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsFailoverCommitSample.js new file mode 100644 index 000000000000..d52cd13b1ae4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsFailoverCommitSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to commit the failover of the replication protected item. + * + * @summary Operation to commit the failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCommit.json + */ +async function executeCommitFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginFailoverCommitAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +executeCommitFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsGetSample.js new file mode 100644 index 000000000000..86abd9a5f492 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsGetSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of an ASR replication protected item. + * + * @summary Gets the details of an ASR replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Get.json + */ +async function getsTheDetailsOfAReplicationProtectedItem() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +getsTheDetailsOfAReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsListByReplicationProtectionContainersSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsListByReplicationProtectionContainersSample.js new file mode 100644 index 000000000000..f8709e954e75 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsListByReplicationProtectionContainersSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of ASR replication protected items in the protection container. + * + * @summary Gets the list of ASR replication protected items in the protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfReplicationProtectedItems() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectedItems.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationProtectedItems().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsListSample.js new file mode 100644 index 000000000000..f1f44353d38a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of ASR replication protected items in the vault. + * + * @summary Gets the list of ASR replication protected items in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_List.json + */ +async function getsTheListOfReplicationProtectedItems() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectedItems.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationProtectedItems().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsPlannedFailoverSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsPlannedFailoverSample.js new file mode 100644 index 000000000000..019bd265c026 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsPlannedFailoverSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to initiate a planned failover of the replication protected item. + * + * @summary Operation to initiate a planned failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_PlannedFailover.json + */ +async function executePlannedFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const failoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginPlannedFailoverAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput + ); + console.log(result); +} + +executePlannedFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsPurgeSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsPurgeSample.js new file mode 100644 index 000000000000..a064e8603b01 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsPurgeSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item. + * + * @summary The operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Purge.json + */ +async function purgesProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "c0c14913-3d7a-48ea-9531-cc99e0e686e6"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +purgesProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsRemoveDisksSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsRemoveDisksSample.js new file mode 100644 index 000000000000..4923be2c3b41 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsRemoveDisksSample.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to remove disk(s) from the replication protected item. + * + * @summary Operation to remove disk(s) from the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RemoveDisks.json + */ +async function removesDiskS() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const removeDisksInput = { + properties: { + providerSpecificDetails: { + instanceType: "A2A", + vmDisksUris: ["https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd"], + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginRemoveDisksAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput + ); + console.log(result); +} + +removesDiskS().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsRepairReplicationSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsRepairReplicationSample.js new file mode 100644 index 000000000000..d10f961149cf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsRepairReplicationSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to start resynchronize/repair replication for a replication protected item requiring resynchronization. + * + * @summary The operation to start resynchronize/repair replication for a replication protected item requiring resynchronization. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RepairReplication.json + */ +async function resynchronizeOrRepairReplication() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginRepairReplicationAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +resynchronizeOrRepairReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsReprotectSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsReprotectSample.js new file mode 100644 index 000000000000..44b2a3093180 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsReprotectSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @summary Operation to reprotect or reverse replicate a failed over replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Reprotect.json + */ +async function executeReverseReplicationReprotect() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const reprotectInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginReprotectAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput + ); + console.log(result); +} + +executeReverseReplicationReprotect().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsResolveHealthErrorsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsResolveHealthErrorsSample.js new file mode 100644 index 000000000000..5b8f7f6091ff --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsResolveHealthErrorsSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to resolve health issues of the replication protected item. + * + * @summary Operation to resolve health issues of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json + */ +async function resolveHealthErrors() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const resolveHealthInput = { + properties: { healthErrors: [{ healthErrorId: "3:8020" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginResolveHealthErrorsAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput + ); + console.log(result); +} + +resolveHealthErrors().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsSwitchProviderSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsSwitchProviderSample.js new file mode 100644 index 000000000000..80093a9752f2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsSwitchProviderSample.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to initiate a switch provider of the replication protected item. + * + * @summary Operation to initiate a switch provider of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_SwitchProvider.json + */ +async function executeSwitchProvider() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const switchProviderInput = { + properties: { + providerSpecificDetails: { + instanceType: "InMageAzureV2", + targetApplianceID: "5efaa202-e958-435e-8171-706bf735fcc4", + targetFabricID: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2", + targetVaultID: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault2", + }, + targetInstanceType: "InMageRcm", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginSwitchProviderAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput + ); + console.log(result); +} + +executeSwitchProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsTestFailoverCleanupSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsTestFailoverCleanupSample.js new file mode 100644 index 000000000000..9607b7b66285 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsTestFailoverCleanupSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to clean up the test failover of a replication protected item. + * + * @summary Operation to clean up the test failover of a replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json + */ +async function executeTestFailoverCleanup() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const cleanupInput = { + properties: { comments: "Test Failover Cleanup" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginTestFailoverCleanupAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput + ); + console.log(result); +} + +executeTestFailoverCleanup().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsTestFailoverSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsTestFailoverSample.js new file mode 100644 index 000000000000..5a0f826cd54a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsTestFailoverSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to perform a test failover of the replication protected item. + * + * @summary Operation to perform a test failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailover.json + */ +async function executeTestFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const testfailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + networkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + networkType: "VmNetworkAsInput", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginTestFailoverAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput + ); + console.log(result); +} + +executeTestFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUnplannedFailoverSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUnplannedFailoverSample.js new file mode 100644 index 000000000000..d4413782f73f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUnplannedFailoverSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to initiate a failover of the replication protected item. + * + * @summary Operation to initiate a failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UnplannedFailover.json + */ +async function executeUnplannedFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const failoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + sourceSiteOperations: "NotRequired", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUnplannedFailoverAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput + ); + console.log(result); +} + +executeUnplannedFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateApplianceSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateApplianceSample.js new file mode 100644 index 000000000000..53c3d3c7503e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateApplianceSample.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update appliance of an ASR replication protected item. + * + * @summary The operation to update appliance of an ASR replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateAppliance.json + */ +async function updatesApplianceForReplicationProtectedItem() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "Ayan-0106-SA-Vault"; + const resourceGroupName = "Ayan-0106-SA-RG"; + const fabricName = "Ayan-0106-SA-Vaultreplicationfabric"; + const protectionContainerName = "Ayan-0106-SA-Vaultreplicationcontainer"; + const replicatedProtectedItemName = "idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f"; + const applianceUpdateInput = { + properties: { + providerSpecificDetails: { + instanceType: "InMageRcm", + runAsAccountId: "", + }, + targetApplianceId: "", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUpdateApplianceAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput + ); + console.log(result); +} + +updatesApplianceForReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateMobilityServiceSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateMobilityServiceSample.js new file mode 100644 index 000000000000..4964ba785447 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateMobilityServiceSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update(push update) the installed mobility service software on a replication protected item to the latest available version. + * + * @summary The operation to update(push update) the installed mobility service software on a replication protected item to the latest available version. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateMobilityService.json + */ +async function updateTheMobilityServiceOnAProtectedItem() { + const subscriptionId = "b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c"; + const resourceName = "WCUSVault"; + const resourceGroupName = "wcusValidations"; + const fabricName = "WIN-JKKJ31QI8U2"; + const protectionContainerName = "cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0"; + const replicatedProtectedItemName = "79dd20ab-2b40-11e7-9791-0050568f387e"; + const updateMobilityServiceRequest = { + properties: { runAsAccountId: "2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUpdateMobilityServiceAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest + ); + console.log(result); +} + +updateTheMobilityServiceOnAProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateSample.js new file mode 100644 index 000000000000..1ac756d0ee85 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectedItemsUpdateSample.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update the recovery settings of an ASR replication protected item. + * + * @summary The operation to update the recovery settings of an ASR replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Update.json + */ +async function updatesTheReplicationProtectedItemSettings() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const updateProtectionInput = { + properties: { + licenseType: "WindowsServer", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + recoveryAzureVMName: "vm1", + recoveryAzureVMSize: "Basic_A0", + selectedRecoveryAzureNetworkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + vmNics: [ + { + ipConfigs: [ + { + ipConfigName: "ipconfig1", + isPrimary: true, + recoveryStaticIPAddress: "10.0.2.46", + recoverySubnetName: "subnet1", + }, + ], + nicId: + "TWljcm9zb2Z0OkY4NDkxRTRGLTgxN0EtNDBERC1BOTBDLUFGNzczOTc4Qzc1Qlw3NjAwMzMxRS03NDk4LTQ0QTQtQjdDNy0xQjY1NkJDREQ1MkQ=", + selectionType: "SelectedByUser", + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput + ); + console.log(result); +} + +updatesTheReplicationProtectedItemSettings().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsCreateSample.js new file mode 100644 index 000000000000..c448b3541e6a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsCreateSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create a protection container mapping. + * + * @summary The operation to create a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Create.json + */ +async function createProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const creationInput = { + properties: { + policyId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1", + providerSpecificInput: { + instanceType: "VMwareCbt", + }, + targetProtectionContainerId: "Microsoft Azure", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + creationInput + ); + console.log(result); +} + +createProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsDeleteSample.js new file mode 100644 index 000000000000..c0702435e5be --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsDeleteSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete or remove a protection container mapping. + * + * @summary The operation to delete or remove a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Delete.json + */ +async function removeProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const removalInput = { + properties: { providerSpecificInput: {} }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + removalInput + ); + console.log(result); +} + +removeProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsGetSample.js new file mode 100644 index 000000000000..b4ffd2b15cdb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsGetSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of a protection container mapping. + * + * @summary Gets the details of a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Get.json + */ +async function getsAProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName + ); + console.log(result); +} + +getsAProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.js new file mode 100644 index 000000000000..8dc7247c7496 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the protection container mappings for a protection container. + * + * @summary Lists the protection container mappings for a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfProtectionContainerMappingsForAProtectionContainer() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainerMappings.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfProtectionContainerMappingsForAProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsListSample.js new file mode 100644 index 000000000000..e7ca70603014 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the protection container mappings in the vault. + * + * @summary Lists the protection container mappings in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_List.json + */ +async function getsTheListOfAllProtectionContainerMappingsInAVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainerMappings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAllProtectionContainerMappingsInAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsPurgeSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsPurgeSample.js new file mode 100644 index 000000000000..37e8e1e3a2df --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsPurgeSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to purge(force delete) a protection container mapping. + * + * @summary The operation to purge(force delete) a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Purge.json + */ +async function purgeProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName + ); + console.log(result); +} + +purgeProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsUpdateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsUpdateSample.js new file mode 100644 index 000000000000..00031a5809e6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainerMappingsUpdateSample.js @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update protection container mapping. + * + * @summary The operation to update protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Update.json + */ +async function updateProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const updateInput = { + properties: { + providerSpecificInput: { + agentAutoUpdateStatus: "Enabled", + automationAccountArmId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1", + instanceType: "A2A", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + updateInput + ); + console.log(result); +} + +updateProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersCreateSample.js new file mode 100644 index 000000000000..02bc96bb1bb4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersCreateSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to create a protection container. + * + * @summary Operation to create a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Create.json + */ +async function createAProtectionContainer() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const creationInput = { + properties: { + providerSpecificInput: [{ instanceType: "A2ACrossClusterMigration" }], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + creationInput + ); + console.log(result); +} + +createAProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersDeleteSample.js new file mode 100644 index 000000000000..d83d0275ac7f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersDeleteSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to remove a protection container. + * + * @summary Operation to remove a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Delete.json + */ +async function removesAProtectionContainer() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + ); + console.log(result); +} + +removesAProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersDiscoverProtectableItemSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersDiscoverProtectableItemSample.js new file mode 100644 index 000000000000..2a5909076f97 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersDiscoverProtectableItemSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to a add a protectable item to a protection container(Add physical server). + * + * @summary The operation to a add a protectable item to a protection container(Add physical server). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json + */ +async function addsAProtectableItemToTheReplicationProtectionContainer() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "V2A-W2K12-660"; + const protectionContainerName = "cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c"; + const discoverProtectableItemRequest = { + properties: { + friendlyName: "Test", + ipAddress: "10.150.2.3", + osType: "Windows", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginDiscoverProtectableItemAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest + ); + console.log(result); +} + +addsAProtectableItemToTheReplicationProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersGetSample.js new file mode 100644 index 000000000000..9fb6a0e57117 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of a protection container. + * + * @summary Gets the details of a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Get.json + */ +async function getsTheProtectionContainerDetails() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + ); + console.log(result); +} + +getsTheProtectionContainerDetails().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersListByReplicationFabricsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersListByReplicationFabricsSample.js new file mode 100644 index 000000000000..f1593ea2fe97 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersListByReplicationFabricsSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the protection containers in the specified fabric. + * + * @summary Lists the protection containers in the specified fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json + */ +async function getsTheListOfProtectionContainerForAFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainers.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfProtectionContainerForAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersListSample.js new file mode 100644 index 000000000000..fbdb2b98be58 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the protection containers in a vault. + * + * @summary Lists the protection containers in a vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_List.json + */ +async function getsTheListOfAllProtectionContainersInAVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainers.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAllProtectionContainersInAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersSwitchProtectionSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersSwitchProtectionSample.js new file mode 100644 index 000000000000..b9add88827ee --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionContainersSwitchProtectionSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to switch protection from one container to another or one replication provider to another. + * + * @summary Operation to switch protection from one container to another or one replication provider to another. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_SwitchProtection.json + */ +async function switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother() { + const subscriptionId = "42195872-7e70-4f8a-837f-84b28ecbb78b"; + const resourceName = "priyanponeboxvault"; + const resourceGroupName = "priyanprg"; + const fabricName = "CentralUSCanSite"; + const protectionContainerName = "CentralUSCancloud"; + const switchInput = { + properties: { providerSpecificDetails: { instanceType: "A2A" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginSwitchProtectionAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + switchInput + ); + console.log(result); +} + +switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsCreateSample.js new file mode 100644 index 000000000000..bd191b9d55d1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsCreateSample.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create an ASR replication protection intent item. + * + * @summary The operation to create an ASR replication protection intent item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Create.json + */ +async function createProtectionIntentResource() { + const subscriptionId = "509099b2-9d2c-4636-b43e-bd5cafb6be69"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const intentObjectName = "vm1"; + const input = { + properties: { + providerSpecificDetails: { + fabricObjectId: + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne/providers/Microsoft.Compute/virtualMachines/vmPpgAv5", + instanceType: "A2A", + primaryLocation: "eastUs2", + recoveryAvailabilityType: "Single", + recoveryLocation: "westus2", + recoveryResourceGroupId: + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne-asr", + recoverySubscriptionId: "ed5bcdf6-d61e-47bd-8ea9-f2bd379a2640", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionIntents.create( + resourceName, + resourceGroupName, + intentObjectName, + input + ); + console.log(result); +} + +createProtectionIntentResource().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsGetSample.js new file mode 100644 index 000000000000..a8bcf75901d3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of an ASR replication protection intent. + * + * @summary Gets the details of an ASR replication protection intent. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Get.json + */ +async function getsTheDetailsOfAReplicationProtectionIntentItem() { + const subscriptionId = "509099b2-9d2c-4636-b43e-bd5cafb6be69"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const intentObjectName = "vm1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionIntents.get( + resourceName, + resourceGroupName, + intentObjectName + ); + console.log(result); +} + +getsTheDetailsOfAReplicationProtectionIntentItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsListSample.js new file mode 100644 index 000000000000..b82937290215 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationProtectionIntentsListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of ASR replication protection intent objects in the vault. + * + * @summary Gets the list of ASR replication protection intent objects in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_List.json + */ +async function getsTheListOfReplicationProtectionIntentObjects() { + const subscriptionId = "509099b2-9d2c-4636-b43e-bd5cafb6be69"; + const resourceName = "2007vttp"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionIntents.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationProtectionIntentObjects().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansCreateSample.js new file mode 100644 index 000000000000..d1172300b9cf --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansCreateSample.js @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create a recovery plan. + * + * @summary The operation to create a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Create.json + */ +async function createsARecoveryPlanWithTheGivenDetails() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input = { + properties: { + failoverDeploymentModel: "ResourceManager", + groups: [ + { + endGroupActions: [], + groupType: "Boot", + replicationProtectedItems: [ + { + id: "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b", + virtualMachineId: "f8491e4f-817a-40dd-a90c-af773978c75b", + }, + ], + startGroupActions: [], + }, + ], + primaryFabricId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1", + recoveryFabricId: "Microsoft Azure", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginCreateAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +createsARecoveryPlanWithTheGivenDetails().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansDeleteSample.js new file mode 100644 index 000000000000..1129ce372513 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a recovery plan. + * + * @summary Delete a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Delete.json + */ +async function deletesTheSpecifiedRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginDeleteAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +deletesTheSpecifiedRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansFailoverCancelSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansFailoverCancelSample.js new file mode 100644 index 000000000000..79c5f0a1c8d1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansFailoverCancelSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to cancel the failover of a recovery plan. + * + * @summary The operation to cancel the failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCancel.json + */ +async function executeCancelFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginFailoverCancelAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +executeCancelFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansFailoverCommitSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansFailoverCommitSample.js new file mode 100644 index 000000000000..32205406b917 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansFailoverCommitSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to commit the failover of a recovery plan. + * + * @summary The operation to commit the failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCommit.json + */ +async function executeCommitFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginFailoverCommitAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +executeCommitFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansGetSample.js new file mode 100644 index 000000000000..05e19fcef652 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of the recovery plan. + * + * @summary Gets the details of the recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Get.json + */ +async function getsTheRequestedRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.get( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +getsTheRequestedRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansListSample.js new file mode 100644 index 000000000000..010bc1e61081 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the recovery plans in the vault. + * + * @summary Lists the recovery plans in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_List.json + */ +async function getsTheListOfRecoveryPlans() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationRecoveryPlans.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRecoveryPlans().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansPlannedFailoverSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansPlannedFailoverSample.js new file mode 100644 index 000000000000..971ac168dc7d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansPlannedFailoverSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to start the planned failover of a recovery plan. + * + * @summary The operation to start the planned failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_PlannedFailover.json + */ +async function executePlannedFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: [{ instanceType: "HyperVReplicaAzure" }], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginPlannedFailoverAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executePlannedFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansReprotectSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansReprotectSample.js new file mode 100644 index 000000000000..be3e27273b5a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansReprotectSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to reprotect(reverse replicate) a recovery plan. + * + * @summary The operation to reprotect(reverse replicate) a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Reprotect.json + */ +async function executeReprotectOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginReprotectAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +executeReprotectOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansTestFailoverCleanupSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansTestFailoverCleanupSample.js new file mode 100644 index 000000000000..32237def57f0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansTestFailoverCleanupSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to cleanup test failover of a recovery plan. + * + * @summary The operation to cleanup test failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json + */ +async function executeTestFailoverCleanupOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input = { + properties: { comments: "Test Failover Cleanup" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginTestFailoverCleanupAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executeTestFailoverCleanupOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansTestFailoverSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansTestFailoverSample.js new file mode 100644 index 000000000000..6310be502095 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansTestFailoverSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to start the test failover of a recovery plan. + * + * @summary The operation to start the test failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailover.json + */ +async function executeTestFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input = { + properties: { + failoverDirection: "PrimaryToRecovery", + networkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + networkType: "VmNetworkAsInput", + providerSpecificDetails: [{ instanceType: "HyperVReplicaAzure" }], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginTestFailoverAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executeTestFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansUnplannedFailoverSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansUnplannedFailoverSample.js new file mode 100644 index 000000000000..86c9860429b6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansUnplannedFailoverSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to start the unplanned failover of a recovery plan. + * + * @summary The operation to start the unplanned failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json + */ +async function executeUnplannedFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: [{ instanceType: "HyperVReplicaAzure" }], + sourceSiteOperations: "Required", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginUnplannedFailoverAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executeUnplannedFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansUpdateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansUpdateSample.js new file mode 100644 index 000000000000..7ecfc80deba7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryPlansUpdateSample.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update a recovery plan. + * + * @summary The operation to update a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Update.json + */ +async function updatesTheGivenRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input = { + properties: { + groups: [ + { + endGroupActions: [], + groupType: "Shutdown", + replicationProtectedItems: [], + startGroupActions: [], + }, + { + endGroupActions: [], + groupType: "Failover", + replicationProtectedItems: [], + startGroupActions: [], + }, + { + endGroupActions: [], + groupType: "Boot", + replicationProtectedItems: [ + { + id: "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b", + virtualMachineId: "f8491e4f-817a-40dd-a90c-af773978c75b", + }, + ], + startGroupActions: [], + }, + { + endGroupActions: [], + groupType: "Boot", + replicationProtectedItems: [ + { + id: "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6", + virtualMachineId: "c0c14913-3d7a-48ea-9531-cc99e0e686e6", + }, + ], + startGroupActions: [], + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginUpdateAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +updatesTheGivenRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersCreateSample.js new file mode 100644 index 000000000000..c165109dd494 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersCreateSample.js @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to add a recovery services provider. + * + * @summary The operation to add a recovery services provider. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Create.json + */ +async function addsARecoveryServicesProvider() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const providerName = "vmwareprovider1"; + const addProviderInput = { + properties: { + authenticationIdentityInput: { + aadAuthority: "https://login.microsoftonline.com", + applicationId: "f66fce08-c0c6-47a1-beeb-0ede5ea94f90", + audience: "https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874", + objectId: "141360b8-5686-4240-a027-5e24e6affeba", + tenantId: "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + machineName: "vmwareprovider1", + resourceAccessIdentityInput: { + aadAuthority: "https://login.microsoftonline.com", + applicationId: "f66fce08-c0c6-47a1-beeb-0ede5ea94f90", + audience: "https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874", + objectId: "141360b8-5686-4240-a027-5e24e6affeba", + tenantId: "72f988bf-86f1-41af-91ab-2d7cd011db47", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName, + addProviderInput + ); + console.log(result); +} + +addsARecoveryServicesProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersDeleteSample.js new file mode 100644 index 000000000000..d4c744a0afd4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersDeleteSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @summary The operation to removes/delete(unregister) a recovery services provider from the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Delete.json + */ +async function deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersGetSample.js new file mode 100644 index 000000000000..994bafc5940f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of registered recovery services provider. + * + * @summary Gets the details of registered recovery services provider. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Get.json + */ +async function getsTheDetailsOfARecoveryServicesProvider() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.get( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +getsTheDetailsOfARecoveryServicesProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersListByReplicationFabricsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersListByReplicationFabricsSample.js new file mode 100644 index 000000000000..c25f91e48381 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersListByReplicationFabricsSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the registered recovery services providers for the specified fabric. + * + * @summary Lists the registered recovery services providers for the specified fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json + */ +async function getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationRecoveryServicesProviders.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersListSample.js new file mode 100644 index 000000000000..59f2302c9a36 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the registered recovery services providers in the vault. + * + * @summary Lists the registered recovery services providers in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_List.json + */ +async function getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationRecoveryServicesProviders.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersPurgeSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersPurgeSample.js new file mode 100644 index 000000000000..24498b6ee1ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersPurgeSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to purge(force delete) a recovery services provider from the vault. + * + * @summary The operation to purge(force delete) a recovery services provider from the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Purge.json + */ +async function purgesRecoveryServiceProviderFromFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +purgesRecoveryServiceProviderFromFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersRefreshProviderSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersRefreshProviderSample.js new file mode 100644 index 000000000000..3e92000e705e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationRecoveryServicesProvidersRefreshProviderSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to refresh the information from the recovery services provider. + * + * @summary The operation to refresh the information from the recovery services provider. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json + */ +async function refreshDetailsFromTheRecoveryServicesProvider() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginRefreshProviderAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +refreshDetailsFromTheRecoveryServicesProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsCreateSample.js new file mode 100644 index 000000000000..9feae4dde407 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsCreateSample.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create a storage classification mapping. + * + * @summary The operation to create a storage classification mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Create.json + */ +async function createStorageClassificationMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const storageClassificationMappingName = "testStorageMapping"; + const pairingInput = { + properties: { + targetStorageClassificationId: + "/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassificationMappings.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput + ); + console.log(result); +} + +createStorageClassificationMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsDeleteSample.js new file mode 100644 index 000000000000..a413050179c2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsDeleteSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to delete a storage classification mapping. + * + * @summary The operation to delete a storage classification mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Delete.json + */ +async function deleteAStorageClassificationMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const storageClassificationMappingName = "testStorageMapping"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassificationMappings.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName + ); + console.log(result); +} + +deleteAStorageClassificationMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsGetSample.js new file mode 100644 index 000000000000..777c7eb1a972 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsGetSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of the specified storage classification mapping. + * + * @summary Gets the details of the specified storage classification mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Get.json + */ +async function getsTheDetailsOfAStorageClassificationMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const storageClassificationMappingName = "testStorageMapping"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassificationMappings.get( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName + ); + console.log(result); +} + +getsTheDetailsOfAStorageClassificationMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.js new file mode 100644 index 000000000000..644069ddb17b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the storage classification mappings for the fabric. + * + * @summary Lists the storage classification mappings for the fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json + */ +async function getsTheListOfStorageClassificationMappingsObjectsUnderAStorage() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassificationMappings.listByReplicationStorageClassifications( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationMappingsObjectsUnderAStorage().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsListSample.js new file mode 100644 index 000000000000..d34b46f5ac7e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationMappingsListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the storage classification mappings in the vault. + * + * @summary Lists the storage classification mappings in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_List.json + */ +async function getsTheListOfStorageClassificationMappingsObjectsUnderAVault() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassificationMappings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationMappingsObjectsUnderAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsGetSample.js new file mode 100644 index 000000000000..269cb6a12150 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of the specified storage classification. + * + * @summary Gets the details of the specified storage classification. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_Get.json + */ +async function getsTheDetailsOfAStorageClassification() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassifications.get( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName + ); + console.log(result); +} + +getsTheDetailsOfAStorageClassification().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsListByReplicationFabricsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsListByReplicationFabricsSample.js new file mode 100644 index 000000000000..542cf8e5d74f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsListByReplicationFabricsSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the storage classifications available in the specified fabric. + * + * @summary Lists the storage classifications available in the specified fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json + */ +async function getsTheListOfStorageClassificationObjectsUnderAFabric() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassifications.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationObjectsUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsListSample.js new file mode 100644 index 000000000000..e99ad1c8f1a0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationStorageClassificationsListSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the storage classifications in the vault. + * + * @summary Lists the storage classifications in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_List.json + */ +async function getsTheListOfStorageClassificationObjectsUnderAVault() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassifications.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationObjectsUnderAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultHealthGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultHealthGetSample.js new file mode 100644 index 000000000000..722ae9759327 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultHealthGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the health details of the vault. + * + * @summary Gets the health details of the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Get.json + */ +async function getsTheHealthSummaryForTheVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultHealth.get(resourceName, resourceGroupName); + console.log(result); +} + +getsTheHealthSummaryForTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultHealthRefreshSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultHealthRefreshSample.js new file mode 100644 index 000000000000..5279a06a23bc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultHealthRefreshSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Refreshes health summary of the vault. + * + * @summary Refreshes health summary of the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Refresh.json + */ +async function refreshesHealthSummaryOfTheVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultHealth.beginRefreshAndWait( + resourceName, + resourceGroupName + ); + console.log(result); +} + +refreshesHealthSummaryOfTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingCreateSample.js new file mode 100644 index 000000000000..db41e53c07a5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingCreateSample.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to configure vault setting. + * + * @summary The operation to configure vault setting. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Create.json + */ +async function updatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const vaultSettingName = "default"; + const input = { + properties: { + migrationSolutionId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.Migrate/MigrateProjects/resourceGroupPS1-MigrateProject/Solutions/Servers-Migration-ServerMigration", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultSetting.beginCreateAndWait( + resourceName, + resourceGroupName, + vaultSettingName, + input + ); + console.log(result); +} + +updatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingGetSample.js new file mode 100644 index 000000000000..b3fbef690a7e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the vault setting. This includes the Migration Hub connection settings. + * + * @summary Gets the vault setting. This includes the Migration Hub connection settings. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Get.json + */ +async function getsTheVaultSetting() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const vaultSettingName = "default"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultSetting.get( + resourceName, + resourceGroupName, + vaultSettingName + ); + console.log(result); +} + +getsTheVaultSetting().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingListSample.js new file mode 100644 index 000000000000..a9b7f63fd479 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationVaultSettingListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @summary Gets the list of vault setting. This includes the Migration Hub connection settings. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_List.json + */ +async function getsTheListOfVaultSetting() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationVaultSetting.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfVaultSetting().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersCreateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersCreateSample.js new file mode 100644 index 000000000000..65b80d22317e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersCreateSample.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to create a vCenter object.. + * + * @summary The operation to create a vCenter object.. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Create.json + */ +async function addVCenter() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const addVCenterRequest = { + properties: { + friendlyName: "esx-78", + ipAddress: "inmtest78", + port: "443", + processServerId: "5A720CAB-39CB-F445-BD1662B0B33164B5", + runAsAccountId: "2", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + vcenterName, + addVCenterRequest + ); + console.log(result); +} + +addVCenter().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersDeleteSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersDeleteSample.js new file mode 100644 index 000000000000..d74e9e1aac49 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersDeleteSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to remove(unregister) a registered vCenter server from the vault. + * + * @summary The operation to remove(unregister) a registered vCenter server from the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Delete.json + */ +async function removeVCenterOperation() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + vcenterName + ); + console.log(result); +} + +removeVCenterOperation().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersGetSample.js new file mode 100644 index 000000000000..dff5c9b43a8d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersGetSample.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the details of a registered vCenter server(Add vCenter server). + * + * @summary Gets the details of a registered vCenter server(Add vCenter server). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Get.json + */ +async function getsTheDetailsOfAVCenter() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.get( + resourceName, + resourceGroupName, + fabricName, + vcenterName + ); + console.log(result); +} + +getsTheDetailsOfAVCenter().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersListByReplicationFabricsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersListByReplicationFabricsSample.js new file mode 100644 index 000000000000..d88b9d08b3f0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersListByReplicationFabricsSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the vCenter servers registered in a fabric. + * + * @summary Lists the vCenter servers registered in a fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_ListByReplicationFabrics.json + */ +async function getsTheListOfVCenterRegisteredUnderAFabric() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationvCenters.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfVCenterRegisteredUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersListSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersListSample.js new file mode 100644 index 000000000000..4c363d54118d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the vCenter servers registered in the vault. + * + * @summary Lists the vCenter servers registered in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_List.json + */ +async function getsTheListOfVCenterRegisteredUnderTheVault() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationvCenters.list(resourceName, resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfVCenterRegisteredUnderTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersUpdateSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersUpdateSample.js new file mode 100644 index 000000000000..f073724b900d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/replicationvCentersUpdateSample.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to The operation to update a registered vCenter. + * + * @summary The operation to update a registered vCenter. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Update.json + */ +async function updateVCenterOperation() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const updateVCenterRequest = { + properties: { ipAddress: "10.150.109.25" }, + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + vcenterName, + updateVCenterRequest + ); + console.log(result); +} + +updateVCenterOperation().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/sample.env b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/supportedOperatingSystemsGetSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/supportedOperatingSystemsGetSample.js new file mode 100644 index 000000000000..fd6832a7f83d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/supportedOperatingSystemsGetSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the data of supported operating systems by SRS. + * + * @summary Gets the data of supported operating systems by SRS. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/SupportedOperatingSystems_Get.json + */ +async function getsTheDataOfSupportedOperatingSystemsBySrs() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.supportedOperatingSystemsOperations.get( + resourceName, + resourceGroupName + ); + console.log(result); +} + +getsTheDataOfSupportedOperatingSystemsBySrs().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/targetComputeSizesListByReplicationProtectedItemsSample.js b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/targetComputeSizesListByReplicationProtectedItemsSample.js new file mode 100644 index 000000000000..50a9b4414327 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/javascript/targetComputeSizesListByReplicationProtectedItemsSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { SiteRecoveryManagementClient } = require("@azure/arm-recoveryservices-siterecovery"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the available target compute sizes for a replication protected item. + * + * @summary Lists the available target compute sizes for a replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json + */ +async function getsTheListOfTargetComputeSizesForTheReplicationProtectedItem() { + const subscriptionId = "6808dbbc-98c7-431f-a1b1-9580902423b7"; + const resourceName = "avraiMgDiskVault"; + const resourceGroupName = "avraiMgDiskVaultRG"; + const fabricName = "asr-a2a-default-centraluseuap"; + const protectionContainerName = "asr-a2a-default-centraluseuap-container"; + const replicatedProtectedItemName = "468c912d-b1ab-4ea2-97eb-4b5095155db2"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.targetComputeSizes.listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfTargetComputeSizesForTheReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/README.md b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/README.md new file mode 100644 index 000000000000..aedb21d50629 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/README.md @@ -0,0 +1,335 @@ +# client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [migrationRecoveryPointsGetSample.ts][migrationrecoverypointsgetsample] | Gets a recovery point for a migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_Get.json | +| [migrationRecoveryPointsListByReplicationMigrationItemsSample.ts][migrationrecoverypointslistbyreplicationmigrationitemssample] | Gets the recovery points for a migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json | +| [operationsListSample.ts][operationslistsample] | Operation to return the list of available operations. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/Operations_List.json | +| [recoveryPointsGetSample.ts][recoverypointsgetsample] | Get the details of specified recovery point. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_Get.json | +| [recoveryPointsListByReplicationProtectedItemsSample.ts][recoverypointslistbyreplicationprotecteditemssample] | Lists the available recovery points for a replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json | +| [replicationAlertSettingsCreateSample.ts][replicationalertsettingscreatesample] | Create or update an email notification(alert) configuration. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Create.json | +| [replicationAlertSettingsGetSample.ts][replicationalertsettingsgetsample] | Gets the details of the specified email notification(alert) configuration. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Get.json | +| [replicationAlertSettingsListSample.ts][replicationalertsettingslistsample] | Gets the list of email notification(alert) configurations for the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_List.json | +| [replicationAppliancesListSample.ts][replicationapplianceslistsample] | Gets the list of Azure Site Recovery appliances for the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAppliances_List.json | +| [replicationEligibilityResultsGetSample.ts][replicationeligibilityresultsgetsample] | Validates whether a given VM can be protected or not in which case returns list of errors. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_Get.json | +| [replicationEligibilityResultsListSample.ts][replicationeligibilityresultslistsample] | Validates whether a given VM can be protected or not in which case returns list of errors. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_List.json | +| [replicationEventsGetSample.ts][replicationeventsgetsample] | The operation to get the details of an Azure Site recovery event. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_Get.json | +| [replicationEventsListSample.ts][replicationeventslistsample] | Gets the list of Azure Site Recovery events for the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_List.json | +| [replicationFabricsCheckConsistencySample.ts][replicationfabricscheckconsistencysample] | The operation to perform a consistency check on the fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_CheckConsistency.json | +| [replicationFabricsCreateSample.ts][replicationfabricscreatesample] | The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Create.json | +| [replicationFabricsDeleteSample.ts][replicationfabricsdeletesample] | The operation to delete or remove an Azure Site Recovery fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Delete.json | +| [replicationFabricsGetSample.ts][replicationfabricsgetsample] | Gets the details of an Azure Site Recovery fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Get.json | +| [replicationFabricsListSample.ts][replicationfabricslistsample] | Gets a list of the Azure Site Recovery fabrics in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_List.json | +| [replicationFabricsMigrateToAadSample.ts][replicationfabricsmigratetoaadsample] | The operation to migrate an Azure Site Recovery fabric to AAD. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_MigrateToAad.json | +| [replicationFabricsPurgeSample.ts][replicationfabricspurgesample] | The operation to purge(force delete) an Azure Site Recovery fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Purge.json | +| [replicationFabricsReassociateGatewaySample.ts][replicationfabricsreassociategatewaysample] | The operation to move replications from a process server to another process server. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_ReassociateGateway.json | +| [replicationFabricsRenewCertificateSample.ts][replicationfabricsrenewcertificatesample] | Renews the connection certificate for the ASR replication fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_RenewCertificate.json | +| [replicationJobsCancelSample.ts][replicationjobscancelsample] | The operation to cancel an Azure Site Recovery job. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Cancel.json | +| [replicationJobsExportSample.ts][replicationjobsexportsample] | The operation to export the details of the Azure Site Recovery jobs of the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Export.json | +| [replicationJobsGetSample.ts][replicationjobsgetsample] | Get the details of an Azure Site Recovery job. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Get.json | +| [replicationJobsListSample.ts][replicationjobslistsample] | Gets the list of Azure Site Recovery Jobs for the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_List.json | +| [replicationJobsRestartSample.ts][replicationjobsrestartsample] | The operation to restart an Azure Site Recovery job. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Restart.json | +| [replicationJobsResumeSample.ts][replicationjobsresumesample] | The operation to resume an Azure Site Recovery job. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Resume.json | +| [replicationLogicalNetworksGetSample.ts][replicationlogicalnetworksgetsample] | Gets the details of a logical network. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_Get.json | +| [replicationLogicalNetworksListByReplicationFabricsSample.ts][replicationlogicalnetworkslistbyreplicationfabricssample] | Lists all the logical networks of the Azure Site Recovery fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json | +| [replicationMigrationItemsCreateSample.ts][replicationmigrationitemscreatesample] | The operation to create an ASR migration item (enable migration). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Create.json | +| [replicationMigrationItemsDeleteSample.ts][replicationmigrationitemsdeletesample] | The operation to delete an ASR migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Delete.json | +| [replicationMigrationItemsGetSample.ts][replicationmigrationitemsgetsample] | Gets the details of a migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Get.json | +| [replicationMigrationItemsListByReplicationProtectionContainersSample.ts][replicationmigrationitemslistbyreplicationprotectioncontainerssample] | Gets the list of ASR migration items in the protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json | +| [replicationMigrationItemsListSample.ts][replicationmigrationitemslistsample] | Gets the list of migration items in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_List.json | +| [replicationMigrationItemsMigrateSample.ts][replicationmigrationitemsmigratesample] | The operation to initiate migration of the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Migrate.json | +| [replicationMigrationItemsPauseReplicationSample.ts][replicationmigrationitemspausereplicationsample] | The operation to initiate pause replication of the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_PauseReplication.json | +| [replicationMigrationItemsResumeReplicationSample.ts][replicationmigrationitemsresumereplicationsample] | The operation to initiate resume replication of the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ResumeReplication.json | +| [replicationMigrationItemsResyncSample.ts][replicationmigrationitemsresyncsample] | The operation to resynchronize replication of an ASR migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Resync.json | +| [replicationMigrationItemsTestMigrateCleanupSample.ts][replicationmigrationitemstestmigratecleanupsample] | The operation to initiate test migrate cleanup. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json | +| [replicationMigrationItemsTestMigrateSample.ts][replicationmigrationitemstestmigratesample] | The operation to initiate test migration of the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrate.json | +| [replicationMigrationItemsUpdateSample.ts][replicationmigrationitemsupdatesample] | The operation to update the recovery settings of an ASR migration item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Update.json | +| [replicationNetworkMappingsCreateSample.ts][replicationnetworkmappingscreatesample] | The operation to create an ASR network mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Create.json | +| [replicationNetworkMappingsDeleteSample.ts][replicationnetworkmappingsdeletesample] | The operation to delete a network mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Delete.json | +| [replicationNetworkMappingsGetSample.ts][replicationnetworkmappingsgetsample] | Gets the details of an ASR network mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Get.json | +| [replicationNetworkMappingsListByReplicationNetworksSample.ts][replicationnetworkmappingslistbyreplicationnetworkssample] | Lists all ASR network mappings for the specified network. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json | +| [replicationNetworkMappingsListSample.ts][replicationnetworkmappingslistsample] | Lists all ASR network mappings in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_List.json | +| [replicationNetworkMappingsUpdateSample.ts][replicationnetworkmappingsupdatesample] | The operation to update an ASR network mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Update.json | +| [replicationNetworksGetSample.ts][replicationnetworksgetsample] | Gets the details of a network. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_Get.json | +| [replicationNetworksListByReplicationFabricsSample.ts][replicationnetworkslistbyreplicationfabricssample] | Lists the networks available for a fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_ListByReplicationFabrics.json | +| [replicationNetworksListSample.ts][replicationnetworkslistsample] | Lists the networks available in a vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_List.json | +| [replicationPoliciesCreateSample.ts][replicationpoliciescreatesample] | The operation to create a replication policy. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Create.json | +| [replicationPoliciesDeleteSample.ts][replicationpoliciesdeletesample] | The operation to delete a replication policy. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Delete.json | +| [replicationPoliciesGetSample.ts][replicationpoliciesgetsample] | Gets the details of a replication policy. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Get.json | +| [replicationPoliciesListSample.ts][replicationpolicieslistsample] | Lists the replication policies for a vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_List.json | +| [replicationPoliciesUpdateSample.ts][replicationpoliciesupdatesample] | The operation to update a replication policy. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Update.json | +| [replicationProtectableItemsGetSample.ts][replicationprotectableitemsgetsample] | The operation to get the details of a protectable item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_Get.json | +| [replicationProtectableItemsListByReplicationProtectionContainersSample.ts][replicationprotectableitemslistbyreplicationprotectioncontainerssample] | Lists the protectable items in a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json | +| [replicationProtectedItemsAddDisksSample.ts][replicationprotecteditemsadddiskssample] | Operation to add disks(s) to the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_AddDisks.json | +| [replicationProtectedItemsApplyRecoveryPointSample.ts][replicationprotecteditemsapplyrecoverypointsample] | The operation to change the recovery point of a failed over replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json | +| [replicationProtectedItemsCreateSample.ts][replicationprotecteditemscreatesample] | The operation to create an ASR replication protected item (Enable replication). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Create.json | +| [replicationProtectedItemsDeleteSample.ts][replicationprotecteditemsdeletesample] | The operation to disable replication on a replication protected item. This will also remove the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Delete.json | +| [replicationProtectedItemsFailoverCancelSample.ts][replicationprotecteditemsfailovercancelsample] | Operation to cancel the failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCancel.json | +| [replicationProtectedItemsFailoverCommitSample.ts][replicationprotecteditemsfailovercommitsample] | Operation to commit the failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCommit.json | +| [replicationProtectedItemsGetSample.ts][replicationprotecteditemsgetsample] | Gets the details of an ASR replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Get.json | +| [replicationProtectedItemsListByReplicationProtectionContainersSample.ts][replicationprotecteditemslistbyreplicationprotectioncontainerssample] | Gets the list of ASR replication protected items in the protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json | +| [replicationProtectedItemsListSample.ts][replicationprotecteditemslistsample] | Gets the list of ASR replication protected items in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_List.json | +| [replicationProtectedItemsPlannedFailoverSample.ts][replicationprotecteditemsplannedfailoversample] | Operation to initiate a planned failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_PlannedFailover.json | +| [replicationProtectedItemsPurgeSample.ts][replicationprotecteditemspurgesample] | The operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Purge.json | +| [replicationProtectedItemsRemoveDisksSample.ts][replicationprotecteditemsremovediskssample] | Operation to remove disk(s) from the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RemoveDisks.json | +| [replicationProtectedItemsRepairReplicationSample.ts][replicationprotecteditemsrepairreplicationsample] | The operation to start resynchronize/repair replication for a replication protected item requiring resynchronization. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RepairReplication.json | +| [replicationProtectedItemsReprotectSample.ts][replicationprotecteditemsreprotectsample] | Operation to reprotect or reverse replicate a failed over replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Reprotect.json | +| [replicationProtectedItemsResolveHealthErrorsSample.ts][replicationprotecteditemsresolvehealtherrorssample] | Operation to resolve health issues of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json | +| [replicationProtectedItemsSwitchProviderSample.ts][replicationprotecteditemsswitchprovidersample] | Operation to initiate a switch provider of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_SwitchProvider.json | +| [replicationProtectedItemsTestFailoverCleanupSample.ts][replicationprotecteditemstestfailovercleanupsample] | Operation to clean up the test failover of a replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json | +| [replicationProtectedItemsTestFailoverSample.ts][replicationprotecteditemstestfailoversample] | Operation to perform a test failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailover.json | +| [replicationProtectedItemsUnplannedFailoverSample.ts][replicationprotecteditemsunplannedfailoversample] | Operation to initiate a failover of the replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UnplannedFailover.json | +| [replicationProtectedItemsUpdateApplianceSample.ts][replicationprotecteditemsupdateappliancesample] | The operation to update appliance of an ASR replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateAppliance.json | +| [replicationProtectedItemsUpdateMobilityServiceSample.ts][replicationprotecteditemsupdatemobilityservicesample] | The operation to update(push update) the installed mobility service software on a replication protected item to the latest available version. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateMobilityService.json | +| [replicationProtectedItemsUpdateSample.ts][replicationprotecteditemsupdatesample] | The operation to update the recovery settings of an ASR replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Update.json | +| [replicationProtectionContainerMappingsCreateSample.ts][replicationprotectioncontainermappingscreatesample] | The operation to create a protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Create.json | +| [replicationProtectionContainerMappingsDeleteSample.ts][replicationprotectioncontainermappingsdeletesample] | The operation to delete or remove a protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Delete.json | +| [replicationProtectionContainerMappingsGetSample.ts][replicationprotectioncontainermappingsgetsample] | Gets the details of a protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Get.json | +| [replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.ts][replicationprotectioncontainermappingslistbyreplicationprotectioncontainerssample] | Lists the protection container mappings for a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json | +| [replicationProtectionContainerMappingsListSample.ts][replicationprotectioncontainermappingslistsample] | Lists the protection container mappings in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_List.json | +| [replicationProtectionContainerMappingsPurgeSample.ts][replicationprotectioncontainermappingspurgesample] | The operation to purge(force delete) a protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Purge.json | +| [replicationProtectionContainerMappingsUpdateSample.ts][replicationprotectioncontainermappingsupdatesample] | The operation to update protection container mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Update.json | +| [replicationProtectionContainersCreateSample.ts][replicationprotectioncontainerscreatesample] | Operation to create a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Create.json | +| [replicationProtectionContainersDeleteSample.ts][replicationprotectioncontainersdeletesample] | Operation to remove a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Delete.json | +| [replicationProtectionContainersDiscoverProtectableItemSample.ts][replicationprotectioncontainersdiscoverprotectableitemsample] | The operation to a add a protectable item to a protection container(Add physical server). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json | +| [replicationProtectionContainersGetSample.ts][replicationprotectioncontainersgetsample] | Gets the details of a protection container. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Get.json | +| [replicationProtectionContainersListByReplicationFabricsSample.ts][replicationprotectioncontainerslistbyreplicationfabricssample] | Lists the protection containers in the specified fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json | +| [replicationProtectionContainersListSample.ts][replicationprotectioncontainerslistsample] | Lists the protection containers in a vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_List.json | +| [replicationProtectionContainersSwitchProtectionSample.ts][replicationprotectioncontainersswitchprotectionsample] | Operation to switch protection from one container to another or one replication provider to another. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_SwitchProtection.json | +| [replicationProtectionIntentsCreateSample.ts][replicationprotectionintentscreatesample] | The operation to create an ASR replication protection intent item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Create.json | +| [replicationProtectionIntentsGetSample.ts][replicationprotectionintentsgetsample] | Gets the details of an ASR replication protection intent. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Get.json | +| [replicationProtectionIntentsListSample.ts][replicationprotectionintentslistsample] | Gets the list of ASR replication protection intent objects in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_List.json | +| [replicationRecoveryPlansCreateSample.ts][replicationrecoveryplanscreatesample] | The operation to create a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Create.json | +| [replicationRecoveryPlansDeleteSample.ts][replicationrecoveryplansdeletesample] | Delete a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Delete.json | +| [replicationRecoveryPlansFailoverCancelSample.ts][replicationrecoveryplansfailovercancelsample] | The operation to cancel the failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCancel.json | +| [replicationRecoveryPlansFailoverCommitSample.ts][replicationrecoveryplansfailovercommitsample] | The operation to commit the failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCommit.json | +| [replicationRecoveryPlansGetSample.ts][replicationrecoveryplansgetsample] | Gets the details of the recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Get.json | +| [replicationRecoveryPlansListSample.ts][replicationrecoveryplanslistsample] | Lists the recovery plans in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_List.json | +| [replicationRecoveryPlansPlannedFailoverSample.ts][replicationrecoveryplansplannedfailoversample] | The operation to start the planned failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_PlannedFailover.json | +| [replicationRecoveryPlansReprotectSample.ts][replicationrecoveryplansreprotectsample] | The operation to reprotect(reverse replicate) a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Reprotect.json | +| [replicationRecoveryPlansTestFailoverCleanupSample.ts][replicationrecoveryplanstestfailovercleanupsample] | The operation to cleanup test failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json | +| [replicationRecoveryPlansTestFailoverSample.ts][replicationrecoveryplanstestfailoversample] | The operation to start the test failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailover.json | +| [replicationRecoveryPlansUnplannedFailoverSample.ts][replicationrecoveryplansunplannedfailoversample] | The operation to start the unplanned failover of a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json | +| [replicationRecoveryPlansUpdateSample.ts][replicationrecoveryplansupdatesample] | The operation to update a recovery plan. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Update.json | +| [replicationRecoveryServicesProvidersCreateSample.ts][replicationrecoveryservicesproviderscreatesample] | The operation to add a recovery services provider. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Create.json | +| [replicationRecoveryServicesProvidersDeleteSample.ts][replicationrecoveryservicesprovidersdeletesample] | The operation to removes/delete(unregister) a recovery services provider from the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Delete.json | +| [replicationRecoveryServicesProvidersGetSample.ts][replicationrecoveryservicesprovidersgetsample] | Gets the details of registered recovery services provider. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Get.json | +| [replicationRecoveryServicesProvidersListByReplicationFabricsSample.ts][replicationrecoveryservicesproviderslistbyreplicationfabricssample] | Lists the registered recovery services providers for the specified fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json | +| [replicationRecoveryServicesProvidersListSample.ts][replicationrecoveryservicesproviderslistsample] | Lists the registered recovery services providers in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_List.json | +| [replicationRecoveryServicesProvidersPurgeSample.ts][replicationrecoveryservicesproviderspurgesample] | The operation to purge(force delete) a recovery services provider from the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Purge.json | +| [replicationRecoveryServicesProvidersRefreshProviderSample.ts][replicationrecoveryservicesprovidersrefreshprovidersample] | The operation to refresh the information from the recovery services provider. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json | +| [replicationStorageClassificationMappingsCreateSample.ts][replicationstorageclassificationmappingscreatesample] | The operation to create a storage classification mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Create.json | +| [replicationStorageClassificationMappingsDeleteSample.ts][replicationstorageclassificationmappingsdeletesample] | The operation to delete a storage classification mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Delete.json | +| [replicationStorageClassificationMappingsGetSample.ts][replicationstorageclassificationmappingsgetsample] | Gets the details of the specified storage classification mapping. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Get.json | +| [replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.ts][replicationstorageclassificationmappingslistbyreplicationstorageclassificationssample] | Lists the storage classification mappings for the fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json | +| [replicationStorageClassificationMappingsListSample.ts][replicationstorageclassificationmappingslistsample] | Lists the storage classification mappings in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_List.json | +| [replicationStorageClassificationsGetSample.ts][replicationstorageclassificationsgetsample] | Gets the details of the specified storage classification. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_Get.json | +| [replicationStorageClassificationsListByReplicationFabricsSample.ts][replicationstorageclassificationslistbyreplicationfabricssample] | Lists the storage classifications available in the specified fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json | +| [replicationStorageClassificationsListSample.ts][replicationstorageclassificationslistsample] | Lists the storage classifications in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_List.json | +| [replicationVaultHealthGetSample.ts][replicationvaulthealthgetsample] | Gets the health details of the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Get.json | +| [replicationVaultHealthRefreshSample.ts][replicationvaulthealthrefreshsample] | Refreshes health summary of the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Refresh.json | +| [replicationVaultSettingCreateSample.ts][replicationvaultsettingcreatesample] | The operation to configure vault setting. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Create.json | +| [replicationVaultSettingGetSample.ts][replicationvaultsettinggetsample] | Gets the vault setting. This includes the Migration Hub connection settings. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Get.json | +| [replicationVaultSettingListSample.ts][replicationvaultsettinglistsample] | Gets the list of vault setting. This includes the Migration Hub connection settings. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_List.json | +| [replicationvCentersCreateSample.ts][replicationvcenterscreatesample] | The operation to create a vCenter object.. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Create.json | +| [replicationvCentersDeleteSample.ts][replicationvcentersdeletesample] | The operation to remove(unregister) a registered vCenter server from the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Delete.json | +| [replicationvCentersGetSample.ts][replicationvcentersgetsample] | Gets the details of a registered vCenter server(Add vCenter server). x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Get.json | +| [replicationvCentersListByReplicationFabricsSample.ts][replicationvcenterslistbyreplicationfabricssample] | Lists the vCenter servers registered in a fabric. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_ListByReplicationFabrics.json | +| [replicationvCentersListSample.ts][replicationvcenterslistsample] | Lists the vCenter servers registered in the vault. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_List.json | +| [replicationvCentersUpdateSample.ts][replicationvcentersupdatesample] | The operation to update a registered vCenter. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Update.json | +| [supportedOperatingSystemsGetSample.ts][supportedoperatingsystemsgetsample] | Gets the data of supported operating systems by SRS. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/SupportedOperatingSystems_Get.json | +| [targetComputeSizesListByReplicationProtectedItemsSample.ts][targetcomputesizeslistbyreplicationprotecteditemssample] | Lists the available target compute sizes for a replication protected item. x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/migrationRecoveryPointsGetSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/migrationRecoveryPointsGetSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[migrationrecoverypointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/migrationRecoveryPointsGetSample.ts +[migrationrecoverypointslistbyreplicationmigrationitemssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/migrationRecoveryPointsListByReplicationMigrationItemsSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/operationsListSample.ts +[recoverypointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/recoveryPointsGetSample.ts +[recoverypointslistbyreplicationprotecteditemssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/recoveryPointsListByReplicationProtectedItemsSample.ts +[replicationalertsettingscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsCreateSample.ts +[replicationalertsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsGetSample.ts +[replicationalertsettingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsListSample.ts +[replicationapplianceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAppliancesListSample.ts +[replicationeligibilityresultsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEligibilityResultsGetSample.ts +[replicationeligibilityresultslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEligibilityResultsListSample.ts +[replicationeventsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEventsGetSample.ts +[replicationeventslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEventsListSample.ts +[replicationfabricscheckconsistencysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsCheckConsistencySample.ts +[replicationfabricscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsCreateSample.ts +[replicationfabricsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsDeleteSample.ts +[replicationfabricsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsGetSample.ts +[replicationfabricslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsListSample.ts +[replicationfabricsmigratetoaadsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsMigrateToAadSample.ts +[replicationfabricspurgesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsPurgeSample.ts +[replicationfabricsreassociategatewaysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsReassociateGatewaySample.ts +[replicationfabricsrenewcertificatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsRenewCertificateSample.ts +[replicationjobscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsCancelSample.ts +[replicationjobsexportsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsExportSample.ts +[replicationjobsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsGetSample.ts +[replicationjobslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsListSample.ts +[replicationjobsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsRestartSample.ts +[replicationjobsresumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsResumeSample.ts +[replicationlogicalnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationLogicalNetworksGetSample.ts +[replicationlogicalnetworkslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationLogicalNetworksListByReplicationFabricsSample.ts +[replicationmigrationitemscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsCreateSample.ts +[replicationmigrationitemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsDeleteSample.ts +[replicationmigrationitemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsGetSample.ts +[replicationmigrationitemslistbyreplicationprotectioncontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsListByReplicationProtectionContainersSample.ts +[replicationmigrationitemslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsListSample.ts +[replicationmigrationitemsmigratesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsMigrateSample.ts +[replicationmigrationitemspausereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsPauseReplicationSample.ts +[replicationmigrationitemsresumereplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsResumeReplicationSample.ts +[replicationmigrationitemsresyncsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsResyncSample.ts +[replicationmigrationitemstestmigratecleanupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsTestMigrateCleanupSample.ts +[replicationmigrationitemstestmigratesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsTestMigrateSample.ts +[replicationmigrationitemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsUpdateSample.ts +[replicationnetworkmappingscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsCreateSample.ts +[replicationnetworkmappingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsDeleteSample.ts +[replicationnetworkmappingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsGetSample.ts +[replicationnetworkmappingslistbyreplicationnetworkssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsListByReplicationNetworksSample.ts +[replicationnetworkmappingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsListSample.ts +[replicationnetworkmappingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsUpdateSample.ts +[replicationnetworksgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksGetSample.ts +[replicationnetworkslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksListByReplicationFabricsSample.ts +[replicationnetworkslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksListSample.ts +[replicationpoliciescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesCreateSample.ts +[replicationpoliciesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesDeleteSample.ts +[replicationpoliciesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesGetSample.ts +[replicationpolicieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesListSample.ts +[replicationpoliciesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesUpdateSample.ts +[replicationprotectableitemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectableItemsGetSample.ts +[replicationprotectableitemslistbyreplicationprotectioncontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectableItemsListByReplicationProtectionContainersSample.ts +[replicationprotecteditemsadddiskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsAddDisksSample.ts +[replicationprotecteditemsapplyrecoverypointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsApplyRecoveryPointSample.ts +[replicationprotecteditemscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsCreateSample.ts +[replicationprotecteditemsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsDeleteSample.ts +[replicationprotecteditemsfailovercancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsFailoverCancelSample.ts +[replicationprotecteditemsfailovercommitsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsFailoverCommitSample.ts +[replicationprotecteditemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsGetSample.ts +[replicationprotecteditemslistbyreplicationprotectioncontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsListByReplicationProtectionContainersSample.ts +[replicationprotecteditemslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsListSample.ts +[replicationprotecteditemsplannedfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsPlannedFailoverSample.ts +[replicationprotecteditemspurgesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsPurgeSample.ts +[replicationprotecteditemsremovediskssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsRemoveDisksSample.ts +[replicationprotecteditemsrepairreplicationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsRepairReplicationSample.ts +[replicationprotecteditemsreprotectsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsReprotectSample.ts +[replicationprotecteditemsresolvehealtherrorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsResolveHealthErrorsSample.ts +[replicationprotecteditemsswitchprovidersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsSwitchProviderSample.ts +[replicationprotecteditemstestfailovercleanupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsTestFailoverCleanupSample.ts +[replicationprotecteditemstestfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsTestFailoverSample.ts +[replicationprotecteditemsunplannedfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUnplannedFailoverSample.ts +[replicationprotecteditemsupdateappliancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateApplianceSample.ts +[replicationprotecteditemsupdatemobilityservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateMobilityServiceSample.ts +[replicationprotecteditemsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateSample.ts +[replicationprotectioncontainermappingscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsCreateSample.ts +[replicationprotectioncontainermappingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsDeleteSample.ts +[replicationprotectioncontainermappingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsGetSample.ts +[replicationprotectioncontainermappingslistbyreplicationprotectioncontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.ts +[replicationprotectioncontainermappingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsListSample.ts +[replicationprotectioncontainermappingspurgesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsPurgeSample.ts +[replicationprotectioncontainermappingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsUpdateSample.ts +[replicationprotectioncontainerscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersCreateSample.ts +[replicationprotectioncontainersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersDeleteSample.ts +[replicationprotectioncontainersdiscoverprotectableitemsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersDiscoverProtectableItemSample.ts +[replicationprotectioncontainersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersGetSample.ts +[replicationprotectioncontainerslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersListByReplicationFabricsSample.ts +[replicationprotectioncontainerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersListSample.ts +[replicationprotectioncontainersswitchprotectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersSwitchProtectionSample.ts +[replicationprotectionintentscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsCreateSample.ts +[replicationprotectionintentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsGetSample.ts +[replicationprotectionintentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsListSample.ts +[replicationrecoveryplanscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansCreateSample.ts +[replicationrecoveryplansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansDeleteSample.ts +[replicationrecoveryplansfailovercancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansFailoverCancelSample.ts +[replicationrecoveryplansfailovercommitsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansFailoverCommitSample.ts +[replicationrecoveryplansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansGetSample.ts +[replicationrecoveryplanslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansListSample.ts +[replicationrecoveryplansplannedfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansPlannedFailoverSample.ts +[replicationrecoveryplansreprotectsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansReprotectSample.ts +[replicationrecoveryplanstestfailovercleanupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansTestFailoverCleanupSample.ts +[replicationrecoveryplanstestfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansTestFailoverSample.ts +[replicationrecoveryplansunplannedfailoversample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansUnplannedFailoverSample.ts +[replicationrecoveryplansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansUpdateSample.ts +[replicationrecoveryservicesproviderscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersCreateSample.ts +[replicationrecoveryservicesprovidersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersDeleteSample.ts +[replicationrecoveryservicesprovidersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersGetSample.ts +[replicationrecoveryservicesproviderslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersListByReplicationFabricsSample.ts +[replicationrecoveryservicesproviderslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersListSample.ts +[replicationrecoveryservicesproviderspurgesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersPurgeSample.ts +[replicationrecoveryservicesprovidersrefreshprovidersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersRefreshProviderSample.ts +[replicationstorageclassificationmappingscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsCreateSample.ts +[replicationstorageclassificationmappingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsDeleteSample.ts +[replicationstorageclassificationmappingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsGetSample.ts +[replicationstorageclassificationmappingslistbyreplicationstorageclassificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.ts +[replicationstorageclassificationmappingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsListSample.ts +[replicationstorageclassificationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsGetSample.ts +[replicationstorageclassificationslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsListByReplicationFabricsSample.ts +[replicationstorageclassificationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsListSample.ts +[replicationvaulthealthgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultHealthGetSample.ts +[replicationvaulthealthrefreshsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultHealthRefreshSample.ts +[replicationvaultsettingcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingCreateSample.ts +[replicationvaultsettinggetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingGetSample.ts +[replicationvaultsettinglistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingListSample.ts +[replicationvcenterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersCreateSample.ts +[replicationvcentersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersDeleteSample.ts +[replicationvcentersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersGetSample.ts +[replicationvcenterslistbyreplicationfabricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersListByReplicationFabricsSample.ts +[replicationvcenterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersListSample.ts +[replicationvcentersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersUpdateSample.ts +[supportedoperatingsystemsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/supportedOperatingSystemsGetSample.ts +[targetcomputesizeslistbyreplicationprotecteditemssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/targetComputeSizesListByReplicationProtectedItemsSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-recoveryservices-siterecovery?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/package.json b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/package.json new file mode 100644 index 000000000000..1270f3a926dc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-recoveryservices-siterecovery-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "engines": { + "node": ">=14.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery", + "dependencies": { + "@azure/arm-recoveryservices-siterecovery": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^14.0.0", + "typescript": "~4.8.0", + "rimraf": "latest" + } +} diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/sample.env b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/migrationRecoveryPointsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/migrationRecoveryPointsGetSample.ts new file mode 100644 index 000000000000..08c7d223a0e6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/migrationRecoveryPointsGetSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a recovery point for a migration item. + * + * @summary Gets a recovery point for a migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_Get.json + */ +async function getsARecoveryPointForAMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const migrationRecoveryPointName = "b22134ea-620c-474b-9fa5-3c1cb47708e3"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.migrationRecoveryPoints.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrationRecoveryPointName + ); + console.log(result); +} + +getsARecoveryPointForAMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/migrationRecoveryPointsListByReplicationMigrationItemsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/migrationRecoveryPointsListByReplicationMigrationItemsSample.ts new file mode 100644 index 000000000000..0bcfd015ef62 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/migrationRecoveryPointsListByReplicationMigrationItemsSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the recovery points for a migration item. + * + * @summary Gets the recovery points for a migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json + */ +async function getsTheRecoveryPointsForAMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.migrationRecoveryPoints.listByReplicationMigrationItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheRecoveryPointsForAMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/operationsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..aa20be50077d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/operationsListSample.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to return the list of available operations. + * + * @summary Operation to return the list of available operations. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/Operations_List.json + */ +async function returnsTheListOfAvailableOperations() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +returnsTheListOfAvailableOperations().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/recoveryPointsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/recoveryPointsGetSample.ts new file mode 100644 index 000000000000..387807a76066 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/recoveryPointsGetSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the details of specified recovery point. + * + * @summary Get the details of specified recovery point. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_Get.json + */ +async function getsARecoveryPoint() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const recoveryPointName = "b22134ea-620c-474b-9fa5-3c1cb47708e3"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.recoveryPoints.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + recoveryPointName + ); + console.log(result); +} + +getsARecoveryPoint().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/recoveryPointsListByReplicationProtectedItemsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/recoveryPointsListByReplicationProtectedItemsSample.ts new file mode 100644 index 000000000000..bf9dc205a3af --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/recoveryPointsListByReplicationProtectedItemsSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the available recovery points for a replication protected item. + * + * @summary Lists the available recovery points for a replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json + */ +async function getsTheListOfRecoveryPointsForAReplicationProtectedItem() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.recoveryPoints.listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRecoveryPointsForAReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsCreateSample.ts new file mode 100644 index 000000000000..f54f4a57870a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsCreateSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigureAlertRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update an email notification(alert) configuration. + * + * @summary Create or update an email notification(alert) configuration. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Create.json + */ +async function configuresEmailNotificationsForThisVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const alertSettingName = "defaultAlertSetting"; + const request: ConfigureAlertRequest = { + properties: { + customEmailAddresses: ["ronehr@microsoft.com"], + locale: "", + sendToOwners: "false" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationAlertSettings.create( + resourceName, + resourceGroupName, + alertSettingName, + request + ); + console.log(result); +} + +configuresEmailNotificationsForThisVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsGetSample.ts new file mode 100644 index 000000000000..93efd383a375 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of the specified email notification(alert) configuration. + * + * @summary Gets the details of the specified email notification(alert) configuration. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_Get.json + */ +async function getsAnEmailNotificationAlertConfiguration() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const alertSettingName = "defaultAlertSetting"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationAlertSettings.get( + resourceName, + resourceGroupName, + alertSettingName + ); + console.log(result); +} + +getsAnEmailNotificationAlertConfiguration().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsListSample.ts new file mode 100644 index 000000000000..0c8755d33eb7 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAlertSettingsListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of email notification(alert) configurations for the vault. + * + * @summary Gets the list of email notification(alert) configurations for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAlertSettings_List.json + */ +async function getsTheListOfConfiguredEmailNotificationAlertConfigurations() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationAlertSettings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfConfiguredEmailNotificationAlertConfigurations().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAppliancesListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAppliancesListSample.ts new file mode 100644 index 000000000000..63bb4497c846 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationAppliancesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Azure Site Recovery appliances for the vault. + * + * @summary Gets the list of Azure Site Recovery appliances for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationAppliances_List.json + */ +async function getsTheListOfAppliances() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationAppliances.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAppliances().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEligibilityResultsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEligibilityResultsGetSample.ts new file mode 100644 index 000000000000..0a4ba3e8e6c6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEligibilityResultsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @summary Validates whether a given VM can be protected or not in which case returns list of errors. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_Get.json + */ +async function getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { + const subscriptionId = "d90d145a-4cdd-45a3-b2c4-971d69775278"; + const resourceGroupName = "testRg1"; + const virtualMachineName = "testVm1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationEligibilityResultsOperations.get( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEligibilityResultsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEligibilityResultsListSample.ts new file mode 100644 index 000000000000..8cf5089bc148 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEligibilityResultsListSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Validates whether a given VM can be protected or not in which case returns list of errors. + * + * @summary Validates whether a given VM can be protected or not in which case returns list of errors. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEligibilityResults_List.json + */ +async function getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { + const subscriptionId = "d90d145a-4cdd-45a3-b2c4-971d69775278"; + const resourceGroupName = "testRg1"; + const virtualMachineName = "testVm2"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationEligibilityResultsOperations.list( + resourceGroupName, + virtualMachineName + ); + console.log(result); +} + +getsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEventsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEventsGetSample.ts new file mode 100644 index 000000000000..81f8f010b271 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEventsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the details of an Azure Site recovery event. + * + * @summary The operation to get the details of an Azure Site recovery event. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_Get.json + */ +async function getTheDetailsOfAnAzureSiteRecoveryEvent() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const eventName = "654b71d0-b2ce-4e6e-a861-98528d4bd375"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationEvents.get( + resourceName, + resourceGroupName, + eventName + ); + console.log(result); +} + +getTheDetailsOfAnAzureSiteRecoveryEvent().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEventsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEventsListSample.ts new file mode 100644 index 000000000000..1ba3347edf77 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationEventsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Azure Site Recovery events for the vault. + * + * @summary Gets the list of Azure Site Recovery events for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationEvents_List.json + */ +async function getsTheListOfAzureSiteRecoveryEvents() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationEvents.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAzureSiteRecoveryEvents().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsCheckConsistencySample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsCheckConsistencySample.ts new file mode 100644 index 000000000000..4282b4608046 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsCheckConsistencySample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to perform a consistency check on the fabric. + * + * @summary The operation to perform a consistency check on the fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_CheckConsistency.json + */ +async function checksTheConsistencyOfTheAsrFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginCheckConsistencyAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +checksTheConsistencyOfTheAsrFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsCreateSample.ts new file mode 100644 index 000000000000..7386ebcb7e43 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsCreateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + FabricCreationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * + * @summary The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Create.json + */ +async function createsAnAzureSiteRecoveryFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const input: FabricCreationInput = { + properties: { + customDetails: { instanceType: "VMwareV2" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + input + ); + console.log(result); +} + +createsAnAzureSiteRecoveryFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsDeleteSample.ts new file mode 100644 index 000000000000..6e71e455f843 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete or remove an Azure Site Recovery fabric. + * + * @summary The operation to delete or remove an Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Delete.json + */ +async function deletesTheSite() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +deletesTheSite().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsGetSample.ts new file mode 100644 index 000000000000..dcfde5f91f20 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of an Azure Site Recovery fabric. + * + * @summary Gets the details of an Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Get.json + */ +async function getsTheDetailsOfAnAsrFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.get( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +getsTheDetailsOfAnAsrFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsListSample.ts new file mode 100644 index 000000000000..f41f5fdd057e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of the Azure Site Recovery fabrics in the vault. + * + * @summary Gets a list of the Azure Site Recovery fabrics in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_List.json + */ +async function getsTheListOfAsrFabrics() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationFabrics.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAsrFabrics().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsMigrateToAadSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsMigrateToAadSample.ts new file mode 100644 index 000000000000..8ed02f892785 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsMigrateToAadSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to migrate an Azure Site Recovery fabric to AAD. + * + * @summary The operation to migrate an Azure Site Recovery fabric to AAD. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_MigrateToAad.json + */ +async function migratesTheSiteToAad() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginMigrateToAadAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +migratesTheSiteToAad().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsPurgeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsPurgeSample.ts new file mode 100644 index 000000000000..e92555f60e98 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsPurgeSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to purge(force delete) an Azure Site Recovery fabric. + * + * @summary The operation to purge(force delete) an Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_Purge.json + */ +async function purgesTheSite() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName + ); + console.log(result); +} + +purgesTheSite().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsReassociateGatewaySample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsReassociateGatewaySample.ts new file mode 100644 index 000000000000..43a8a623cc1a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsReassociateGatewaySample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + FailoverProcessServerRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to move replications from a process server to another process server. + * + * @summary The operation to move replications from a process server to another process server. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_ReassociateGateway.json + */ +async function performFailoverOfTheProcessServer() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "GRACE-V2A-1"; + const failoverProcessServerRequest: FailoverProcessServerRequest = { + properties: { + containerName: "cloud_1f3c15af-2256-4568-9e06-e1ef4f728f75", + sourceProcessServerId: "AFA0EC54-1894-4E44-9CAB02DB8854B117", + targetProcessServerId: "5D3ED340-85AE-C646-B338641E015DA405", + updateType: "ServerLevel", + vmsToMigrate: ["Vm1", "Vm2"] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginReassociateGatewayAndWait( + resourceName, + resourceGroupName, + fabricName, + failoverProcessServerRequest + ); + console.log(result); +} + +performFailoverOfTheProcessServer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsRenewCertificateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsRenewCertificateSample.ts new file mode 100644 index 000000000000..1ec74b5f3e35 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationFabricsRenewCertificateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RenewCertificateInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Renews the connection certificate for the ASR replication fabric. + * + * @summary Renews the connection certificate for the ASR replication fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationFabrics_RenewCertificate.json + */ +async function renewsCertificateForTheFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const renewCertificate: RenewCertificateInput = { + properties: { renewCertificateType: "Cloud" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationFabrics.beginRenewCertificateAndWait( + resourceName, + resourceGroupName, + fabricName, + renewCertificate + ); + console.log(result); +} + +renewsCertificateForTheFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsCancelSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsCancelSample.ts new file mode 100644 index 000000000000..2329b0a6919a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsCancelSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to cancel an Azure Site Recovery job. + * + * @summary The operation to cancel an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Cancel.json + */ +async function cancelsTheSpecifiedJob() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "2653c648-fc72-4316-86f3-fdf8eaa0066b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginCancelAndWait( + resourceName, + resourceGroupName, + jobName + ); + console.log(result); +} + +cancelsTheSpecifiedJob().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsExportSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsExportSample.ts new file mode 100644 index 000000000000..f5329b77d957 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsExportSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + JobQueryParameter, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to export the details of the Azure Site Recovery jobs of the vault. + * + * @summary The operation to export the details of the Azure Site Recovery jobs of the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Export.json + */ +async function exportsTheDetailsOfTheAzureSiteRecoveryJobsOfTheVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobQueryParameter: JobQueryParameter = { + affectedObjectTypes: "", + endTime: "2017-05-04T14:26:51.9161395Z", + jobStatus: "", + startTime: "2017-04-27T14:26:51.9161395Z" + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginExportAndWait( + resourceName, + resourceGroupName, + jobQueryParameter + ); + console.log(result); +} + +exportsTheDetailsOfTheAzureSiteRecoveryJobsOfTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsGetSample.ts new file mode 100644 index 000000000000..6afa4271c76f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the details of an Azure Site Recovery job. + * + * @summary Get the details of an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Get.json + */ +async function getsTheJobDetails() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "58776d0b-3141-48b2-a377-9ad863eb160d"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.get( + resourceName, + resourceGroupName, + jobName + ); + console.log(result); +} + +getsTheJobDetails().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsListSample.ts new file mode 100644 index 000000000000..f1bf5bfc6ca8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of Azure Site Recovery Jobs for the vault. + * + * @summary Gets the list of Azure Site Recovery Jobs for the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_List.json + */ +async function getsTheListOfJobs() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationJobs.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfJobs().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsRestartSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsRestartSample.ts new file mode 100644 index 000000000000..442faf1dd459 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsRestartSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to restart an Azure Site Recovery job. + * + * @summary The operation to restart an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Restart.json + */ +async function restartsTheSpecifiedJob() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "0664564c-353e-401a-ab0c-722257c10e25"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginRestartAndWait( + resourceName, + resourceGroupName, + jobName + ); + console.log(result); +} + +restartsTheSpecifiedJob().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsResumeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsResumeSample.ts new file mode 100644 index 000000000000..4d3db04e290f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationJobsResumeSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResumeJobParams, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to resume an Azure Site Recovery job. + * + * @summary The operation to resume an Azure Site Recovery job. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationJobs_Resume.json + */ +async function resumesTheSpecifiedJob() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const jobName = "58776d0b-3141-48b2-a377-9ad863eb160d"; + const resumeJobParams: ResumeJobParams = { properties: { comments: " " } }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationJobs.beginResumeAndWait( + resourceName, + resourceGroupName, + jobName, + resumeJobParams + ); + console.log(result); +} + +resumesTheSpecifiedJob().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationLogicalNetworksGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationLogicalNetworksGetSample.ts new file mode 100644 index 000000000000..e2d6d9f42472 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationLogicalNetworksGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a logical network. + * + * @summary Gets the details of a logical network. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_Get.json + */ +async function getsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const logicalNetworkName = "87ab394f-165f-4aa9-bd84-b018500b4509"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationLogicalNetworks.get( + resourceName, + resourceGroupName, + fabricName, + logicalNetworkName + ); + console.log(result); +} + +getsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationLogicalNetworksListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationLogicalNetworksListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..36166a218850 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationLogicalNetworksListByReplicationFabricsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all the logical networks of the Azure Site Recovery fabric. + * + * @summary Lists all the logical networks of the Azure Site Recovery fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json + */ +async function getsTheListOfLogicalNetworksUnderAFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationLogicalNetworks.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfLogicalNetworksUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsCreateSample.ts new file mode 100644 index 000000000000..ecd7df8cb28f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsCreateSample.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + EnableMigrationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an ASR migration item (enable migration). + * + * @summary The operation to create an ASR migration item (enable migration). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Create.json + */ +async function enablesMigration() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const input: EnableMigrationInput = { + properties: { + policyId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationPolicies/vmwarepolicy1", + providerSpecificDetails: { + dataMoverRunAsAccountId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/dataMoverRunAsAccount1", + disksToInclude: [ + { + diskId: "disk1", + isOSDisk: "true", + logStorageAccountId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Storage/storageAccounts/logStorageAccount1", + logStorageAccountSasSecretName: "logStorageSas" + } + ], + instanceType: "VMwareCbt", + snapshotRunAsAccountId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/snapshotRunAsAccount1", + targetNetworkId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1", + targetResourceGroupId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1", + vmwareMachineId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/machines/virtualmachine1" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input + ); + console.log(result); +} + +enablesMigration().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsDeleteSample.ts new file mode 100644 index 000000000000..16ba6af26251 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete an ASR migration item. + * + * @summary The operation to delete an ASR migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Delete.json + */ +async function deleteTheMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName + ); + console.log(result); +} + +deleteTheMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsGetSample.ts new file mode 100644 index 000000000000..6c80125c7b6c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a migration item. + * + * @summary Gets the details of a migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Get.json + */ +async function getsTheDetailsOfAMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName + ); + console.log(result); +} + +getsTheDetailsOfAMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsListByReplicationProtectionContainersSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsListByReplicationProtectionContainersSample.ts new file mode 100644 index 000000000000..c7cc0c8196b9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsListByReplicationProtectionContainersSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of ASR migration items in the protection container. + * + * @summary Gets the list of ASR migration items in the protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfMigrationItemsInTheProtectionContainer() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationMigrationItems.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfMigrationItemsInTheProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsListSample.ts new file mode 100644 index 000000000000..000d1c28c65b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of migration items in the vault. + * + * @summary Gets the list of migration items in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_List.json + */ +async function getsTheListOfMigrationItemsInTheVault() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationMigrationItems.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfMigrationItemsInTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsMigrateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsMigrateSample.ts new file mode 100644 index 000000000000..ab9b861aa97e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsMigrateSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MigrateInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate migration of the item. + * + * @summary The operation to initiate migration of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Migrate.json + */ +async function migrateItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const migrateInput: MigrateInput = { + properties: { + providerSpecificDetails: { + instanceType: "VMwareCbt", + performShutdown: "true" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginMigrateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + migrateInput + ); + console.log(result); +} + +migrateItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsPauseReplicationSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsPauseReplicationSample.ts new file mode 100644 index 000000000000..ffe91ba8e8ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsPauseReplicationSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PauseReplicationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate pause replication of the item. + * + * @summary The operation to initiate pause replication of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_PauseReplication.json + */ +async function pauseReplication() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const pauseReplicationInput: PauseReplicationInput = { + properties: { instanceType: "VMwareCbt" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginPauseReplicationAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput + ); + console.log(result); +} + +pauseReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsResumeReplicationSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsResumeReplicationSample.ts new file mode 100644 index 000000000000..21e71b1b2ca0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsResumeReplicationSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResumeReplicationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate resume replication of the item. + * + * @summary The operation to initiate resume replication of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_ResumeReplication.json + */ +async function resumeReplication() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const resumeReplicationInput: ResumeReplicationInput = { + properties: { + providerSpecificDetails: { + deleteMigrationResources: "false", + instanceType: "VMwareCbt" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginResumeReplicationAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput + ); + console.log(result); +} + +resumeReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsResyncSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsResyncSample.ts new file mode 100644 index 000000000000..73d43f1add5e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsResyncSample.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResyncInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to resynchronize replication of an ASR migration item. + * + * @summary The operation to resynchronize replication of an ASR migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Resync.json + */ +async function resynchronizesReplication() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const input: ResyncInput = { + properties: { + providerSpecificDetails: { + instanceType: "VMwareCbt", + skipCbtReset: "true" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginResyncAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input + ); + console.log(result); +} + +resynchronizesReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsTestMigrateCleanupSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsTestMigrateCleanupSample.ts new file mode 100644 index 000000000000..3712bcfd82ab --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsTestMigrateCleanupSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TestMigrateCleanupInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate test migrate cleanup. + * + * @summary The operation to initiate test migrate cleanup. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json + */ +async function testMigrateCleanup() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const testMigrateCleanupInput: TestMigrateCleanupInput = { + properties: { comments: "Test Failover Cleanup" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginTestMigrateCleanupAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateCleanupInput + ); + console.log(result); +} + +testMigrateCleanup().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsTestMigrateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsTestMigrateSample.ts new file mode 100644 index 000000000000..0b52cf966b97 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsTestMigrateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TestMigrateInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to initiate test migration of the item. + * + * @summary The operation to initiate test migration of the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_TestMigrate.json + */ +async function testMigrateItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const testMigrateInput: TestMigrateInput = { + properties: { + providerSpecificDetails: { + instanceType: "VMwareCbt", + networkId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1", + recoveryPointId: + "/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/9e737191-317e-43d0-8c83-e32ac3b34686" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginTestMigrateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + testMigrateInput + ); + console.log(result); +} + +testMigrateItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsUpdateSample.ts new file mode 100644 index 000000000000..ac2c325a8681 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationMigrationItemsUpdateSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateMigrationItemInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the recovery settings of an ASR migration item. + * + * @summary The operation to update the recovery settings of an ASR migration item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationMigrationItems_Update.json + */ +async function updatesMigrationItem() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const protectionContainerName = "vmwareContainer1"; + const migrationItemName = "virtualmachine1"; + const input: UpdateMigrationItemInput = { + properties: { providerSpecificDetails: { instanceType: "VMwareCbt" } } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationMigrationItems.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + input + ); + console.log(result); +} + +updatesMigrationItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsCreateSample.ts new file mode 100644 index 000000000000..64cc9dd234b5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsCreateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateNetworkMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an ASR network mapping. + * + * @summary The operation to create an ASR network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Create.json + */ +async function createsNetworkMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const input: CreateNetworkMappingInput = { + properties: { + fabricSpecificDetails: { instanceType: "VmmToAzure" }, + recoveryFabricName: "Microsoft Azure", + recoveryNetworkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + input + ); + console.log(result); +} + +createsNetworkMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsDeleteSample.ts new file mode 100644 index 000000000000..bc9eccacb18d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a network mapping. + * + * @summary The operation to delete a network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Delete.json + */ +async function deleteNetworkMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName + ); + console.log(result); +} + +deleteNetworkMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsGetSample.ts new file mode 100644 index 000000000000..6a3e57656963 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsGetSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of an ASR network mapping. + * + * @summary Gets the details of an ASR network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Get.json + */ +async function getsNetworkMappingByName() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.get( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName + ); + console.log(result); +} + +getsNetworkMappingByName().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsListByReplicationNetworksSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsListByReplicationNetworksSample.ts new file mode 100644 index 000000000000..c13d5437d43f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsListByReplicationNetworksSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all ASR network mappings for the specified network. + * + * @summary Lists all ASR network mappings for the specified network. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json + */ +async function getsAllTheNetworkMappingsUnderANetwork() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworkMappings.listByReplicationNetworks( + resourceName, + resourceGroupName, + fabricName, + networkName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsAllTheNetworkMappingsUnderANetwork().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsListSample.ts new file mode 100644 index 000000000000..9c9069c295db --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all ASR network mappings in the vault. + * + * @summary Lists all ASR network mappings in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_List.json + */ +async function getsAllTheNetworkMappingsUnderAVault() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworkMappings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsAllTheNetworkMappingsUnderAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsUpdateSample.ts new file mode 100644 index 000000000000..7bca6c4b927c --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworkMappingsUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateNetworkMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update an ASR network mapping. + * + * @summary The operation to update an ASR network mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworkMappings_Update.json + */ +async function updatesNetworkMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "e2267b5c-2650-49bd-ab3f-d66aae694c06"; + const networkMappingName = "corpe2amap"; + const input: UpdateNetworkMappingInput = { + properties: { + fabricSpecificDetails: { instanceType: "VmmToAzure" }, + recoveryFabricName: "Microsoft Azure", + recoveryNetworkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai2" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworkMappings.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + input + ); + console.log(result); +} + +updatesNetworkMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksGetSample.ts new file mode 100644 index 000000000000..f5dbf16ac137 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksGetSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a network. + * + * @summary Gets the details of a network. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_Get.json + */ +async function getsANetworkWithSpecifiedServerIdAndNetworkName() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const networkName = "93ce99d7-1219-4914-aa61-73fe5023988e"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationNetworks.get( + resourceName, + resourceGroupName, + fabricName, + networkName + ); + console.log(result); +} + +getsANetworkWithSpecifiedServerIdAndNetworkName().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..ac199f1342f4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksListByReplicationFabricsSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the networks available for a fabric. + * + * @summary Lists the networks available for a fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_ListByReplicationFabrics.json + */ +async function getsTheListOfNetworksUnderAFabric() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const fabricName = + "b0cef6e9a4437b81803d0b55ada4f700ab66caae59c35d62723a1589c0cd13ac"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworks.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfNetworksUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksListSample.ts new file mode 100644 index 000000000000..9bae52537b87 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationNetworksListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the networks available in a vault. + * + * @summary Lists the networks available in a vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationNetworks_List.json + */ +async function getsTheListOfNetworksViewOnlyApi() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "srce2avaultbvtaC27"; + const resourceGroupName = "srcBvte2a14C27"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationNetworks.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfNetworksViewOnlyApi().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesCreateSample.ts new file mode 100644 index 000000000000..dad4e2222182 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesCreateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreatePolicyInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a replication policy. + * + * @summary The operation to create a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Create.json + */ +async function createsThePolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const input: CreatePolicyInput = { + properties: { + providerSpecificInput: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.beginCreateAndWait( + resourceName, + resourceGroupName, + policyName, + input + ); + console.log(result); +} + +createsThePolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesDeleteSample.ts new file mode 100644 index 000000000000..49de7756fd75 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a replication policy. + * + * @summary The operation to delete a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Delete.json + */ +async function deleteThePolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.beginDeleteAndWait( + resourceName, + resourceGroupName, + policyName + ); + console.log(result); +} + +deleteThePolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesGetSample.ts new file mode 100644 index 000000000000..d1e1415f2c25 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a replication policy. + * + * @summary Gets the details of a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Get.json + */ +async function getsTheRequestedPolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.get( + resourceName, + resourceGroupName, + policyName + ); + console.log(result); +} + +getsTheRequestedPolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesListSample.ts new file mode 100644 index 000000000000..614f9699988d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the replication policies for a vault. + * + * @summary Lists the replication policies for a vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_List.json + */ +async function getsTheListOfReplicationPolicies() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationPolicies.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationPolicies().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesUpdateSample.ts new file mode 100644 index 000000000000..88d64c27f185 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationPoliciesUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdatePolicyInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a replication policy. + * + * @summary The operation to update a replication policy. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationPolicies_Update.json + */ +async function updatesThePolicy() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const policyName = "protectionprofile1"; + const input: UpdatePolicyInput = { + properties: { + replicationProviderSettings: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationPolicies.beginUpdateAndWait( + resourceName, + resourceGroupName, + policyName, + input + ); + console.log(result); +} + +updatesThePolicy().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectableItemsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectableItemsGetSample.ts new file mode 100644 index 000000000000..1997e489113d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectableItemsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to get the details of a protectable item. + * + * @summary The operation to get the details of a protectable item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_Get.json + */ +async function getsTheDetailsOfAProtectableItem() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const protectableItemName = "c0c14913-3d7a-48ea-9531-cc99e0e686e6"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectableItems.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + protectableItemName + ); + console.log(result); +} + +getsTheDetailsOfAProtectableItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectableItemsListByReplicationProtectionContainersSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectableItemsListByReplicationProtectionContainersSample.ts new file mode 100644 index 000000000000..182987913dc0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectableItemsListByReplicationProtectionContainersSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protectable items in a protection container. + * + * @summary Lists the protectable items in a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfProtectableItems() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectableItems.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfProtectableItems().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsAddDisksSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsAddDisksSample.ts new file mode 100644 index 000000000000..8f05e16040f2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsAddDisksSample.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AddDisksInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to add disks(s) to the replication protected item. + * + * @summary Operation to add disks(s) to the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_AddDisks.json + */ +async function addDiskSForProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const addDisksInput: AddDisksInput = { + properties: { + providerSpecificDetails: { + instanceType: "A2A", + vmDisks: [ + { + diskUri: + "https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd", + primaryStagingAzureStorageAccountId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/primaryResource/providers/Microsoft.Storage/storageAccounts/vmcachestorage", + recoveryAzureStorageAccountId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourcegroups/recoveryResource/providers/Microsoft.Storage/storageAccounts/recoverystorage" + } + ] + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginAddDisksAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + addDisksInput + ); + console.log(result); +} + +addDiskSForProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsApplyRecoveryPointSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsApplyRecoveryPointSample.ts new file mode 100644 index 000000000000..1aec4a646a14 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsApplyRecoveryPointSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ApplyRecoveryPointInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to change the recovery point of a failed over replication protected item. + * + * @summary The operation to change the recovery point of a failed over replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json + */ +async function changeOrApplyRecoveryPoint() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const applyRecoveryPointInput: ApplyRecoveryPointInput = { + properties: { + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + recoveryPointId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b/recoveryPoints/e4d05fe9-5dfd-47be-b50b-aad306b2802d" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginApplyRecoveryPointAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applyRecoveryPointInput + ); + console.log(result); +} + +changeOrApplyRecoveryPoint().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsCreateSample.ts new file mode 100644 index 000000000000..2be206140d4f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsCreateSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + EnableProtectionInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an ASR replication protected item (Enable replication). + * + * @summary The operation to create an ASR replication protected item (Enable replication). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Create.json + */ +async function enablesProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const input: EnableProtectionInput = { + properties: { + policyId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1", + protectableItemId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectableItems/f8491e4f-817a-40dd-a90c-af773978c75b", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + input + ); + console.log(result); +} + +enablesProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsDeleteSample.ts new file mode 100644 index 000000000000..52afef5b1127 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsDeleteSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DisableProtectionInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to disable replication on a replication protected item. This will also remove the item. + * + * @summary The operation to disable replication on a replication protected item. This will also remove the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Delete.json + */ +async function disablesProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "c0c14913-3d7a-48ea-9531-cc99e0e686e6"; + const disableProtectionInput: DisableProtectionInput = { + properties: { + replicationProviderInput: { + instanceType: "InMage" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + disableProtectionInput + ); + console.log(result); +} + +disablesProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsFailoverCancelSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsFailoverCancelSample.ts new file mode 100644 index 000000000000..3da3717d50fe --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsFailoverCancelSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to cancel the failover of the replication protected item. + * + * @summary Operation to cancel the failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCancel.json + */ +async function executeCancelFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginFailoverCancelAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +executeCancelFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsFailoverCommitSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsFailoverCommitSample.ts new file mode 100644 index 000000000000..2b3800ea9350 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsFailoverCommitSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to commit the failover of the replication protected item. + * + * @summary Operation to commit the failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_FailoverCommit.json + */ +async function executeCommitFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginFailoverCommitAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +executeCommitFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsGetSample.ts new file mode 100644 index 000000000000..e5feb1816b68 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of an ASR replication protected item. + * + * @summary Gets the details of an ASR replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Get.json + */ +async function getsTheDetailsOfAReplicationProtectedItem() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +getsTheDetailsOfAReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsListByReplicationProtectionContainersSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsListByReplicationProtectionContainersSample.ts new file mode 100644 index 000000000000..45ec172784a2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsListByReplicationProtectionContainersSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of ASR replication protected items in the protection container. + * + * @summary Gets the list of ASR replication protected items in the protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfReplicationProtectedItems() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectedItems.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationProtectedItems().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsListSample.ts new file mode 100644 index 000000000000..dbf46e465bb8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of ASR replication protected items in the vault. + * + * @summary Gets the list of ASR replication protected items in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_List.json + */ +async function getsTheListOfReplicationProtectedItems() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectedItems.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationProtectedItems().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsPlannedFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsPlannedFailoverSample.ts new file mode 100644 index 000000000000..453947341d25 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsPlannedFailoverSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PlannedFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to initiate a planned failover of the replication protected item. + * + * @summary Operation to initiate a planned failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_PlannedFailover.json + */ +async function executePlannedFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const failoverInput: PlannedFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginPlannedFailoverAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput + ); + console.log(result); +} + +executePlannedFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsPurgeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsPurgeSample.ts new file mode 100644 index 000000000000..b963b1a23831 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsPurgeSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item. + * + * @summary The operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Purge.json + */ +async function purgesProtection() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "c0c14913-3d7a-48ea-9531-cc99e0e686e6"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +purgesProtection().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsRemoveDisksSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsRemoveDisksSample.ts new file mode 100644 index 000000000000..28765a34047f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsRemoveDisksSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RemoveDisksInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to remove disk(s) from the replication protected item. + * + * @summary Operation to remove disk(s) from the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RemoveDisks.json + */ +async function removesDiskS() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const removeDisksInput: RemoveDisksInput = { + properties: { + providerSpecificDetails: { + instanceType: "A2A", + vmDisksUris: [ + "https://vmstorage.blob.core.windows.net/vhds/datadisk1.vhd" + ] + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginRemoveDisksAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + removeDisksInput + ); + console.log(result); +} + +removesDiskS().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsRepairReplicationSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsRepairReplicationSample.ts new file mode 100644 index 000000000000..2debac87abed --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsRepairReplicationSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start resynchronize/repair replication for a replication protected item requiring resynchronization. + * + * @summary The operation to start resynchronize/repair replication for a replication protected item requiring resynchronization. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_RepairReplication.json + */ +async function resynchronizeOrRepairReplication() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginRepairReplicationAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + ); + console.log(result); +} + +resynchronizeOrRepairReplication().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsReprotectSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsReprotectSample.ts new file mode 100644 index 000000000000..5df00162b2ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsReprotectSample.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ReverseReplicationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to reprotect or reverse replicate a failed over replication protected item. + * + * @summary Operation to reprotect or reverse replicate a failed over replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Reprotect.json + */ +async function executeReverseReplicationReprotect() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const reprotectInput: ReverseReplicationInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginReprotectAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + reprotectInput + ); + console.log(result); +} + +executeReverseReplicationReprotect().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsResolveHealthErrorsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsResolveHealthErrorsSample.ts new file mode 100644 index 000000000000..463bf3a6b5f4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsResolveHealthErrorsSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ResolveHealthInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to resolve health issues of the replication protected item. + * + * @summary Operation to resolve health issues of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json + */ +async function resolveHealthErrors() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const resolveHealthInput: ResolveHealthInput = { + properties: { healthErrors: [{ healthErrorId: "3:8020" }] } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginResolveHealthErrorsAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + resolveHealthInput + ); + console.log(result); +} + +resolveHealthErrors().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsSwitchProviderSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsSwitchProviderSample.ts new file mode 100644 index 000000000000..c65896aa07b1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsSwitchProviderSample.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SwitchProviderInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to initiate a switch provider of the replication protected item. + * + * @summary Operation to initiate a switch provider of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_SwitchProvider.json + */ +async function executeSwitchProvider() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const switchProviderInput: SwitchProviderInput = { + properties: { + providerSpecificDetails: { + instanceType: "InMageAzureV2", + targetApplianceID: "5efaa202-e958-435e-8171-706bf735fcc4", + targetFabricID: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud2", + targetVaultID: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault2" + }, + targetInstanceType: "InMageRcm" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginSwitchProviderAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + switchProviderInput + ); + console.log(result); +} + +executeSwitchProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsTestFailoverCleanupSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsTestFailoverCleanupSample.ts new file mode 100644 index 000000000000..4892d194b248 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsTestFailoverCleanupSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TestFailoverCleanupInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to clean up the test failover of a replication protected item. + * + * @summary Operation to clean up the test failover of a replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json + */ +async function executeTestFailoverCleanup() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const cleanupInput: TestFailoverCleanupInput = { + properties: { comments: "Test Failover Cleanup" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginTestFailoverCleanupAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + cleanupInput + ); + console.log(result); +} + +executeTestFailoverCleanup().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsTestFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsTestFailoverSample.ts new file mode 100644 index 000000000000..0cb09409ac0b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsTestFailoverSample.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TestFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to perform a test failover of the replication protected item. + * + * @summary Operation to perform a test failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_TestFailover.json + */ +async function executeTestFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const testfailoverInput: TestFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + networkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + networkType: "VmNetworkAsInput", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginTestFailoverAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + testfailoverInput + ); + console.log(result); +} + +executeTestFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUnplannedFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUnplannedFailoverSample.ts new file mode 100644 index 000000000000..3e882488c763 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUnplannedFailoverSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UnplannedFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to initiate a failover of the replication protected item. + * + * @summary Operation to initiate a failover of the replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UnplannedFailover.json + */ +async function executeUnplannedFailover() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const failoverInput: UnplannedFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + sourceSiteOperations: "NotRequired" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUnplannedFailoverAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + failoverInput + ); + console.log(result); +} + +executeUnplannedFailover().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateApplianceSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateApplianceSample.ts new file mode 100644 index 000000000000..801ed6ac32a5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateApplianceSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateApplianceForReplicationProtectedItemInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update appliance of an ASR replication protected item. + * + * @summary The operation to update appliance of an ASR replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateAppliance.json + */ +async function updatesApplianceForReplicationProtectedItem() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "Ayan-0106-SA-Vault"; + const resourceGroupName = "Ayan-0106-SA-RG"; + const fabricName = "Ayan-0106-SA-Vaultreplicationfabric"; + const protectionContainerName = "Ayan-0106-SA-Vaultreplicationcontainer"; + const replicatedProtectedItemName = + "idclab-vcen67_50158124-8857-3e08-0893-2ddf8ebb8c1f"; + const applianceUpdateInput: UpdateApplianceForReplicationProtectedItemInput = { + properties: { + providerSpecificDetails: { + instanceType: "InMageRcm", + runAsAccountId: "" + }, + targetApplianceId: "" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUpdateApplianceAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + applianceUpdateInput + ); + console.log(result); +} + +updatesApplianceForReplicationProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateMobilityServiceSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateMobilityServiceSample.ts new file mode 100644 index 000000000000..9aa69d242810 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateMobilityServiceSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateMobilityServiceRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update(push update) the installed mobility service software on a replication protected item to the latest available version. + * + * @summary The operation to update(push update) the installed mobility service software on a replication protected item to the latest available version. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_UpdateMobilityService.json + */ +async function updateTheMobilityServiceOnAProtectedItem() { + const subscriptionId = "b364ed8d-4279-4bf8-8fd1-56f8fa0ae05c"; + const resourceName = "WCUSVault"; + const resourceGroupName = "wcusValidations"; + const fabricName = "WIN-JKKJ31QI8U2"; + const protectionContainerName = "cloud_c6780228-83bd-4f3e-a70e-cb46b7da33a0"; + const replicatedProtectedItemName = "79dd20ab-2b40-11e7-9791-0050568f387e"; + const updateMobilityServiceRequest: UpdateMobilityServiceRequest = { + properties: { runAsAccountId: "2" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUpdateMobilityServiceAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateMobilityServiceRequest + ); + console.log(result); +} + +updateTheMobilityServiceOnAProtectedItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateSample.ts new file mode 100644 index 000000000000..a9f99936eb38 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectedItemsUpdateSample.ts @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateReplicationProtectedItemInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update the recovery settings of an ASR replication protected item. + * + * @summary The operation to update the recovery settings of an ASR replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectedItems_Update.json + */ +async function updatesTheReplicationProtectedItemSettings() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const replicatedProtectedItemName = "f8491e4f-817a-40dd-a90c-af773978c75b"; + const updateProtectionInput: UpdateReplicationProtectedItemInput = { + properties: { + licenseType: "WindowsServer", + providerSpecificDetails: { instanceType: "HyperVReplicaAzure" }, + recoveryAzureVMName: "vm1", + recoveryAzureVMSize: "Basic_A0", + selectedRecoveryAzureNetworkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + vmNics: [ + { + ipConfigs: [ + { + ipConfigName: "ipconfig1", + isPrimary: true, + recoveryStaticIPAddress: "10.0.2.46", + recoverySubnetName: "subnet1" + } + ], + nicId: + "TWljcm9zb2Z0OkY4NDkxRTRGLTgxN0EtNDBERC1BOTBDLUFGNzczOTc4Qzc1Qlw3NjAwMzMxRS03NDk4LTQ0QTQtQjdDNy0xQjY1NkJDREQ1MkQ=", + selectionType: "SelectedByUser" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectedItems.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + updateProtectionInput + ); + console.log(result); +} + +updatesTheReplicationProtectedItemSettings().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsCreateSample.ts new file mode 100644 index 000000000000..6b7171db997e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsCreateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateProtectionContainerMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a protection container mapping. + * + * @summary The operation to create a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Create.json + */ +async function createProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const creationInput: CreateProtectionContainerMappingInput = { + properties: { + policyId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/protectionprofile1", + providerSpecificInput: { + instanceType: "VMwareCbt" + }, + targetProtectionContainerId: "Microsoft Azure" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + creationInput + ); + console.log(result); +} + +createProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsDeleteSample.ts new file mode 100644 index 000000000000..571a15d453d0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsDeleteSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RemoveProtectionContainerMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete or remove a protection container mapping. + * + * @summary The operation to delete or remove a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Delete.json + */ +async function removeProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const removalInput: RemoveProtectionContainerMappingInput = { + properties: { providerSpecificInput: {} } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + removalInput + ); + console.log(result); +} + +removeProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsGetSample.ts new file mode 100644 index 000000000000..13733d635471 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsGetSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a protection container mapping. + * + * @summary Gets the details of a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Get.json + */ +async function getsAProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName + ); + console.log(result); +} + +getsAProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.ts new file mode 100644 index 000000000000..fe46b6bd612f --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsListByReplicationProtectionContainersSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protection container mappings for a protection container. + * + * @summary Lists the protection container mappings for a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json + */ +async function getsTheListOfProtectionContainerMappingsForAProtectionContainer() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainerMappings.listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfProtectionContainerMappingsForAProtectionContainer().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsListSample.ts new file mode 100644 index 000000000000..2e7b55518924 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protection container mappings in the vault. + * + * @summary Lists the protection container mappings in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_List.json + */ +async function getsTheListOfAllProtectionContainerMappingsInAVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainerMappings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAllProtectionContainerMappingsInAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsPurgeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsPurgeSample.ts new file mode 100644 index 000000000000..e0c4ac087163 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsPurgeSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to purge(force delete) a protection container mapping. + * + * @summary The operation to purge(force delete) a protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Purge.json + */ +async function purgeProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName + ); + console.log(result); +} + +purgeProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsUpdateSample.ts new file mode 100644 index 000000000000..ebd70d27534e --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainerMappingsUpdateSample.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateProtectionContainerMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update protection container mapping. + * + * @summary The operation to update protection container mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainerMappings_Update.json + */ +async function updateProtectionContainerMapping() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const mappingName = "cloud1protectionprofile1"; + const updateInput: UpdateProtectionContainerMappingInput = { + properties: { + providerSpecificInput: { + agentAutoUpdateStatus: "Enabled", + automationAccountArmId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/automationrg1/providers/Microsoft.Automation/automationAccounts/automationaccount1", + instanceType: "A2A" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainerMappings.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + updateInput + ); + console.log(result); +} + +updateProtectionContainerMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersCreateSample.ts new file mode 100644 index 000000000000..3d3c6f07d493 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersCreateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateProtectionContainerInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to create a protection container. + * + * @summary Operation to create a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Create.json + */ +async function createAProtectionContainer() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const creationInput: CreateProtectionContainerInput = { + properties: { + providerSpecificInput: [ + { instanceType: "A2ACrossClusterMigration" } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + creationInput + ); + console.log(result); +} + +createAProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersDeleteSample.ts new file mode 100644 index 000000000000..7676ec58b512 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to remove a protection container. + * + * @summary Operation to remove a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Delete.json + */ +async function removesAProtectionContainer() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + ); + console.log(result); +} + +removesAProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersDiscoverProtectableItemSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersDiscoverProtectableItemSample.ts new file mode 100644 index 000000000000..78ec5317b779 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersDiscoverProtectableItemSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiscoverProtectableItemRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to a add a protectable item to a protection container(Add physical server). + * + * @summary The operation to a add a protectable item to a protection container(Add physical server). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json + */ +async function addsAProtectableItemToTheReplicationProtectionContainer() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "V2A-W2K12-660"; + const protectionContainerName = "cloud_7328549c-5c37-4459-a3c2-e35f9ef6893c"; + const discoverProtectableItemRequest: DiscoverProtectableItemRequest = { + properties: { + friendlyName: "Test", + ipAddress: "10.150.2.3", + osType: "Windows" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginDiscoverProtectableItemAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + discoverProtectableItemRequest + ); + console.log(result); +} + +addsAProtectableItemToTheReplicationProtectionContainer().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersGetSample.ts new file mode 100644 index 000000000000..3a88f9da4827 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a protection container. + * + * @summary Gets the details of a protection container. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_Get.json + */ +async function getsTheProtectionContainerDetails() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const protectionContainerName = "cloud_6d224fc6-f326-5d35-96de-fbf51efb3179"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.get( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName + ); + console.log(result); +} + +getsTheProtectionContainerDetails().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..356a6bb228eb --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersListByReplicationFabricsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protection containers in the specified fabric. + * + * @summary Lists the protection containers in the specified fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json + */ +async function getsTheListOfProtectionContainerForAFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainers.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfProtectionContainerForAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersListSample.ts new file mode 100644 index 000000000000..56feb7d34ef9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the protection containers in a vault. + * + * @summary Lists the protection containers in a vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_List.json + */ +async function getsTheListOfAllProtectionContainersInAVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionContainers.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfAllProtectionContainersInAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersSwitchProtectionSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersSwitchProtectionSample.ts new file mode 100644 index 000000000000..ef92b9a64592 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionContainersSwitchProtectionSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SwitchProtectionInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to switch protection from one container to another or one replication provider to another. + * + * @summary Operation to switch protection from one container to another or one replication provider to another. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionContainers_SwitchProtection.json + */ +async function switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother() { + const subscriptionId = "42195872-7e70-4f8a-837f-84b28ecbb78b"; + const resourceName = "priyanponeboxvault"; + const resourceGroupName = "priyanprg"; + const fabricName = "CentralUSCanSite"; + const protectionContainerName = "CentralUSCancloud"; + const switchInput: SwitchProtectionInput = { + properties: { providerSpecificDetails: { instanceType: "A2A" } } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionContainers.beginSwitchProtectionAndWait( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + switchInput + ); + console.log(result); +} + +switchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsCreateSample.ts new file mode 100644 index 000000000000..12dbd2e2c4c6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsCreateSample.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateProtectionIntentInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create an ASR replication protection intent item. + * + * @summary The operation to create an ASR replication protection intent item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Create.json + */ +async function createProtectionIntentResource() { + const subscriptionId = "509099b2-9d2c-4636-b43e-bd5cafb6be69"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const intentObjectName = "vm1"; + const input: CreateProtectionIntentInput = { + properties: { + providerSpecificDetails: { + fabricObjectId: + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne/providers/Microsoft.Compute/virtualMachines/vmPpgAv5", + instanceType: "A2A", + primaryLocation: "eastUs2", + recoveryAvailabilityType: "Single", + recoveryLocation: "westus2", + recoveryResourceGroupId: + "/subscriptions/509099b2-9d2c-4636-b43e-bd5cafb6be69/resourceGroups/removeOne-asr", + recoverySubscriptionId: "ed5bcdf6-d61e-47bd-8ea9-f2bd379a2640" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionIntents.create( + resourceName, + resourceGroupName, + intentObjectName, + input + ); + console.log(result); +} + +createProtectionIntentResource().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsGetSample.ts new file mode 100644 index 000000000000..d45adf14c748 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of an ASR replication protection intent. + * + * @summary Gets the details of an ASR replication protection intent. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_Get.json + */ +async function getsTheDetailsOfAReplicationProtectionIntentItem() { + const subscriptionId = "509099b2-9d2c-4636-b43e-bd5cafb6be69"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const intentObjectName = "vm1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationProtectionIntents.get( + resourceName, + resourceGroupName, + intentObjectName + ); + console.log(result); +} + +getsTheDetailsOfAReplicationProtectionIntentItem().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsListSample.ts new file mode 100644 index 000000000000..a2bb8f02e922 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationProtectionIntentsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of ASR replication protection intent objects in the vault. + * + * @summary Gets the list of ASR replication protection intent objects in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationProtectionIntents_List.json + */ +async function getsTheListOfReplicationProtectionIntentObjects() { + const subscriptionId = "509099b2-9d2c-4636-b43e-bd5cafb6be69"; + const resourceName = "2007vttp"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationProtectionIntents.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfReplicationProtectionIntentObjects().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansCreateSample.ts new file mode 100644 index 000000000000..530c91adf861 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansCreateSample.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateRecoveryPlanInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a recovery plan. + * + * @summary The operation to create a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Create.json + */ +async function createsARecoveryPlanWithTheGivenDetails() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: CreateRecoveryPlanInput = { + properties: { + failoverDeploymentModel: "ResourceManager", + groups: [ + { + endGroupActions: [], + groupType: "Boot", + replicationProtectedItems: [ + { + id: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b", + virtualMachineId: "f8491e4f-817a-40dd-a90c-af773978c75b" + } + ], + startGroupActions: [] + } + ], + primaryFabricId: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1", + recoveryFabricId: "Microsoft Azure" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginCreateAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +createsARecoveryPlanWithTheGivenDetails().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansDeleteSample.ts new file mode 100644 index 000000000000..3ea2252dcf78 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a recovery plan. + * + * @summary Delete a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Delete.json + */ +async function deletesTheSpecifiedRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginDeleteAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +deletesTheSpecifiedRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansFailoverCancelSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansFailoverCancelSample.ts new file mode 100644 index 000000000000..6c7478f7f6c4 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansFailoverCancelSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to cancel the failover of a recovery plan. + * + * @summary The operation to cancel the failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCancel.json + */ +async function executeCancelFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginFailoverCancelAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +executeCancelFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansFailoverCommitSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansFailoverCommitSample.ts new file mode 100644 index 000000000000..b2a68ff96610 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansFailoverCommitSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to commit the failover of a recovery plan. + * + * @summary The operation to commit the failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_FailoverCommit.json + */ +async function executeCommitFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginFailoverCommitAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +executeCommitFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansGetSample.ts new file mode 100644 index 000000000000..e8667d8395ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of the recovery plan. + * + * @summary Gets the details of the recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Get.json + */ +async function getsTheRequestedRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.get( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +getsTheRequestedRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansListSample.ts new file mode 100644 index 000000000000..96720aa2b0f0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the recovery plans in the vault. + * + * @summary Lists the recovery plans in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_List.json + */ +async function getsTheListOfRecoveryPlans() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationRecoveryPlans.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRecoveryPlans().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansPlannedFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansPlannedFailoverSample.ts new file mode 100644 index 000000000000..32dcf3a219dd --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansPlannedFailoverSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RecoveryPlanPlannedFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start the planned failover of a recovery plan. + * + * @summary The operation to start the planned failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_PlannedFailover.json + */ +async function executePlannedFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: RecoveryPlanPlannedFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: [{ instanceType: "HyperVReplicaAzure" }] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginPlannedFailoverAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executePlannedFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansReprotectSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansReprotectSample.ts new file mode 100644 index 000000000000..a10db922a8ba --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansReprotectSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to reprotect(reverse replicate) a recovery plan. + * + * @summary The operation to reprotect(reverse replicate) a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Reprotect.json + */ +async function executeReprotectOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginReprotectAndWait( + resourceName, + resourceGroupName, + recoveryPlanName + ); + console.log(result); +} + +executeReprotectOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansTestFailoverCleanupSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansTestFailoverCleanupSample.ts new file mode 100644 index 000000000000..5d0bf6ac9c34 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansTestFailoverCleanupSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RecoveryPlanTestFailoverCleanupInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to cleanup test failover of a recovery plan. + * + * @summary The operation to cleanup test failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json + */ +async function executeTestFailoverCleanupOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: RecoveryPlanTestFailoverCleanupInput = { + properties: { comments: "Test Failover Cleanup" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginTestFailoverCleanupAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executeTestFailoverCleanupOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansTestFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansTestFailoverSample.ts new file mode 100644 index 000000000000..f4f4e1ce9f47 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansTestFailoverSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RecoveryPlanTestFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start the test failover of a recovery plan. + * + * @summary The operation to start the test failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_TestFailover.json + */ +async function executeTestFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: RecoveryPlanTestFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + networkId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/siterecoveryProd1/providers/Microsoft.Network/virtualNetworks/vnetavrai", + networkType: "VmNetworkAsInput", + providerSpecificDetails: [{ instanceType: "HyperVReplicaAzure" }] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginTestFailoverAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executeTestFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansUnplannedFailoverSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansUnplannedFailoverSample.ts new file mode 100644 index 000000000000..ea3aa4e828e9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansUnplannedFailoverSample.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RecoveryPlanUnplannedFailoverInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to start the unplanned failover of a recovery plan. + * + * @summary The operation to start the unplanned failover of a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json + */ +async function executeUnplannedFailoverOfTheRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: RecoveryPlanUnplannedFailoverInput = { + properties: { + failoverDirection: "PrimaryToRecovery", + providerSpecificDetails: [{ instanceType: "HyperVReplicaAzure" }], + sourceSiteOperations: "Required" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginUnplannedFailoverAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +executeUnplannedFailoverOfTheRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansUpdateSample.ts new file mode 100644 index 000000000000..19863855430b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryPlansUpdateSample.ts @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateRecoveryPlanInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a recovery plan. + * + * @summary The operation to update a recovery plan. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryPlans_Update.json + */ +async function updatesTheGivenRecoveryPlan() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const recoveryPlanName = "RPtest1"; + const input: UpdateRecoveryPlanInput = { + properties: { + groups: [ + { + endGroupActions: [], + groupType: "Shutdown", + replicationProtectedItems: [], + startGroupActions: [] + }, + { + endGroupActions: [], + groupType: "Failover", + replicationProtectedItems: [], + startGroupActions: [] + }, + { + endGroupActions: [], + groupType: "Boot", + replicationProtectedItems: [ + { + id: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/f8491e4f-817a-40dd-a90c-af773978c75b", + virtualMachineId: "f8491e4f-817a-40dd-a90c-af773978c75b" + } + ], + startGroupActions: [] + }, + { + endGroupActions: [], + groupType: "Boot", + replicationProtectedItems: [ + { + id: + "/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/cloud1/replicationProtectionContainers/cloud_6d224fc6-f326-5d35-96de-fbf51efb3179/replicationProtectedItems/c0c14913-3d7a-48ea-9531-cc99e0e686e6", + virtualMachineId: "c0c14913-3d7a-48ea-9531-cc99e0e686e6" + } + ], + startGroupActions: [] + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryPlans.beginUpdateAndWait( + resourceName, + resourceGroupName, + recoveryPlanName, + input + ); + console.log(result); +} + +updatesTheGivenRecoveryPlan().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersCreateSample.ts new file mode 100644 index 000000000000..dd7b3ff744b8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersCreateSample.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AddRecoveryServicesProviderInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to add a recovery services provider. + * + * @summary The operation to add a recovery services provider. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Create.json + */ +async function addsARecoveryServicesProvider() { + const subscriptionId = "cb53d0c3-bd59-4721-89bc-06916a9147ef"; + const resourceName = "migrationvault"; + const resourceGroupName = "resourcegroup1"; + const fabricName = "vmwarefabric1"; + const providerName = "vmwareprovider1"; + const addProviderInput: AddRecoveryServicesProviderInput = { + properties: { + authenticationIdentityInput: { + aadAuthority: "https://login.microsoftonline.com", + applicationId: "f66fce08-c0c6-47a1-beeb-0ede5ea94f90", + audience: + "https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874", + objectId: "141360b8-5686-4240-a027-5e24e6affeba", + tenantId: "72f988bf-86f1-41af-91ab-2d7cd011db47" + }, + machineName: "vmwareprovider1", + resourceAccessIdentityInput: { + aadAuthority: "https://login.microsoftonline.com", + applicationId: "f66fce08-c0c6-47a1-beeb-0ede5ea94f90", + audience: + "https://microsoft.onmicrosoft.com/cf19e349-644c-4c6a-bcae-9c8f35357874", + objectId: "141360b8-5686-4240-a027-5e24e6affeba", + tenantId: "72f988bf-86f1-41af-91ab-2d7cd011db47" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName, + addProviderInput + ); + console.log(result); +} + +addsARecoveryServicesProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersDeleteSample.ts new file mode 100644 index 000000000000..f3d9c70877c6 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to removes/delete(unregister) a recovery services provider from the vault. + * + * @summary The operation to removes/delete(unregister) a recovery services provider from the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Delete.json + */ +async function deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +deletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersGetSample.ts new file mode 100644 index 000000000000..780494796678 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of registered recovery services provider. + * + * @summary Gets the details of registered recovery services provider. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Get.json + */ +async function getsTheDetailsOfARecoveryServicesProvider() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.get( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +getsTheDetailsOfARecoveryServicesProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..b331187b5cb1 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersListByReplicationFabricsSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the registered recovery services providers for the specified fabric. + * + * @summary Lists the registered recovery services providers for the specified fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json + */ +async function getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationRecoveryServicesProviders.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRegisteredRecoveryServicesProvidersForTheFabric().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersListSample.ts new file mode 100644 index 000000000000..64745f53a0de --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the registered recovery services providers in the vault. + * + * @summary Lists the registered recovery services providers in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_List.json + */ +async function getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationRecoveryServicesProviders.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersPurgeSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersPurgeSample.ts new file mode 100644 index 000000000000..0606e4d4f24b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersPurgeSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to purge(force delete) a recovery services provider from the vault. + * + * @summary The operation to purge(force delete) a recovery services provider from the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_Purge.json + */ +async function purgesRecoveryServiceProviderFromFabric() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginPurgeAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +purgesRecoveryServiceProviderFromFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersRefreshProviderSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersRefreshProviderSample.ts new file mode 100644 index 000000000000..f836ca3267c2 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationRecoveryServicesProvidersRefreshProviderSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to refresh the information from the recovery services provider. + * + * @summary The operation to refresh the information from the recovery services provider. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json + */ +async function refreshDetailsFromTheRecoveryServicesProvider() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = "cloud1"; + const providerName = "241641e6-ee7b-4ee4-8141-821fadda43fa"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationRecoveryServicesProviders.beginRefreshProviderAndWait( + resourceName, + resourceGroupName, + fabricName, + providerName + ); + console.log(result); +} + +refreshDetailsFromTheRecoveryServicesProvider().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsCreateSample.ts new file mode 100644 index 000000000000..f317663dfbce --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsCreateSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageClassificationMappingInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a storage classification mapping. + * + * @summary The operation to create a storage classification mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Create.json + */ +async function createStorageClassificationMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const storageClassificationMappingName = "testStorageMapping"; + const pairingInput: StorageClassificationMappingInput = { + properties: { + targetStorageClassificationId: + "/Subscriptions/9112a37f-0f3e-46ec-9c00-060c6edca071/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0/replicationStorageClassifications/8891569e-aaef-4a46-a4a0-78c14f2d7b09" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassificationMappings.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName, + pairingInput + ); + console.log(result); +} + +createStorageClassificationMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsDeleteSample.ts new file mode 100644 index 000000000000..a54d64c53e8d --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to delete a storage classification mapping. + * + * @summary The operation to delete a storage classification mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Delete.json + */ +async function deleteAStorageClassificationMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const storageClassificationMappingName = "testStorageMapping"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassificationMappings.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName + ); + console.log(result); +} + +deleteAStorageClassificationMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsGetSample.ts new file mode 100644 index 000000000000..4da6522debe8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsGetSample.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of the specified storage classification mapping. + * + * @summary Gets the details of the specified storage classification mapping. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_Get.json + */ +async function getsTheDetailsOfAStorageClassificationMapping() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const storageClassificationMappingName = "testStorageMapping"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassificationMappings.get( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + storageClassificationMappingName + ); + console.log(result); +} + +getsTheDetailsOfAStorageClassificationMapping().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.ts new file mode 100644 index 000000000000..bc865654bd80 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsListByReplicationStorageClassificationsSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the storage classification mappings for the fabric. + * + * @summary Lists the storage classification mappings for the fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json + */ +async function getsTheListOfStorageClassificationMappingsObjectsUnderAStorage() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassificationMappings.listByReplicationStorageClassifications( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationMappingsObjectsUnderAStorage().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsListSample.ts new file mode 100644 index 000000000000..1da1ac312b81 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationMappingsListSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the storage classification mappings in the vault. + * + * @summary Lists the storage classification mappings in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassificationMappings_List.json + */ +async function getsTheListOfStorageClassificationMappingsObjectsUnderAVault() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassificationMappings.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationMappingsObjectsUnderAVault().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsGetSample.ts new file mode 100644 index 000000000000..8fe2b3ab59d0 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsGetSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of the specified storage classification. + * + * @summary Gets the details of the specified storage classification. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_Get.json + */ +async function getsTheDetailsOfAStorageClassification() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const storageClassificationName = "8891569e-aaef-4a46-a4a0-78c14f2d7b09"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationStorageClassifications.get( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName + ); + console.log(result); +} + +getsTheDetailsOfAStorageClassification().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..05dd52546a59 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsListByReplicationFabricsSample.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the storage classifications available in the specified fabric. + * + * @summary Lists the storage classifications available in the specified fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json + */ +async function getsTheListOfStorageClassificationObjectsUnderAFabric() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const fabricName = + "2a48e3770ac08aa2be8bfbd94fcfb1cbf2dcc487b78fb9d3bd778304441b06a0"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassifications.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationObjectsUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsListSample.ts new file mode 100644 index 000000000000..dce2d91e42b5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationStorageClassificationsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the storage classifications in the vault. + * + * @summary Lists the storage classifications in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationStorageClassifications_List.json + */ +async function getsTheListOfStorageClassificationObjectsUnderAVault() { + const subscriptionId = "9112a37f-0f3e-46ec-9c00-060c6edca071"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationStorageClassifications.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfStorageClassificationObjectsUnderAVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultHealthGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultHealthGetSample.ts new file mode 100644 index 000000000000..835e6cfb7e4a --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultHealthGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the health details of the vault. + * + * @summary Gets the health details of the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Get.json + */ +async function getsTheHealthSummaryForTheVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultHealth.get( + resourceName, + resourceGroupName + ); + console.log(result); +} + +getsTheHealthSummaryForTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultHealthRefreshSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultHealthRefreshSample.ts new file mode 100644 index 000000000000..60083d6ba4f3 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultHealthRefreshSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Refreshes health summary of the vault. + * + * @summary Refreshes health summary of the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultHealth_Refresh.json + */ +async function refreshesHealthSummaryOfTheVault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultHealth.beginRefreshAndWait( + resourceName, + resourceGroupName + ); + console.log(result); +} + +refreshesHealthSummaryOfTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingCreateSample.ts new file mode 100644 index 000000000000..d199b101bfe8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingCreateSample.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + VaultSettingCreationInput, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to configure vault setting. + * + * @summary The operation to configure vault setting. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Create.json + */ +async function updatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const vaultSettingName = "default"; + const input: VaultSettingCreationInput = { + properties: { + migrationSolutionId: + "/subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.Migrate/MigrateProjects/resourceGroupPS1-MigrateProject/Solutions/Servers-Migration-ServerMigration" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultSetting.beginCreateAndWait( + resourceName, + resourceGroupName, + vaultSettingName, + input + ); + console.log(result); +} + +updatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingGetSample.ts new file mode 100644 index 000000000000..12395932e52b --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the vault setting. This includes the Migration Hub connection settings. + * + * @summary Gets the vault setting. This includes the Migration Hub connection settings. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_Get.json + */ +async function getsTheVaultSetting() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const vaultSettingName = "default"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationVaultSetting.get( + resourceName, + resourceGroupName, + vaultSettingName + ); + console.log(result); +} + +getsTheVaultSetting().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingListSample.ts new file mode 100644 index 000000000000..c5e3b61c5804 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationVaultSettingListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the list of vault setting. This includes the Migration Hub connection settings. + * + * @summary Gets the list of vault setting. This includes the Migration Hub connection settings. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationVaultSetting_List.json + */ +async function getsTheListOfVaultSetting() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationVaultSetting.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfVaultSetting().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersCreateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersCreateSample.ts new file mode 100644 index 000000000000..e113bbee9bfc --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersCreateSample.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AddVCenterRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to create a vCenter object.. + * + * @summary The operation to create a vCenter object.. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Create.json + */ +async function addVCenter() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const addVCenterRequest: AddVCenterRequest = { + properties: { + friendlyName: "esx-78", + ipAddress: "inmtest78", + port: "443", + processServerId: "5A720CAB-39CB-F445-BD1662B0B33164B5", + runAsAccountId: "2" + } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.beginCreateAndWait( + resourceName, + resourceGroupName, + fabricName, + vcenterName, + addVCenterRequest + ); + console.log(result); +} + +addVCenter().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersDeleteSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersDeleteSample.ts new file mode 100644 index 000000000000..63e685b42572 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to remove(unregister) a registered vCenter server from the vault. + * + * @summary The operation to remove(unregister) a registered vCenter server from the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Delete.json + */ +async function removeVCenterOperation() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.beginDeleteAndWait( + resourceName, + resourceGroupName, + fabricName, + vcenterName + ); + console.log(result); +} + +removeVCenterOperation().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersGetSample.ts new file mode 100644 index 000000000000..aaa72abdda45 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersGetSample.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the details of a registered vCenter server(Add vCenter server). + * + * @summary Gets the details of a registered vCenter server(Add vCenter server). + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Get.json + */ +async function getsTheDetailsOfAVCenter() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.get( + resourceName, + resourceGroupName, + fabricName, + vcenterName + ); + console.log(result); +} + +getsTheDetailsOfAVCenter().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersListByReplicationFabricsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersListByReplicationFabricsSample.ts new file mode 100644 index 000000000000..357dd26cb176 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersListByReplicationFabricsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the vCenter servers registered in a fabric. + * + * @summary Lists the vCenter servers registered in a fabric. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_ListByReplicationFabrics.json + */ +async function getsTheListOfVCenterRegisteredUnderAFabric() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationvCenters.listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfVCenterRegisteredUnderAFabric().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersListSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersListSample.ts new file mode 100644 index 000000000000..cddacb0618e8 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the vCenter servers registered in the vault. + * + * @summary Lists the vCenter servers registered in the vault. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_List.json + */ +async function getsTheListOfVCenterRegisteredUnderTheVault() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.replicationvCenters.list( + resourceName, + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfVCenterRegisteredUnderTheVault().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersUpdateSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersUpdateSample.ts new file mode 100644 index 000000000000..4133ba16f856 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/replicationvCentersUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + UpdateVCenterRequest, + SiteRecoveryManagementClient +} from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to The operation to update a registered vCenter. + * + * @summary The operation to update a registered vCenter. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/ReplicationvCenters_Update.json + */ +async function updateVCenterOperation() { + const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + const resourceName = "MadhaviVault"; + const resourceGroupName = "MadhaviVRG"; + const fabricName = "MadhaviFabric"; + const vcenterName = "esx-78"; + const updateVCenterRequest: UpdateVCenterRequest = { + properties: { ipAddress: "10.150.109.25" } + }; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.replicationvCenters.beginUpdateAndWait( + resourceName, + resourceGroupName, + fabricName, + vcenterName, + updateVCenterRequest + ); + console.log(result); +} + +updateVCenterOperation().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/supportedOperatingSystemsGetSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/supportedOperatingSystemsGetSample.ts new file mode 100644 index 000000000000..6b012968ea42 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/supportedOperatingSystemsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the data of supported operating systems by SRS. + * + * @summary Gets the data of supported operating systems by SRS. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/SupportedOperatingSystems_Get.json + */ +async function getsTheDataOfSupportedOperatingSystemsBySrs() { + const subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + const resourceName = "vault1"; + const resourceGroupName = "resourceGroupPS1"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const result = await client.supportedOperatingSystemsOperations.get( + resourceName, + resourceGroupName + ); + console.log(result); +} + +getsTheDataOfSupportedOperatingSystemsBySrs().catch(console.error); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/targetComputeSizesListByReplicationProtectedItemsSample.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/targetComputeSizesListByReplicationProtectedItemsSample.ts new file mode 100644 index 000000000000..23bd00ac86f9 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/src/targetComputeSizesListByReplicationProtectedItemsSample.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { SiteRecoveryManagementClient } from "@azure/arm-recoveryservices-siterecovery"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the available target compute sizes for a replication protected item. + * + * @summary Lists the available target compute sizes for a replication protected item. + * x-ms-original-file: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2022-10-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json + */ +async function getsTheListOfTargetComputeSizesForTheReplicationProtectedItem() { + const subscriptionId = "6808dbbc-98c7-431f-a1b1-9580902423b7"; + const resourceName = "avraiMgDiskVault"; + const resourceGroupName = "avraiMgDiskVaultRG"; + const fabricName = "asr-a2a-default-centraluseuap"; + const protectionContainerName = "asr-a2a-default-centraluseuap-container"; + const replicatedProtectedItemName = "468c912d-b1ab-4ea2-97eb-4b5095155db2"; + const credential = new DefaultAzureCredential(); + const client = new SiteRecoveryManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.targetComputeSizes.listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getsTheListOfTargetComputeSizesForTheReplicationProtectedItem().catch( + console.error +); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/tsconfig.json b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/samples/v5/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/index.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/index.ts index 258c2aec28d4..39abb0c800e2 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/index.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/index.ts @@ -7,6 +7,7 @@ */ /// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { SiteRecoveryManagementClient } from "./siteRecoveryManagementClient"; export * from "./operationsInterfaces"; diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/index.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/index.ts index b6b5eda2337b..e9bcad71727f 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/index.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/index.ts @@ -70,6 +70,9 @@ export type UpdateMigrationItemProviderSpecificInputUnion = export type MigrateProviderSpecificInputUnion = | MigrateProviderSpecificInput | VMwareCbtMigrateInput; +export type ResumeReplicationProviderSpecificInputUnion = + | ResumeReplicationProviderSpecificInput + | VMwareCbtResumeReplicationInput; export type ResyncProviderSpecificInputUnion = | ResyncProviderSpecificInput | VMwareCbtResyncInput; @@ -896,6 +899,16 @@ export interface MigrationItemProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly policyFriendlyName?: string; + /** + * The recovery services provider ARM Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recoveryServicesProviderId?: string; + /** + * The replication status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly replicationStatus?: string; /** * The migration status. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -916,6 +929,16 @@ export interface MigrationItemProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastTestMigrationStatus?: string; + /** + * The last migration time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastMigrationTime?: Date; + /** + * The status of the last migration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastMigrationStatus?: string; /** * The test migrate state. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -946,6 +969,11 @@ export interface MigrationItemProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly currentJob?: CurrentJobDetails; + /** + * The critical past job details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly criticalJobHistory?: CriticalJobHistoryDetails[]; /** * The correlation Id for events associated with this migration item. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -974,6 +1002,30 @@ export interface CurrentJobDetails { readonly startTime?: Date; } +/** Critical past job details of the migration item. */ +export interface CriticalJobHistoryDetails { + /** + * The job name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly jobName?: string; + /** + * The ARM Id of the job being executed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly jobId?: string; + /** + * The start time of the job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startTime?: Date; + /** + * The job state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly jobStatus?: string; +} + /** Migration provider specific settings. */ export interface MigrationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -1058,6 +1110,36 @@ export interface MigrationRecoveryPointProperties { readonly recoveryPointType?: MigrationRecoveryPointType; } +/** Pause replication input. */ +export interface PauseReplicationInput { + /** Pause replication input properties. */ + properties: PauseReplicationInputProperties; +} + +/** Pause replication input properties. */ +export interface PauseReplicationInputProperties { + /** The class type. */ + instanceType: string; +} + +/** Resume replication input. */ +export interface ResumeReplicationInput { + /** Resume replication input properties. */ + properties: ResumeReplicationInputProperties; +} + +/** Resume replication input properties. */ +export interface ResumeReplicationInputProperties { + /** The provider specific input for resume replication. */ + providerSpecificDetails: ResumeReplicationProviderSpecificInputUnion; +} + +/** Resume replication provider specific input. */ +export interface ResumeReplicationProviderSpecificInput { + /** Polymorphic discriminator, which specifies the different types this object can be */ + instanceType: "VMwareCbt"; +} + /** Resync input. */ export interface ResyncInput { /** Resync input properties. */ @@ -2782,6 +2864,14 @@ export interface ExtendedLocation { type: ExtendedLocationType; } +/** ExtendedLocation details data. */ +export interface A2AExtendedLocationDetails { + /** The primary ExtendedLocation. */ + primaryExtendedLocation?: ExtendedLocation; + /** The recovery ExtendedLocation. */ + recoveryExtendedLocation?: ExtendedLocation; +} + /** A2A protected disk details. */ export interface A2AProtectedDiskDetails { /** The disk uri. */ @@ -4651,6 +4741,11 @@ export interface InMageRcmProtectedDiskDetails { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly seedManagedDiskId?: string; + /** + * The uri of the seed blob. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly seedBlobUri?: string; /** * The ARM Id of the target managed disk. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -5018,11 +5113,21 @@ export interface VMwareCbtProtectedDiskDetails { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly seedManagedDiskId?: string; + /** + * The uri of the seed blob. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly seedBlobUri?: string; /** * The ARM Id of the target managed disk. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly targetManagedDiskId?: string; + /** + * The uri of the target blob. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly targetBlobUri?: string; /** The name for the target managed disk. */ targetDiskName?: string; } @@ -5057,6 +5162,14 @@ export interface VMwareCbtNicDetails { targetIPAddressType?: EthernetAddressType; /** Target subnet name. */ targetSubnetName?: string; + /** Source network Id. */ + testNetworkId?: string; + /** Test subnet name. */ + testSubnetName?: string; + /** The test IP address. */ + testIPAddress?: string; + /** The test IP address type. */ + testIPAddressType?: EthernetAddressType; /** Target NIC name. */ targetNicName?: string; /** A value indicating whether this NIC is selected for migration. */ @@ -5077,6 +5190,10 @@ export interface VMwareCbtNicInput { isSelectedForMigration?: string; /** Target NIC name. */ targetNicName?: string; + /** The test subnet name. */ + testSubnetName?: string; + /** The test static IP address. */ + testStaticIPAddress?: string; } /** VMwareCbt disk input for update. */ @@ -5085,154 +5202,157 @@ export interface VMwareCbtUpdateDiskInput { diskId: string; /** The target disk name. */ targetDiskName?: string; + /** A value indicating whether the disk is the OS disk. */ + isOSDisk?: string; } /** Implements the Alert class. */ -export type Alert = Resource & { +export interface Alert extends Resource { /** Alert related data. */ properties?: AlertProperties; -}; +} /** Implements the Event class. */ -export type Event = Resource & { +export interface Event extends Resource { /** Event related data. */ properties?: EventProperties; -}; +} /** Fabric definition. */ -export type Fabric = Resource & { +export interface Fabric extends Resource { /** Fabric related data. */ properties?: FabricProperties; -}; +} /** Logical network data model. */ -export type LogicalNetwork = Resource & { +export interface LogicalNetwork extends Resource { /** The Logical Network Properties. */ properties?: LogicalNetworkProperties; -}; +} /** Network model. */ -export type Network = Resource & { +export interface Network extends Resource { /** The Network Properties. */ properties?: NetworkProperties; -}; +} /** Network Mapping model. Ideally it should have been possible to inherit this class from prev version in InheritedModels as long as there is no difference in structure or method signature. Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load with required return type, the class has been introduced in its entirety with references to base models to facilitate extensions in subsequent versions. */ -export type NetworkMapping = Resource & { +export interface NetworkMapping extends Resource { /** The Network Mapping Properties. */ properties?: NetworkMappingProperties; -}; +} /** Protection container details. */ -export type ProtectionContainer = Resource & { +export interface ProtectionContainer extends Resource { /** The custom data. */ properties?: ProtectionContainerProperties; -}; +} /** Migration item. */ -export type MigrationItem = Resource & { +export interface MigrationItem extends Resource { /** The migration item properties. */ properties?: MigrationItemProperties; -}; +} /** Recovery point for a migration item. */ -export type MigrationRecoveryPoint = Resource & { +export interface MigrationRecoveryPoint extends Resource { /** Recovery point properties. */ properties?: MigrationRecoveryPointProperties; -}; +} /** Replication protected item. */ -export type ProtectableItem = Resource & { +export interface ProtectableItem extends Resource { /** The custom data. */ properties?: ProtectableItemProperties; -}; +} /** Replication protected item. */ -export type ReplicationProtectedItem = Resource & { +export interface ReplicationProtectedItem extends Resource { /** The custom data. */ properties?: ReplicationProtectedItemProperties; -}; +} /** Recovery point. */ -export type RecoveryPoint = Resource & { +export interface RecoveryPoint extends Resource { /** The recovery point properties. */ properties?: RecoveryPointProperties; -}; +} /** Protection container mapping object. */ -export type ProtectionContainerMapping = Resource & { +export interface ProtectionContainerMapping extends Resource { /** The custom data. */ properties?: ProtectionContainerMappingProperties; -}; +} /** Provider details. */ -export type RecoveryServicesProvider = Resource & { +export interface RecoveryServicesProvider extends Resource { /** Provider properties. */ properties?: RecoveryServicesProviderProperties; -}; +} /** Storage object definition. */ -export type StorageClassification = Resource & { +export interface StorageClassification extends Resource { /** Properties of the storage object. */ properties?: StorageClassificationProperties; -}; +} /** Storage mapping object. */ -export type StorageClassificationMapping = Resource & { +export interface StorageClassificationMapping extends Resource { /** Properties of the storage mapping object. */ properties?: StorageClassificationMappingProperties; -}; +} /** vCenter definition. */ -export type VCenter = Resource & { +export interface VCenter extends Resource { /** VCenter related data. */ properties?: VCenterProperties; -}; +} /** Job details. */ -export type Job = Resource & { +export interface Job extends Resource { /** The custom data. */ properties?: JobProperties; -}; +} /** Protection profile details. */ -export type Policy = Resource & { +export interface Policy extends Resource { /** The custom data. */ properties?: PolicyProperties; -}; +} /** Replication protection intent. */ -export type ReplicationProtectionIntent = Resource & { +export interface ReplicationProtectionIntent extends Resource { /** The custom data. */ properties?: ReplicationProtectionIntentProperties; -}; +} /** Recovery plan details. */ -export type RecoveryPlan = Resource & { +export interface RecoveryPlan extends Resource { /** The custom details. */ properties?: RecoveryPlanProperties; -}; +} /** Supported operating systems. */ -export type SupportedOperatingSystems = Resource & { +export interface SupportedOperatingSystems extends Resource { /** The supported operating systems properties. */ properties?: SupportedOSProperties; -}; +} /** Vault health details definition. */ -export type VaultHealthDetails = Resource & { +export interface VaultHealthDetails extends Resource { /** The vault health related data. */ properties?: VaultHealthProperties; -}; +} /** Vault setting. */ -export type VaultSetting = Resource & { +export interface VaultSetting extends Resource { /** The vault setting properties. */ properties?: VaultSettingProperties; -}; +} /** InMageRcm appliance specific details. */ -export type InMageRcmApplianceSpecificDetails = ApplianceSpecificDetails & { +export interface InMageRcmApplianceSpecificDetails + extends ApplianceSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** @@ -5240,10 +5360,10 @@ export type InMageRcmApplianceSpecificDetails = ApplianceSpecificDetails & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly appliances?: InMageRcmApplianceDetails[]; -}; +} /** Model class for event details of a A2A event. */ -export type A2AEventDetails = EventProviderSpecificDetails & { +export interface A2AEventDetails extends EventProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The protected item arm name. */ @@ -5258,10 +5378,11 @@ export type A2AEventDetails = EventProviderSpecificDetails & { remoteFabricName?: string; /** Remote fabric location. */ remoteFabricLocation?: string; -}; +} /** Model class for event details of a HyperVReplica E2E event. */ -export type HyperVReplica2012EventDetails = EventProviderSpecificDetails & { +export interface HyperVReplica2012EventDetails + extends EventProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplica2012"; /** The container friendly name. */ @@ -5272,10 +5393,11 @@ export type HyperVReplica2012EventDetails = EventProviderSpecificDetails & { remoteContainerName?: string; /** The remote fabric name. */ remoteFabricName?: string; -}; +} /** Model class for event details of a HyperVReplica blue E2E event. */ -export type HyperVReplica2012R2EventDetails = EventProviderSpecificDetails & { +export interface HyperVReplica2012R2EventDetails + extends EventProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplica2012R2"; /** The container friendly name. */ @@ -5286,10 +5408,11 @@ export type HyperVReplica2012R2EventDetails = EventProviderSpecificDetails & { remoteContainerName?: string; /** The remote fabric name. */ remoteFabricName?: string; -}; +} /** Model class for event details of a HyperVReplica E2A event. */ -export type HyperVReplicaAzureEventDetails = EventProviderSpecificDetails & { +export interface HyperVReplicaAzureEventDetails + extends EventProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** The container friendly name. */ @@ -5298,10 +5421,11 @@ export type HyperVReplicaAzureEventDetails = EventProviderSpecificDetails & { fabricName?: string; /** The remote container name. */ remoteContainerName?: string; -}; +} /** Abstract model class for event details of a HyperVReplica E2E event. */ -export type HyperVReplicaBaseEventDetails = EventProviderSpecificDetails & { +export interface HyperVReplicaBaseEventDetails + extends EventProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaBaseEventDetails"; /** The container friendly name. */ @@ -5312,10 +5436,11 @@ export type HyperVReplicaBaseEventDetails = EventProviderSpecificDetails & { remoteContainerName?: string; /** The remote fabric name. */ remoteFabricName?: string; -}; +} /** Model class for event details of a VMwareAzureV2 event. */ -export type InMageAzureV2EventDetails = EventProviderSpecificDetails & { +export interface InMageAzureV2EventDetails + extends EventProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. */ @@ -5332,10 +5457,10 @@ export type InMageAzureV2EventDetails = EventProviderSpecificDetails & { summary?: string; /** VMware Site name. */ siteName?: string; -}; +} /** Event details for InMageRcm provider. */ -export type InMageRcmEventDetails = EventProviderSpecificDetails & { +export interface InMageRcmEventDetails extends EventProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** @@ -5378,10 +5503,11 @@ export type InMageRcmEventDetails = EventProviderSpecificDetails & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly componentDisplayName?: string; -}; +} /** Event details for InMageRcmFailback provider. */ -export type InMageRcmFailbackEventDetails = EventProviderSpecificDetails & { +export interface InMageRcmFailbackEventDetails + extends EventProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcmFailback"; /** @@ -5409,10 +5535,10 @@ export type InMageRcmFailbackEventDetails = EventProviderSpecificDetails & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly componentDisplayName?: string; -}; +} /** Event details for VMwareCbt provider. */ -export type VMwareCbtEventDetails = EventProviderSpecificDetails & { +export interface VMwareCbtEventDetails extends EventProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** @@ -5420,10 +5546,10 @@ export type VMwareCbtEventDetails = EventProviderSpecificDetails & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly migrationItemName?: string; -}; +} /** Model class for event details of a job status event. */ -export type JobStatusEventDetails = EventSpecificDetails & { +export interface JobStatusEventDetails extends EventSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "JobStatus"; /** Job arm id for the event. */ @@ -5434,10 +5560,10 @@ export type JobStatusEventDetails = EventSpecificDetails & { jobStatus?: string; /** AffectedObjectType for the event. */ affectedObjectType?: string; -}; +} /** Azure Fabric Specific Details. */ -export type AzureFabricSpecificDetails = FabricSpecificDetails & { +export interface AzureFabricSpecificDetails extends FabricSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "Azure"; /** The Location for the Azure fabric. */ @@ -5446,18 +5572,20 @@ export type AzureFabricSpecificDetails = FabricSpecificDetails & { containerIds?: string[]; /** The zones. */ zones?: A2AZoneDetails[]; -}; + /** The ExtendedLocations. */ + extendedLocations?: A2AExtendedLocationDetails[]; +} /** HyperVSite fabric specific details. */ -export type HyperVSiteDetails = FabricSpecificDetails & { +export interface HyperVSiteDetails extends FabricSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVSite"; /** The list of Hyper-V hosts associated with the fabric. */ hyperVHosts?: HyperVHostDetails[]; -}; +} /** InMageRcm fabric specific details. */ -export type InMageRcmFabricSpecificDetails = FabricSpecificDetails & { +export interface InMageRcmFabricSpecificDetails extends FabricSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** @@ -5537,16 +5665,16 @@ export type InMageRcmFabricSpecificDetails = FabricSpecificDetails & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly agentDetails?: AgentDetails[]; -}; +} /** VMM fabric specific details. */ -export type VmmDetails = FabricSpecificDetails & { +export interface VmmDetails extends FabricSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMM"; -}; +} /** Store the fabric details specific to the VMware fabric. */ -export type VMwareDetails = FabricSpecificDetails & { +export interface VMwareDetails extends FabricSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMware"; /** The list of Process Servers associated with the fabric. */ @@ -5615,10 +5743,10 @@ export type VMwareDetails = FabricSpecificDetails & { agentVersionDetails?: VersionDetails; /** The switch provider blocking error information. */ switchProviderBlockingErrorDetails?: InMageFabricSwitchProviderBlockingErrorDetails[]; -}; +} /** VMwareV2 fabric specific details. */ -export type VMwareV2FabricSpecificDetails = FabricSpecificDetails & { +export interface VMwareV2FabricSpecificDetails extends FabricSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareV2"; /** @@ -5656,18 +5784,19 @@ export type VMwareV2FabricSpecificDetails = FabricSpecificDetails & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly processServers?: ProcessServerDetails[]; -}; +} /** Fabric provider specific settings. */ -export type AzureFabricCreationInput = FabricSpecificCreationInput & { +export interface AzureFabricCreationInput extends FabricSpecificCreationInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "Azure"; /** The Location. */ location?: string; -}; +} /** InMageRcm fabric provider specific settings. */ -export type InMageRcmFabricCreationInput = FabricSpecificCreationInput & { +export interface InMageRcmFabricCreationInput + extends FabricSpecificCreationInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The ARM Id of the VMware site. */ @@ -5676,10 +5805,11 @@ export type InMageRcmFabricCreationInput = FabricSpecificCreationInput & { physicalSiteId: string; /** The identity provider input for source agent authentication. */ sourceAgentIdentity: IdentityProviderInput; -}; +} /** VMwareV2 fabric provider specific settings. */ -export type VMwareV2FabricCreationInput = FabricSpecificCreationInput & { +export interface VMwareV2FabricCreationInput + extends FabricSpecificCreationInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareV2"; /** The ARM Id of the VMware site. */ @@ -5688,90 +5818,103 @@ export type VMwareV2FabricCreationInput = FabricSpecificCreationInput & { physicalSiteId?: string; /** The ARM Id of the migration solution. */ migrationSolutionId: string; -}; +} /** A2A Network Mapping fabric specific settings. */ -export type AzureToAzureNetworkMappingSettings = NetworkMappingFabricSpecificSettings & { +export interface AzureToAzureNetworkMappingSettings + extends NetworkMappingFabricSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "AzureToAzure"; /** The primary fabric location. */ primaryFabricLocation?: string; /** The recovery fabric location. */ recoveryFabricLocation?: string; -}; +} /** E2A Network Mapping fabric specific settings. */ -export type VmmToAzureNetworkMappingSettings = NetworkMappingFabricSpecificSettings & { +export interface VmmToAzureNetworkMappingSettings + extends NetworkMappingFabricSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VmmToAzure"; -}; +} /** E2E Network Mapping fabric specific settings. */ -export type VmmToVmmNetworkMappingSettings = NetworkMappingFabricSpecificSettings & { +export interface VmmToVmmNetworkMappingSettings + extends NetworkMappingFabricSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VmmToVmm"; -}; +} /** Create network mappings input properties/behavior specific to Azure to Azure Network mapping. */ -export type AzureToAzureCreateNetworkMappingInput = FabricSpecificCreateNetworkMappingInput & { +export interface AzureToAzureCreateNetworkMappingInput + extends FabricSpecificCreateNetworkMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "AzureToAzure"; /** The primary azure vnet Id. */ primaryNetworkId: string; -}; +} /** Create network mappings input properties/behavior specific to Vmm to Azure Network mapping. */ -export type VmmToAzureCreateNetworkMappingInput = FabricSpecificCreateNetworkMappingInput & { +export interface VmmToAzureCreateNetworkMappingInput + extends FabricSpecificCreateNetworkMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VmmToAzure"; -}; +} /** Create network mappings input properties/behavior specific to vmm to vmm Network mapping. */ -export type VmmToVmmCreateNetworkMappingInput = FabricSpecificCreateNetworkMappingInput & { +export interface VmmToVmmCreateNetworkMappingInput + extends FabricSpecificCreateNetworkMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VmmToVmm"; -}; +} /** Updates network mappings input. */ -export type AzureToAzureUpdateNetworkMappingInput = FabricSpecificUpdateNetworkMappingInput & { +export interface AzureToAzureUpdateNetworkMappingInput + extends FabricSpecificUpdateNetworkMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "AzureToAzure"; /** The primary azure vnet Id. */ primaryNetworkId?: string; -}; +} /** Update network mappings input properties/behavior specific to vmm to azure. */ -export type VmmToAzureUpdateNetworkMappingInput = FabricSpecificUpdateNetworkMappingInput & { +export interface VmmToAzureUpdateNetworkMappingInput + extends FabricSpecificUpdateNetworkMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VmmToAzure"; -}; +} /** Update network mappings input properties/behavior specific to vmm to vmm. */ -export type VmmToVmmUpdateNetworkMappingInput = FabricSpecificUpdateNetworkMappingInput & { +export interface VmmToVmmUpdateNetworkMappingInput + extends FabricSpecificUpdateNetworkMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VmmToVmm"; -}; +} /** A2A cloud creation input. */ -export type A2AContainerCreationInput = ReplicationProviderSpecificContainerCreationInput & { +export interface A2AContainerCreationInput + extends ReplicationProviderSpecificContainerCreationInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; -}; +} /** A2ACrossClusterMigration cloud creation input. */ -export type A2ACrossClusterMigrationContainerCreationInput = ReplicationProviderSpecificContainerCreationInput & { +export interface A2ACrossClusterMigrationContainerCreationInput + extends ReplicationProviderSpecificContainerCreationInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2ACrossClusterMigration"; -}; +} /** VMwareCbt container creation input. */ -export type VMwareCbtContainerCreationInput = ReplicationProviderSpecificContainerCreationInput & { +export interface VMwareCbtContainerCreationInput + extends ReplicationProviderSpecificContainerCreationInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; -}; +} /** VMwareCbt provider specific settings. */ -export type VMwareCbtMigrationDetails = MigrationProviderSpecificSettings & { +export interface VMwareCbtMigrationDetails + extends MigrationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** @@ -5808,6 +5951,11 @@ export type VMwareCbtMigrationDetails = MigrationProviderSpecificSettings & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly snapshotRunAsAccountId?: string; + /** + * The replication storage account ARM Id. This is applicable only for the blob based replication test hook. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly storageAccountId?: string; /** Target VM name. */ targetVmName?: string; /** The target VM size. */ @@ -5833,6 +5981,8 @@ export type VMwareCbtMigrationDetails = MigrationProviderSpecificSettings & { protectedDisks?: VMwareCbtProtectedDiskDetails[]; /** The target network Id. */ targetNetworkId?: string; + /** The test network Id. */ + testNetworkId?: string; /** The network details. */ vmNics?: VMwareCbtNicDetails[]; /** The tags for the target NICs. */ @@ -5867,6 +6017,11 @@ export type VMwareCbtMigrationDetails = MigrationProviderSpecificSettings & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resyncProgressPercentage?: number; + /** + * The resume progress percentage. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resumeProgressPercentage?: number; /** * The initial seeding retry count. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -5877,6 +6032,11 @@ export type VMwareCbtMigrationDetails = MigrationProviderSpecificSettings & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resyncRetryCount?: number; + /** + * The resume retry count. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resumeRetryCount?: number; /** * A value indicating whether resync is required. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -5893,10 +6053,11 @@ export type VMwareCbtMigrationDetails = MigrationProviderSpecificSettings & { seedDiskTags?: { [propertyName: string]: string }; /** The tags for the target disks. */ targetDiskTags?: { [propertyName: string]: string }; -}; +} /** VMwareCbt specific enable migration input. */ -export type VMwareCbtEnableMigrationInput = EnableMigrationProviderSpecificInput & { +export interface VMwareCbtEnableMigrationInput + extends EnableMigrationProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** The ARM Id of the VM discovered in VMware. */ @@ -5907,6 +6068,8 @@ export type VMwareCbtEnableMigrationInput = EnableMigrationProviderSpecificInput licenseType?: LicenseType; /** The SQL Server license type. */ sqlServerLicenseType?: SqlServerLicenseType; + /** A value indicating whether bulk SQL RP registration to be done. */ + performSqlBulkRegistration?: string; /** The data mover run as account Id. */ dataMoverRunAsAccountId: string; /** The snapshot run as account Id. */ @@ -5919,8 +6082,12 @@ export type VMwareCbtEnableMigrationInput = EnableMigrationProviderSpecificInput targetResourceGroupId: string; /** The target network ARM Id. */ targetNetworkId: string; + /** The selected test network ARM Id. */ + testNetworkId?: string; /** The target subnet name. */ targetSubnetName?: string; + /** The selected test subnet name. */ + testSubnetName?: string; /** The target availability set ARM Id. */ targetAvailabilitySetId?: string; /** The target availability zone. */ @@ -5939,10 +6106,11 @@ export type VMwareCbtEnableMigrationInput = EnableMigrationProviderSpecificInput targetDiskTags?: { [propertyName: string]: string }; /** The tags for the target NICs. */ targetNicTags?: { [propertyName: string]: string }; -}; +} /** VMwareCbt specific update migration item input. */ -export type VMwareCbtUpdateMigrationItemInput = UpdateMigrationItemProviderSpecificInput & { +export interface VMwareCbtUpdateMigrationItemInput + extends UpdateMigrationItemProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** The target VM name. */ @@ -5961,6 +6129,8 @@ export type VMwareCbtUpdateMigrationItemInput = UpdateMigrationItemProviderSpeci targetBootDiagnosticsStorageAccountId?: string; /** The target network ARM Id. */ targetNetworkId?: string; + /** The test network ARM Id. */ + testNetworkId?: string; /** The list of NIC details. */ vmNics?: VMwareCbtNicInput[]; /** The list of disk update properties. */ @@ -5977,36 +6147,48 @@ export type VMwareCbtUpdateMigrationItemInput = UpdateMigrationItemProviderSpeci targetDiskTags?: { [propertyName: string]: string }; /** The tags for the target NICs. */ targetNicTags?: { [propertyName: string]: string }; -}; +} /** VMwareCbt specific migrate input. */ -export type VMwareCbtMigrateInput = MigrateProviderSpecificInput & { +export interface VMwareCbtMigrateInput extends MigrateProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** A value indicating whether VM is to be shutdown. */ performShutdown: string; -}; +} + +/** VMwareCbt specific resume replication input. */ +export interface VMwareCbtResumeReplicationInput + extends ResumeReplicationProviderSpecificInput { + /** Polymorphic discriminator, which specifies the different types this object can be */ + instanceType: "VMwareCbt"; + /** A value indicating whether Migration resources to be deleted. */ + deleteMigrationResources?: string; +} /** VMwareCbt specific resync input. */ -export type VMwareCbtResyncInput = ResyncProviderSpecificInput & { +export interface VMwareCbtResyncInput extends ResyncProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** A value indicating whether CBT is to be reset. */ skipCbtReset: string; -}; +} /** VMwareCbt specific test migrate input. */ -export type VMwareCbtTestMigrateInput = TestMigrateProviderSpecificInput & { +export interface VMwareCbtTestMigrateInput + extends TestMigrateProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** The recovery point Id. */ recoveryPointId: string; /** The test network Id. */ networkId: string; -}; + /** The list of NIC details. */ + vmNics?: VMwareCbtNicInput[]; +} /** Single Host fabric provider specific VM settings. */ -export type HyperVVirtualMachineDetails = ConfigurationSettings & { +export interface HyperVVirtualMachineDetails extends ConfigurationSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVVirtualMachine" | "VmmVirtualMachine"; /** The source id of the object. */ @@ -6025,16 +6207,16 @@ export type HyperVVirtualMachineDetails = ConfigurationSettings & { hasSharedVhd?: PresenceStatus; /** The Id of the hyper-v host in fabric. */ hyperVHostId?: string; -}; +} /** Replication group details. This will be used in case of San. */ -export type ReplicationGroupDetails = ConfigurationSettings & { +export interface ReplicationGroupDetails extends ConfigurationSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "ReplicationGroupDetails"; -}; +} /** VMware provider specific settings. */ -export type VMwareVirtualMachineDetails = ConfigurationSettings & { +export interface VMwareVirtualMachineDetails extends ConfigurationSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareVirtualMachine"; /** The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. */ @@ -6057,10 +6239,11 @@ export type VMwareVirtualMachineDetails = ConfigurationSettings & { diskDetails?: InMageDiskDetails[]; /** The validation errors. */ validationErrors?: HealthError[]; -}; +} /** A2A provider specific settings. */ -export type A2ACrossClusterMigrationReplicationDetails = ReplicationProviderSpecificSettings & { +export interface A2ACrossClusterMigrationReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2ACrossClusterMigration"; /** The fabric specific object Id of the virtual machine. */ @@ -6075,10 +6258,11 @@ export type A2ACrossClusterMigrationReplicationDetails = ReplicationProviderSpec vmProtectionStateDescription?: string; /** An id associated with the PE that survives actions like switch protection which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be changing. */ lifecycleId?: string; -}; +} /** A2A provider specific settings. */ -export type A2AReplicationDetails = ReplicationProviderSpecificSettings & { +export interface A2AReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The fabric specific object Id of the virtual machine. */ @@ -6208,10 +6392,11 @@ export type A2AReplicationDetails = ReplicationProviderSpecificSettings & { recoveryVirtualMachineScaleSetId?: string; /** The recovery capacity reservation group Id. */ recoveryCapacityReservationGroupId?: string; -}; +} /** Hyper V Replica Azure provider specific settings. */ -export type HyperVReplicaAzureReplicationDetails = ReplicationProviderSpecificSettings & { +export interface HyperVReplicaAzureReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** Azure VM Disk details. */ @@ -6283,10 +6468,11 @@ export type HyperVReplicaAzureReplicationDetails = ReplicationProviderSpecificSe targetNicTags?: { [propertyName: string]: string }; /** The list of protected managed disks. */ protectedManagedDisks?: HyperVReplicaAzureManagedDiskDetails[]; -}; +} /** Hyper V replica provider specific settings base class. */ -export type HyperVReplicaBaseReplicationDetails = ReplicationProviderSpecificSettings & { +export interface HyperVReplicaBaseReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaBaseReplicationDetails"; /** The Last replication time. */ @@ -6303,10 +6489,11 @@ export type HyperVReplicaBaseReplicationDetails = ReplicationProviderSpecificSet initialReplicationDetails?: InitialReplicationDetails; /** VM disk details. */ vMDiskDetails?: DiskDetails[]; -}; +} /** HyperV replica 2012 R2 (Blue) replication details. */ -export type HyperVReplicaBlueReplicationDetails = ReplicationProviderSpecificSettings & { +export interface HyperVReplicaBlueReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplica2012R2"; /** The Last replication time. */ @@ -6323,10 +6510,11 @@ export type HyperVReplicaBlueReplicationDetails = ReplicationProviderSpecificSet initialReplicationDetails?: InitialReplicationDetails; /** VM disk details. */ vMDiskDetails?: DiskDetails[]; -}; +} /** HyperV replica 2012 replication details. */ -export type HyperVReplicaReplicationDetails = ReplicationProviderSpecificSettings & { +export interface HyperVReplicaReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplica2012"; /** The Last replication time. */ @@ -6343,10 +6531,11 @@ export type HyperVReplicaReplicationDetails = ReplicationProviderSpecificSetting initialReplicationDetails?: InitialReplicationDetails; /** VM disk details. */ vMDiskDetails?: DiskDetails[]; -}; +} /** InMageAzureV2 provider specific settings. */ -export type InMageAzureV2ReplicationDetails = ReplicationProviderSpecificSettings & { +export interface InMageAzureV2ReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The infrastructure VM Id. */ @@ -6486,10 +6675,11 @@ export type InMageAzureV2ReplicationDetails = ReplicationProviderSpecificSetting switchProviderBlockingErrorDetails?: InMageAzureV2SwitchProviderBlockingErrorDetails[]; /** The switch provider blocking error information. */ switchProviderDetails?: InMageAzureV2SwitchProviderDetails; -}; +} /** InMageRcmFailback provider specific details. */ -export type InMageRcmFailbackReplicationDetails = ReplicationProviderSpecificSettings & { +export interface InMageRcmFailbackReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcmFailback"; /** @@ -6625,10 +6815,11 @@ export type InMageRcmFailbackReplicationDetails = ReplicationProviderSpecificSet * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isAgentRegistrationSuccessfulAfterFailover?: boolean; -}; +} /** InMageRcm provider specific details. */ -export type InMageRcmReplicationDetails = ReplicationProviderSpecificSettings & { +export interface InMageRcmReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** @@ -6698,6 +6889,11 @@ export type InMageRcmReplicationDetails = ReplicationProviderSpecificSettings & readonly targetGeneration?: string; /** License Type of the VM to be used. */ licenseType?: string; + /** + * The replication storage account ARM Id. This is applicable only for the blob based replication test hook. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly storageAccountId?: string; /** Target VM name. */ targetVmName?: string; /** The target VM size. */ @@ -6835,10 +7031,11 @@ export type InMageRcmReplicationDetails = ReplicationProviderSpecificSettings & vmNics?: InMageRcmNicDetails[]; /** The discovered VM details. */ discoveredVmDetails?: InMageRcmDiscoveredProtectedVmDetails; -}; +} /** InMage provider specific settings. */ -export type InMageReplicationDetails = ReplicationProviderSpecificSettings & { +export interface InMageReplicationDetails + extends ReplicationProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMage"; /** The active location of the VM. If the VM is being protected from Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between two data-centers, this field will be OnPrem always. */ @@ -6921,20 +7118,22 @@ export type InMageReplicationDetails = ReplicationProviderSpecificSettings & { totalDataTransferred?: number; /** The progress health. */ totalProgressHealth?: string; -}; +} /** A2A Cross-Cluster Migration enable protection input. */ -export type A2ACrossClusterMigrationEnableProtectionInput = EnableProtectionProviderSpecificInput & { +export interface A2ACrossClusterMigrationEnableProtectionInput + extends EnableProtectionProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2ACrossClusterMigration"; /** The fabric specific object Id of the virtual machine. */ fabricObjectId?: string; /** The recovery container Id. */ recoveryContainerId?: string; -}; +} /** A2A enable protection input. */ -export type A2AEnableProtectionInput = EnableProtectionProviderSpecificInput & { +export interface A2AEnableProtectionInput + extends EnableProtectionProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The fabric specific object Id of the virtual machine. */ @@ -6973,10 +7172,11 @@ export type A2AEnableProtectionInput = EnableProtectionProviderSpecificInput & { recoveryVirtualMachineScaleSetId?: string; /** The recovery capacity reservation group Id. */ recoveryCapacityReservationGroupId?: string; -}; +} /** HyperVReplicaAzure specific enable protection input. */ -export type HyperVReplicaAzureEnableProtectionInput = EnableProtectionProviderSpecificInput & { +export interface HyperVReplicaAzureEnableProtectionInput + extends EnableProtectionProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** The Hyper-V host VM Id. */ @@ -7035,10 +7235,11 @@ export type HyperVReplicaAzureEnableProtectionInput = EnableProtectionProviderSp targetManagedDiskTags?: { [propertyName: string]: string }; /** The tags for the target NICs. */ targetNicTags?: { [propertyName: string]: string }; -}; +} /** VMware Azure specific enable protection input. */ -export type InMageAzureV2EnableProtectionInput = EnableProtectionProviderSpecificInput & { +export interface InMageAzureV2EnableProtectionInput + extends EnableProtectionProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The Master target Id. */ @@ -7093,10 +7294,11 @@ export type InMageAzureV2EnableProtectionInput = EnableProtectionProviderSpecifi targetManagedDiskTags?: { [propertyName: string]: string }; /** The tags for the target NICs. */ targetNicTags?: { [propertyName: string]: string }; -}; +} /** VMware Azure specific enable protection input. */ -export type InMageEnableProtectionInput = EnableProtectionProviderSpecificInput & { +export interface InMageEnableProtectionInput + extends EnableProtectionProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMage"; /** The VM Name. */ @@ -7119,10 +7321,11 @@ export type InMageEnableProtectionInput = EnableProtectionProviderSpecificInput diskExclusionInput?: InMageDiskExclusionInput; /** The disks to include list. */ disksToInclude?: string[]; -}; +} /** InMageRcm specific enable protection input. */ -export type InMageRcmEnableProtectionInput = EnableProtectionProviderSpecificInput & { +export interface InMageRcmEnableProtectionInput + extends EnableProtectionProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The ARM Id of discovered machine. */ @@ -7161,10 +7364,11 @@ export type InMageRcmEnableProtectionInput = EnableProtectionProviderSpecificInp processServerId: string; /** The multi VM group name. */ multiVmGroupName?: string; -}; +} /** InMage Azure V2 input to update replication protected item. */ -export type A2AUpdateReplicationProtectedItemInput = UpdateReplicationProtectedItemProviderInput & { +export interface A2AUpdateReplicationProtectedItemInput + extends UpdateReplicationProtectedItemProviderInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The target cloud service ARM Id (for V1). */ @@ -7185,10 +7389,11 @@ export type A2AUpdateReplicationProtectedItemInput = UpdateReplicationProtectedI recoveryVirtualMachineScaleSetId?: string; /** The recovery capacity reservation group Id. */ recoveryCapacityReservationGroupId?: string; -}; +} /** HyperV replica Azure input to update replication protected item. */ -export type HyperVReplicaAzureUpdateReplicationProtectedItemInput = UpdateReplicationProtectedItemProviderInput & { +export interface HyperVReplicaAzureUpdateReplicationProtectedItemInput + extends UpdateReplicationProtectedItemProviderInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** The recovery Azure resource group Id for classic deployment. */ @@ -7213,10 +7418,11 @@ export type HyperVReplicaAzureUpdateReplicationProtectedItemInput = UpdateReplic sqlServerLicenseType?: SqlServerLicenseType; /** The list of disk update properties. */ vmDisks?: UpdateDiskInput[]; -}; +} /** InMage Azure V2 input to update replication protected item. */ -export type InMageAzureV2UpdateReplicationProtectedItemInput = UpdateReplicationProtectedItemProviderInput & { +export interface InMageAzureV2UpdateReplicationProtectedItemInput + extends UpdateReplicationProtectedItemProviderInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The recovery Azure resource group Id for classic deployment. */ @@ -7239,10 +7445,11 @@ export type InMageAzureV2UpdateReplicationProtectedItemInput = UpdateReplication sqlServerLicenseType?: SqlServerLicenseType; /** The list of disk update properties. */ vmDisks?: UpdateDiskInput[]; -}; +} /** InMageRcm provider specific input to update replication protected item. */ -export type InMageRcmUpdateReplicationProtectedItemInput = UpdateReplicationProtectedItemProviderInput & { +export interface InMageRcmUpdateReplicationProtectedItemInput + extends UpdateReplicationProtectedItemProviderInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The target VM name. */ @@ -7267,56 +7474,62 @@ export type InMageRcmUpdateReplicationProtectedItemInput = UpdateReplicationProt vmNics?: InMageRcmNicInput[]; /** The license type. */ licenseType?: LicenseType; -}; +} /** A2A add disk(s) input. */ -export type A2AAddDisksInput = AddDisksProviderSpecificInput & { +export interface A2AAddDisksInput extends AddDisksProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The list of vm disk details. */ vmDisks?: A2AVmDiskInputDetails[]; /** The list of vm managed disk details. */ vmManagedDisks?: A2AVmManagedDiskInputDetails[]; -}; +} /** ApplyRecoveryPoint input specific to A2A provider. */ -export type A2AApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface A2AApplyRecoveryPointInput + extends ApplyRecoveryPointProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; -}; +} /** ApplyRecoveryPoint input specific to A2ACrossClusterMigration provider. */ -export type A2ACrossClusterMigrationApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface A2ACrossClusterMigrationApplyRecoveryPointInput + extends ApplyRecoveryPointProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2ACrossClusterMigration"; -}; +} /** ApplyRecoveryPoint input specific to HyperVReplicaAzure provider. */ -export type HyperVReplicaAzureApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface HyperVReplicaAzureApplyRecoveryPointInput + extends ApplyRecoveryPointProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** The primary kek certificate pfx. */ primaryKekCertificatePfx?: string; /** The secondary kek certificate pfx. */ secondaryKekCertificatePfx?: string; -}; +} /** ApplyRecoveryPoint input specific to InMageAzureV2 provider. */ -export type InMageAzureV2ApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface InMageAzureV2ApplyRecoveryPointInput + extends ApplyRecoveryPointProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; -}; +} /** ApplyRecoveryPoint input specific to InMageRcm provider. */ -export type InMageRcmApplyRecoveryPointInput = ApplyRecoveryPointProviderSpecificInput & { +export interface InMageRcmApplyRecoveryPointInput + extends ApplyRecoveryPointProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The recovery point Id. */ recoveryPointId: string; -}; +} /** HyperVReplicaAzureFailback specific planned failover input. */ -export type HyperVReplicaAzureFailbackProviderInput = PlannedFailoverProviderSpecificFailoverInput & { +export interface HyperVReplicaAzureFailbackProviderInput + extends PlannedFailoverProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzureFailback"; /** Data sync option. */ @@ -7325,10 +7538,11 @@ export type HyperVReplicaAzureFailbackProviderInput = PlannedFailoverProviderSpe recoveryVmCreationOption?: string; /** Provider Id for alternate location. */ providerIdForAlternateRecovery?: string; -}; +} /** HyperVReplicaAzure specific planned failover input. */ -export type HyperVReplicaAzurePlannedFailoverProviderInput = PlannedFailoverProviderSpecificFailoverInput & { +export interface HyperVReplicaAzurePlannedFailoverProviderInput + extends PlannedFailoverProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** Primary kek certificate pfx. */ @@ -7337,36 +7551,40 @@ export type HyperVReplicaAzurePlannedFailoverProviderInput = PlannedFailoverProv secondaryKekCertificatePfx?: string; /** The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; -}; +} /** Provider specific input for InMageRcmFailback failover. */ -export type InMageRcmFailbackPlannedFailoverProviderInput = PlannedFailoverProviderSpecificFailoverInput & { +export interface InMageRcmFailbackPlannedFailoverProviderInput + extends PlannedFailoverProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcmFailback"; /** The recovery point type. */ recoveryPointType: InMageRcmFailbackRecoveryPointType; -}; +} /** A2A provider specific recovery point details. */ -export type A2ARecoveryPointDetails = ProviderSpecificRecoveryPointDetails & { +export interface A2ARecoveryPointDetails + extends ProviderSpecificRecoveryPointDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** A value indicating whether the recovery point is multi VM consistent. */ recoveryPointSyncType?: RecoveryPointSyncType; /** List of disk ids representing a recovery point. */ disks?: string[]; -}; +} /** InMage Azure V2 provider specific recovery point details. */ -export type InMageAzureV2RecoveryPointDetails = ProviderSpecificRecoveryPointDetails & { +export interface InMageAzureV2RecoveryPointDetails + extends ProviderSpecificRecoveryPointDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** A value indicating whether the recovery point is multi VM consistent. */ isMultiVmSyncPoint?: string; -}; +} /** InMageRcm provider specific recovery point details. */ -export type InMageRcmRecoveryPointDetails = ProviderSpecificRecoveryPointDetails & { +export interface InMageRcmRecoveryPointDetails + extends ProviderSpecificRecoveryPointDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** @@ -7374,28 +7592,30 @@ export type InMageRcmRecoveryPointDetails = ProviderSpecificRecoveryPointDetails * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isMultiVmSyncPoint?: string; -}; +} /** InMage disable protection provider specific input. */ -export type InMageDisableProtectionProviderSpecificInput = DisableProtectionProviderSpecificInput & { +export interface InMageDisableProtectionProviderSpecificInput + extends DisableProtectionProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMage"; /** A value indicating whether the replica VM should be destroyed or retained. Values from Delete and Retain. */ replicaVmDeletionStatus?: string; -}; +} /** A2A remove disk(s) input. */ -export type A2ARemoveDisksInput = RemoveDisksProviderSpecificInput & { +export interface A2ARemoveDisksInput extends RemoveDisksProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The list of vm disk vhd URIs. */ vmDisksUris?: string[]; /** The list of vm managed disk Ids. */ vmManagedDisksIds?: string[]; -}; +} /** Azure specific reprotect input. */ -export type A2AReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface A2AReprotectInput + extends ReverseReplicationProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The recovery container Id. */ @@ -7410,10 +7630,11 @@ export type A2AReprotectInput = ReverseReplicationProviderSpecificInput & { recoveryAvailabilitySetId?: string; /** The Policy Id. */ policyId?: string; -}; +} /** Azure specific reprotect input. */ -export type HyperVReplicaAzureReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface HyperVReplicaAzureReprotectInput + extends ReverseReplicationProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** The Hyper-V host Vm Id. */ @@ -7428,10 +7649,11 @@ export type HyperVReplicaAzureReprotectInput = ReverseReplicationProviderSpecifi storageAccountId?: string; /** The storage account to be used for logging during replication. */ logStorageAccountId?: string; -}; +} /** InMageAzureV2 specific provider input. */ -export type InMageAzureV2ReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface InMageAzureV2ReprotectInput + extends ReverseReplicationProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The Master target Id. */ @@ -7448,10 +7670,11 @@ export type InMageAzureV2ReprotectInput = ReverseReplicationProviderSpecificInpu logStorageAccountId?: string; /** The disks to include list. */ disksToInclude?: string[]; -}; +} /** InMageRcmFailback specific provider input. */ -export type InMageRcmFailbackReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface InMageRcmFailbackReprotectInput + extends ReverseReplicationProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcmFailback"; /** The process server Id. */ @@ -7460,10 +7683,11 @@ export type InMageRcmFailbackReprotectInput = ReverseReplicationProviderSpecific runAsAccountId?: string; /** The Policy Id. */ policyId: string; -}; +} /** InMageRcm specific provider input. */ -export type InMageRcmReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface InMageRcmReprotectInput + extends ReverseReplicationProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The reprotect agent Id. */ @@ -7474,10 +7698,11 @@ export type InMageRcmReprotectInput = ReverseReplicationProviderSpecificInput & logStorageAccountId: string; /** The Policy Id. */ policyId?: string; -}; +} /** InMageAzureV2 specific provider input. */ -export type InMageReprotectInput = ReverseReplicationProviderSpecificInput & { +export interface InMageReprotectInput + extends ReverseReplicationProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMage"; /** The Master Target Id. */ @@ -7496,10 +7721,11 @@ export type InMageReprotectInput = ReverseReplicationProviderSpecificInput & { profileId: string; /** The disks to include list. */ disksToInclude?: string[]; -}; +} /** Provider specific input for InMageAzureV2 switch provider. */ -export type InMageAzureV2SwitchProviderInput = SwitchProviderSpecificInput & { +export interface InMageAzureV2SwitchProviderInput + extends SwitchProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The target vault Id. */ @@ -7508,20 +7734,22 @@ export type InMageAzureV2SwitchProviderInput = SwitchProviderSpecificInput & { targetFabricID: string; /** The target appliance Id. */ targetApplianceID: string; -}; +} /** A2A provider specific input for test failover. */ -export type A2ATestFailoverInput = TestFailoverProviderSpecificInput & { +export interface A2ATestFailoverInput + extends TestFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; /** A value indicating whether to use recovery cloud service for TFO or not. */ cloudServiceCreationOption?: string; -}; +} /** HvrA provider specific input for test failover. */ -export type HyperVReplicaAzureTestFailoverInput = TestFailoverProviderSpecificInput & { +export interface HyperVReplicaAzureTestFailoverInput + extends TestFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** Primary kek certificate pfx. */ @@ -7530,48 +7758,53 @@ export type HyperVReplicaAzureTestFailoverInput = TestFailoverProviderSpecificIn secondaryKekCertificatePfx?: string; /** The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; -}; +} /** InMageAzureV2 provider specific input for test failover. */ -export type InMageAzureV2TestFailoverInput = TestFailoverProviderSpecificInput & { +export interface InMageAzureV2TestFailoverInput + extends TestFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; -}; +} /** InMageRcm provider specific input for test failover. */ -export type InMageRcmTestFailoverInput = TestFailoverProviderSpecificInput & { +export interface InMageRcmTestFailoverInput + extends TestFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The test network Id. */ networkId?: string; /** The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; -}; +} /** Provider specific input for InMage test failover. */ -export type InMageTestFailoverInput = TestFailoverProviderSpecificInput & { +export interface InMageTestFailoverInput + extends TestFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMage"; /** The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. */ recoveryPointType?: RecoveryPointType; /** The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; -}; +} /** A2A provider specific input for unplanned failover. */ -export type A2AUnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface A2AUnplannedFailoverInput + extends UnplannedFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; /** A value indicating whether to use recovery cloud service for failover or not. */ cloudServiceCreationOption?: string; -}; +} /** HvrA provider specific input for unplanned failover. */ -export type HyperVReplicaAzureUnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface HyperVReplicaAzureUnplannedFailoverInput + extends UnplannedFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** Primary kek certificate pfx. */ @@ -7580,46 +7813,51 @@ export type HyperVReplicaAzureUnplannedFailoverInput = UnplannedFailoverProvider secondaryKekCertificatePfx?: string; /** The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; -}; +} /** InMageAzureV2 provider specific input for unplanned failover. */ -export type InMageAzureV2UnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface InMageAzureV2UnplannedFailoverInput + extends UnplannedFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; -}; +} /** InMageRcm provider specific input for unplanned failover. */ -export type InMageRcmUnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface InMageRcmUnplannedFailoverInput + extends UnplannedFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** A value indicating whether VM is to be shutdown. */ performShutdown: string; /** The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; -}; +} /** Provider specific input for InMage unplanned failover. */ -export type InMageUnplannedFailoverInput = UnplannedFailoverProviderSpecificInput & { +export interface InMageUnplannedFailoverInput + extends UnplannedFailoverProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMage"; /** The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. */ recoveryPointType?: RecoveryPointType; /** The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. */ recoveryPointId?: string; -}; +} /** InMageRcm provider specific input to update appliance for replication protected item. */ -export type InMageRcmUpdateApplianceForReplicationProtectedItemInput = UpdateApplianceForReplicationProtectedItemProviderSpecificInput & { +export interface InMageRcmUpdateApplianceForReplicationProtectedItemInput + extends UpdateApplianceForReplicationProtectedItemProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The run as account Id. */ runAsAccountId?: string; -}; +} /** A2A provider specific settings. */ -export type A2AProtectionContainerMappingDetails = ProtectionContainerMappingProviderSpecificDetails & { +export interface A2AProtectionContainerMappingDetails + extends ProtectionContainerMappingProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** A value indicating whether the auto update is enabled. */ @@ -7632,10 +7870,11 @@ export type A2AProtectionContainerMappingDetails = ProtectionContainerMappingPro scheduleName?: string; /** The job schedule arm name. */ jobScheduleName?: string; -}; +} /** InMageRcm provider specific container mapping details. */ -export type InMageRcmProtectionContainerMappingDetails = ProtectionContainerMappingProviderSpecificDetails & { +export interface InMageRcmProtectionContainerMappingDetails + extends ProtectionContainerMappingProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** @@ -7643,10 +7882,11 @@ export type InMageRcmProtectionContainerMappingDetails = ProtectionContainerMapp * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly enableAgentAutoUpgrade?: string; -}; +} /** VMwareCbt provider specific container mapping details. */ -export type VMwareCbtProtectionContainerMappingDetails = ProtectionContainerMappingProviderSpecificDetails & { +export interface VMwareCbtProtectionContainerMappingDetails + extends ProtectionContainerMappingProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** @@ -7679,10 +7919,16 @@ export type VMwareCbtProtectionContainerMappingDetails = ProtectionContainerMapp * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly targetLocation?: string; -}; + /** + * The role size to NIC count map. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly roleSizeToNicCountMap?: { [propertyName: string]: number }; +} /** A2A container mapping input. */ -export type A2AContainerMappingInput = ReplicationProviderSpecificContainerMappingInput & { +export interface A2AContainerMappingInput + extends ReplicationProviderSpecificContainerMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** A value indicating whether the auto update is enabled. */ @@ -7691,28 +7937,30 @@ export type A2AContainerMappingInput = ReplicationProviderSpecificContainerMappi automationAccountArmId?: string; /** A value indicating the type authentication to use for automation Account. */ automationAccountAuthenticationType?: AutomationAccountAuthenticationType; -}; +} /** VMwareCbt container mapping input. */ -export type VMwareCbtContainerMappingInput = ReplicationProviderSpecificContainerMappingInput & { +export interface VMwareCbtContainerMappingInput + extends ReplicationProviderSpecificContainerMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** The target key vault ARM Id. */ - keyVaultId: string; + keyVaultId?: string; /** The target key vault URL. */ - keyVaultUri: string; + keyVaultUri?: string; /** The storage account ARM Id. */ storageAccountId: string; /** The secret name of the storage account. */ - storageAccountSasSecretName: string; + storageAccountSasSecretName?: string; /** The secret name of the service bus connection string. */ - serviceBusConnectionStringSecretName: string; + serviceBusConnectionStringSecretName?: string; /** The target location. */ targetLocation: string; -}; +} /** A2A update protection container mapping. */ -export type A2AUpdateContainerMappingInput = ReplicationProviderSpecificUpdateContainerMappingInput & { +export interface A2AUpdateContainerMappingInput + extends ReplicationProviderSpecificUpdateContainerMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** A value indicating whether the auto update is enabled. */ @@ -7721,18 +7969,20 @@ export type A2AUpdateContainerMappingInput = ReplicationProviderSpecificUpdateCo automationAccountArmId?: string; /** A value indicating the type authentication to use for automation Account. */ automationAccountAuthenticationType?: AutomationAccountAuthenticationType; -}; +} /** InMageRcm update protection container mapping. */ -export type InMageRcmUpdateContainerMappingInput = ReplicationProviderSpecificUpdateContainerMappingInput & { +export interface InMageRcmUpdateContainerMappingInput + extends ReplicationProviderSpecificUpdateContainerMappingInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** A value indicating whether agent auto upgrade has to be enabled. */ enableAgentAutoUpgrade: string; -}; +} /** A2A specific switch protection input. */ -export type A2ASwitchProtectionInput = SwitchProtectionProviderSpecificInput & { +export interface A2ASwitchProtectionInput + extends SwitchProtectionProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The recovery container Id. */ @@ -7761,10 +8011,10 @@ export type A2ASwitchProtectionInput = SwitchProtectionProviderSpecificInput & { recoveryCapacityReservationGroupId?: string; /** The recovery disk encryption information. */ diskEncryptionInfo?: DiskEncryptionInfo; -}; +} /** This class represents the task details for an automation runbook. */ -export type AutomationRunbookTaskDetails = TaskTypeDetails & { +export interface AutomationRunbookTaskDetails extends TaskTypeDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "AutomationRunbookTaskDetails"; /** The recovery plan task name. */ @@ -7785,18 +8035,18 @@ export type AutomationRunbookTaskDetails = TaskTypeDetails & { jobOutput?: string; /** A value indicating whether it is a primary side script or not. */ isPrimarySideScript?: boolean; -}; +} /** This class contains monitoring details of all the inconsistent Protected Entities in Vmm. */ -export type ConsistencyCheckTaskDetails = TaskTypeDetails & { +export interface ConsistencyCheckTaskDetails extends TaskTypeDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "ConsistencyCheckTaskDetails"; /** The list of inconsistent Vm details. */ vmDetails?: InconsistentVmDetails[]; -}; +} /** This class represents a task which is actually a workflow so that one can navigate to its individual drill down. */ -export type JobTaskDetails = TaskTypeDetails & { +export interface JobTaskDetails extends TaskTypeDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: | "JobTaskDetails" @@ -7804,10 +8054,10 @@ export type JobTaskDetails = TaskTypeDetails & { | "VirtualMachineTaskDetails"; /** The job entity. */ jobTask?: JobEntity; -}; +} /** This class represents the manual action task details. */ -export type ManualActionTaskDetails = TaskTypeDetails & { +export interface ManualActionTaskDetails extends TaskTypeDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "ManualActionTaskDetails"; /** The name. */ @@ -7816,10 +8066,10 @@ export type ManualActionTaskDetails = TaskTypeDetails & { instructions?: string; /** The observation. */ observation?: string; -}; +} /** This class represents the script action task details. */ -export type ScriptActionTaskDetails = TaskTypeDetails & { +export interface ScriptActionTaskDetails extends TaskTypeDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "ScriptActionTaskDetails"; /** The name. */ @@ -7830,10 +8080,10 @@ export type ScriptActionTaskDetails = TaskTypeDetails & { output?: string; /** A value indicating whether it is a primary side script or not. */ isPrimarySideScript?: boolean; -}; +} /** This class represents the vm NicUpdates task details. */ -export type VmNicUpdatesTaskDetails = TaskTypeDetails & { +export interface VmNicUpdatesTaskDetails extends TaskTypeDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VmNicUpdatesTaskDetails"; /** Virtual machine Id. */ @@ -7842,18 +8092,18 @@ export type VmNicUpdatesTaskDetails = TaskTypeDetails & { nicId?: string; /** Name of the Nic. */ name?: string; -}; +} /** This class represents the inline workflow task details. */ -export type InlineWorkflowTaskDetails = GroupTaskDetails & { +export interface InlineWorkflowTaskDetails extends GroupTaskDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InlineWorkflowTaskDetails"; /** The list of child workflow ids. */ workflowIds?: string[]; -}; +} /** This class represents the recovery plan group task. */ -export type RecoveryPlanGroupTaskDetails = GroupTaskDetails & { +export interface RecoveryPlanGroupTaskDetails extends GroupTaskDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: | "RecoveryPlanGroupTaskDetails" @@ -7864,42 +8114,42 @@ export type RecoveryPlanGroupTaskDetails = GroupTaskDetails & { groupId?: string; /** The group type. */ rpGroupType?: string; -}; +} /** This class represents job details based on specific job type. */ -export type AsrJobDetails = JobDetails & { +export interface AsrJobDetails extends JobDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "AsrJobDetails"; -}; +} /** This class represents details for export jobs workflow. */ -export type ExportJobDetails = JobDetails & { +export interface ExportJobDetails extends JobDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "ExportJobDetails"; /** BlobUri of the exported jobs. */ blobUri?: string; /** The sas token to access blob. */ sasToken?: string; -}; +} /** This class represents the details for a failover job. */ -export type FailoverJobDetails = JobDetails & { +export interface FailoverJobDetails extends JobDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "FailoverJobDetails"; /** The test VM details. */ protectedItemDetails?: FailoverReplicationProtectedItemDetails[]; -}; +} /** This class represents details for switch protection job. */ -export type SwitchProtectionJobDetails = JobDetails & { +export interface SwitchProtectionJobDetails extends JobDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "SwitchProtectionJobDetails"; /** ARM Id of the new replication protected item. */ newReplicationProtectedItemId?: string; -}; +} /** This class represents the details for a test failover job. */ -export type TestFailoverJobDetails = JobDetails & { +export interface TestFailoverJobDetails extends JobDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "TestFailoverJobDetails"; /** The test failover status. */ @@ -7914,10 +8164,10 @@ export type TestFailoverJobDetails = JobDetails & { networkType?: string; /** The test VM details. */ protectedItemDetails?: FailoverReplicationProtectedItemDetails[]; -}; +} /** A2A specific policy details. */ -export type A2APolicyDetails = PolicyProviderSpecificDetails & { +export interface A2APolicyDetails extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The recovery point threshold in minutes. */ @@ -7930,10 +8180,11 @@ export type A2APolicyDetails = PolicyProviderSpecificDetails & { multiVmSyncStatus?: string; /** The crash consistent snapshot frequency in minutes. */ crashConsistentFrequencyInMinutes?: number; -}; +} /** Hyper-V Replica Azure specific protection profile details. */ -export type HyperVReplicaAzurePolicyDetails = PolicyProviderSpecificDetails & { +export interface HyperVReplicaAzurePolicyDetails + extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** The duration (in hours) to which point the recovery history needs to be maintained. */ @@ -7948,10 +8199,11 @@ export type HyperVReplicaAzurePolicyDetails = PolicyProviderSpecificDetails & { encryption?: string; /** The active storage account Id. */ activeStorageAccountId?: string; -}; +} /** Base class for HyperVReplica policy details. */ -export type HyperVReplicaBasePolicyDetails = PolicyProviderSpecificDetails & { +export interface HyperVReplicaBasePolicyDetails + extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaBasePolicyDetails"; /** A value indicating the number of recovery points. */ @@ -7974,10 +8226,11 @@ export type HyperVReplicaBasePolicyDetails = PolicyProviderSpecificDetails & { allowedAuthenticationType?: number; /** A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. */ replicaDeletionOption?: string; -}; +} /** Hyper-V Replica Blue specific protection profile details. */ -export type HyperVReplicaBluePolicyDetails = PolicyProviderSpecificDetails & { +export interface HyperVReplicaBluePolicyDetails + extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplica2012R2"; /** A value indicating the replication interval. */ @@ -8002,10 +8255,11 @@ export type HyperVReplicaBluePolicyDetails = PolicyProviderSpecificDetails & { allowedAuthenticationType?: number; /** A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud */ replicaDeletionOption?: string; -}; +} /** Hyper-V Replica Blue specific protection profile details. */ -export type HyperVReplicaPolicyDetails = PolicyProviderSpecificDetails & { +export interface HyperVReplicaPolicyDetails + extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplica2012"; /** A value indicating the number of recovery points. */ @@ -8028,10 +8282,11 @@ export type HyperVReplicaPolicyDetails = PolicyProviderSpecificDetails & { allowedAuthenticationType?: number; /** A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud */ replicaDeletionOption?: string; -}; +} /** InMage Azure v2 specific protection profile details. */ -export type InMageAzureV2PolicyDetails = PolicyProviderSpecificDetails & { +export interface InMageAzureV2PolicyDetails + extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The crash consistent snapshot frequency in minutes. */ @@ -8044,10 +8299,10 @@ export type InMageAzureV2PolicyDetails = PolicyProviderSpecificDetails & { appConsistentFrequencyInMinutes?: number; /** A value indicating whether multi-VM sync has to be enabled. */ multiVmSyncStatus?: string; -}; +} /** Base class for the policies of providers using InMage replication. */ -export type InMageBasePolicyDetails = PolicyProviderSpecificDetails & { +export interface InMageBasePolicyDetails extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageBasePolicyDetails"; /** The recovery point threshold in minutes. */ @@ -8058,10 +8313,10 @@ export type InMageBasePolicyDetails = PolicyProviderSpecificDetails & { appConsistentFrequencyInMinutes?: number; /** A value indicating whether multi-VM sync has to be enabled. */ multiVmSyncStatus?: string; -}; +} /** InMage specific protection profile details. */ -export type InMagePolicyDetails = PolicyProviderSpecificDetails & { +export interface InMagePolicyDetails extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMage"; /** The recovery point threshold in minutes. */ @@ -8072,20 +8327,21 @@ export type InMagePolicyDetails = PolicyProviderSpecificDetails & { appConsistentFrequencyInMinutes?: number; /** A value indicating whether multi-VM sync has to be enabled. */ multiVmSyncStatus?: string; -}; +} /** InMageRcm failback specific policy details. */ -export type InMageRcmFailbackPolicyDetails = PolicyProviderSpecificDetails & { +export interface InMageRcmFailbackPolicyDetails + extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcmFailback"; /** The app consistent snapshot frequency in minutes. */ appConsistentFrequencyInMinutes?: number; /** The crash consistent snapshot frequency in minutes. */ crashConsistentFrequencyInMinutes?: number; -}; +} /** InMageRcm specific policy details. */ -export type InMageRcmPolicyDetails = PolicyProviderSpecificDetails & { +export interface InMageRcmPolicyDetails extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The duration in minutes until which the recovery points need to be stored. */ @@ -8096,10 +8352,10 @@ export type InMageRcmPolicyDetails = PolicyProviderSpecificDetails & { crashConsistentFrequencyInMinutes?: number; /** A value indicating whether multi-VM sync has to be enabled. */ enableMultiVmSync?: string; -}; +} /** VMware Cbt specific policy details. */ -export type VmwareCbtPolicyDetails = PolicyProviderSpecificDetails & { +export interface VmwareCbtPolicyDetails extends PolicyProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** The duration in minutes until which the recovery points need to be stored. */ @@ -8108,16 +8364,17 @@ export type VmwareCbtPolicyDetails = PolicyProviderSpecificDetails & { appConsistentFrequencyInMinutes?: number; /** The crash consistent snapshot frequency in minutes. */ crashConsistentFrequencyInMinutes?: number; -}; +} /** A2A Cross-Cluster Migration Policy creation input. */ -export type A2ACrossClusterMigrationPolicyCreationInput = PolicyProviderSpecificInput & { +export interface A2ACrossClusterMigrationPolicyCreationInput + extends PolicyProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2ACrossClusterMigration"; -}; +} /** A2A Policy creation input. */ -export type A2APolicyCreationInput = PolicyProviderSpecificInput & { +export interface A2APolicyCreationInput extends PolicyProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The duration in minutes until which the recovery points need to be stored. */ @@ -8128,10 +8385,11 @@ export type A2APolicyCreationInput = PolicyProviderSpecificInput & { appConsistentFrequencyInMinutes?: number; /** A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. */ multiVmSyncStatus: SetMultiVmSyncStatus; -}; +} /** Hyper-V Replica Azure specific input for creating a protection profile. */ -export type HyperVReplicaAzurePolicyInput = PolicyProviderSpecificInput & { +export interface HyperVReplicaAzurePolicyInput + extends PolicyProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** The duration (in hours) to which point the recovery history needs to be maintained. */ @@ -8144,10 +8402,10 @@ export type HyperVReplicaAzurePolicyInput = PolicyProviderSpecificInput & { onlineReplicationStartTime?: string; /** The list of storage accounts to which the VMs in the primary cloud can replicate to. */ storageAccounts?: string[]; -}; +} /** Hyper-V Replica specific policy Input. */ -export type HyperVReplicaPolicyInput = PolicyProviderSpecificInput & { +export interface HyperVReplicaPolicyInput extends PolicyProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplica2012" | "HyperVReplica2012R2"; /** A value indicating the number of recovery points. */ @@ -8170,10 +8428,10 @@ export type HyperVReplicaPolicyInput = PolicyProviderSpecificInput & { allowedAuthenticationType?: number; /** A value indicating whether the VM has to be auto deleted. */ replicaDeletion?: string; -}; +} /** VMWare Azure specific policy Input. */ -export type InMageAzureV2PolicyInput = PolicyProviderSpecificInput & { +export interface InMageAzureV2PolicyInput extends PolicyProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The recovery point threshold in minutes. */ @@ -8186,10 +8444,10 @@ export type InMageAzureV2PolicyInput = PolicyProviderSpecificInput & { appConsistentFrequencyInMinutes?: number; /** A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. */ multiVmSyncStatus: SetMultiVmSyncStatus; -}; +} /** VMWare Azure specific protection profile Input. */ -export type InMagePolicyInput = PolicyProviderSpecificInput & { +export interface InMagePolicyInput extends PolicyProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMage"; /** The recovery point threshold in minutes. */ @@ -8200,20 +8458,22 @@ export type InMagePolicyInput = PolicyProviderSpecificInput & { appConsistentFrequencyInMinutes?: number; /** A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. */ multiVmSyncStatus: SetMultiVmSyncStatus; -}; +} /** InMageRcmFailback policy creation input. */ -export type InMageRcmFailbackPolicyCreationInput = PolicyProviderSpecificInput & { +export interface InMageRcmFailbackPolicyCreationInput + extends PolicyProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcmFailback"; /** The crash consistent snapshot frequency (in minutes). */ crashConsistentFrequencyInMinutes?: number; /** The app consistent snapshot frequency (in minutes). */ appConsistentFrequencyInMinutes?: number; -}; +} /** InMageRcm policy creation input. */ -export type InMageRcmPolicyCreationInput = PolicyProviderSpecificInput & { +export interface InMageRcmPolicyCreationInput + extends PolicyProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The duration in minutes until which the recovery points need to be stored. */ @@ -8224,10 +8484,11 @@ export type InMageRcmPolicyCreationInput = PolicyProviderSpecificInput & { appConsistentFrequencyInMinutes?: number; /** A value indicating whether multi-VM sync has to be enabled. */ enableMultiVmSync?: string; -}; +} /** VMware Cbt policy creation input. */ -export type VMwareCbtPolicyCreationInput = PolicyProviderSpecificInput & { +export interface VMwareCbtPolicyCreationInput + extends PolicyProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VMwareCbt"; /** The duration in minutes until which the recovery points need to be stored. */ @@ -8236,10 +8497,11 @@ export type VMwareCbtPolicyCreationInput = PolicyProviderSpecificInput & { crashConsistentFrequencyInMinutes?: number; /** The app consistent snapshot frequency (in minutes). */ appConsistentFrequencyInMinutes?: number; -}; +} /** A2A provider specific settings. */ -export type A2AReplicationIntentDetails = ReplicationProtectionIntentProviderSpecificSettings & { +export interface A2AReplicationIntentDetails + extends ReplicationProtectionIntentProviderSpecificSettings { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The fabric specific object Id of the virtual machine. */ @@ -8286,10 +8548,11 @@ export type A2AReplicationIntentDetails = ReplicationProtectionIntentProviderSpe automationAccountArmId?: string; /** A value indicating the type authentication to use for automation Account. */ automationAccountAuthenticationType?: AutomationAccountAuthenticationType; -}; +} /** A2A create protection intent input. */ -export type A2ACreateProtectionIntentInput = CreateProtectionIntentProviderSpecificDetails & { +export interface A2ACreateProtectionIntentInput + extends CreateProtectionIntentProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The fabric specific object Id of the virtual machine. */ @@ -8336,10 +8599,11 @@ export type A2ACreateProtectionIntentInput = CreateProtectionIntentProviderSpeci automationAccountAuthenticationType?: AutomationAccountAuthenticationType; /** The automation account arm id. */ automationAccountArmId?: string; -}; +} /** Recovery plan Automation runbook action details. */ -export type RecoveryPlanAutomationRunbookActionDetails = RecoveryPlanActionDetails & { +export interface RecoveryPlanAutomationRunbookActionDetails + extends RecoveryPlanActionDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "AutomationRunbookActionDetails"; /** The runbook ARM Id. */ @@ -8348,18 +8612,20 @@ export type RecoveryPlanAutomationRunbookActionDetails = RecoveryPlanActionDetai timeout?: string; /** The fabric location. */ fabricLocation: RecoveryPlanActionLocation; -}; +} /** Recovery plan manual action details. */ -export type RecoveryPlanManualActionDetails = RecoveryPlanActionDetails & { +export interface RecoveryPlanManualActionDetails + extends RecoveryPlanActionDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "ManualActionDetails"; /** The manual action description. */ description?: string; -}; +} /** Recovery plan script action details. */ -export type RecoveryPlanScriptActionDetails = RecoveryPlanActionDetails & { +export interface RecoveryPlanScriptActionDetails + extends RecoveryPlanActionDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "ScriptActionDetails"; /** The script path. */ @@ -8368,20 +8634,26 @@ export type RecoveryPlanScriptActionDetails = RecoveryPlanActionDetails & { timeout?: string; /** The fabric location. */ fabricLocation: RecoveryPlanActionLocation; -}; +} /** Recovery plan A2A specific details. */ -export type RecoveryPlanA2ADetails = RecoveryPlanProviderSpecificDetails & { +export interface RecoveryPlanA2ADetails + extends RecoveryPlanProviderSpecificDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The primary zone. */ primaryZone?: string; /** The recovery zone. */ recoveryZone?: string; -}; + /** The primary extended location. */ + primaryExtendedLocation?: ExtendedLocation; + /** The recovery extended location. */ + recoveryExtendedLocation?: ExtendedLocation; +} /** Recovery plan A2A input. */ -export type RecoveryPlanA2AInput = RecoveryPlanProviderSpecificInput & { +export interface RecoveryPlanA2AInput + extends RecoveryPlanProviderSpecificInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The primary zone. */ @@ -8392,10 +8664,11 @@ export type RecoveryPlanA2AInput = RecoveryPlanProviderSpecificInput & { primaryExtendedLocation?: ExtendedLocation; /** The recovery extended location. */ recoveryExtendedLocation?: ExtendedLocation; -}; +} /** Recovery plan A2A failover input. */ -export type RecoveryPlanA2AFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanA2AFailoverInput + extends RecoveryPlanProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "A2A"; /** The recovery point type. */ @@ -8404,20 +8677,22 @@ export type RecoveryPlanA2AFailoverInput = RecoveryPlanProviderSpecificFailoverI cloudServiceCreationOption?: string; /** A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. */ multiVmSyncPointOption?: MultiVmSyncPointOption; -}; +} /** Recovery plan HVR Azure failback input. */ -export type RecoveryPlanHyperVReplicaAzureFailbackInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanHyperVReplicaAzureFailbackInput + extends RecoveryPlanProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzureFailback"; /** The data sync option. */ dataSyncOption: DataSyncStatus; /** The ALR option. */ recoveryVmCreationOption: AlternateLocationRecoveryOption; -}; +} /** Recovery plan HVR Azure failover input. */ -export type RecoveryPlanHyperVReplicaAzureFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanHyperVReplicaAzureFailoverInput + extends RecoveryPlanProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplicaAzure"; /** The primary KEK certificate PFX. */ @@ -8426,56 +8701,61 @@ export type RecoveryPlanHyperVReplicaAzureFailoverInput = RecoveryPlanProviderSp secondaryKekCertificatePfx?: string; /** The recovery point type. */ recoveryPointType?: HyperVReplicaAzureRpRecoveryPointType; -}; +} /** Recovery plan InMageAzureV2 failover input. */ -export type RecoveryPlanInMageAzureV2FailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanInMageAzureV2FailoverInput + extends RecoveryPlanProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageAzureV2"; /** The recovery point type. */ recoveryPointType: InMageV2RpRecoveryPointType; /** A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. */ useMultiVmSyncPoint?: string; -}; +} /** Recovery plan InMage failover input. */ -export type RecoveryPlanInMageFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanInMageFailoverInput + extends RecoveryPlanProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMage"; /** The recovery point type. */ recoveryPointType: RpInMageRecoveryPointType; -}; +} /** Recovery plan InMageRcmFailback failover input. */ -export type RecoveryPlanInMageRcmFailbackFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanInMageRcmFailbackFailoverInput + extends RecoveryPlanProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcmFailback"; /** The recovery point type. */ recoveryPointType: InMageRcmFailbackRecoveryPointType; /** A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. */ useMultiVmSyncPoint?: string; -}; +} /** Recovery plan InMageRcm failover input. */ -export type RecoveryPlanInMageRcmFailoverInput = RecoveryPlanProviderSpecificFailoverInput & { +export interface RecoveryPlanInMageRcmFailoverInput + extends RecoveryPlanProviderSpecificFailoverInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "InMageRcm"; /** The recovery point type. */ recoveryPointType: RecoveryPlanPointType; /** A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. */ useMultiVmSyncPoint?: string; -}; +} /** Existing storage account input. */ -export type ExistingProtectionProfile = ProtectionProfileCustomDetails & { +export interface ExistingProtectionProfile + extends ProtectionProfileCustomDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ resourceType: "Existing"; /** The protection profile Arm Id. Throw error, if resource does not exists. */ protectionProfileId: string; -}; +} /** New Protection profile input. */ -export type NewProtectionProfile = ProtectionProfileCustomDetails & { +export interface NewProtectionProfile extends ProtectionProfileCustomDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ resourceType: "New"; /** The protection profile input. */ @@ -8488,103 +8768,116 @@ export type NewProtectionProfile = ProtectionProfileCustomDetails & { appConsistentFrequencyInMinutes?: number; /** A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. */ multiVmSyncStatus: SetMultiVmSyncStatus; -}; +} /** Existing storage account input. */ -export type ExistingStorageAccount = StorageAccountCustomDetails & { +export interface ExistingStorageAccount extends StorageAccountCustomDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ resourceType: "Existing"; /** The storage account Arm Id. Throw error, if resource does not exists. */ azureStorageAccountId: string; -}; +} /** Existing recovery availability set input. */ -export type ExistingRecoveryAvailabilitySet = RecoveryAvailabilitySetCustomDetails & { +export interface ExistingRecoveryAvailabilitySet + extends RecoveryAvailabilitySetCustomDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ resourceType: "Existing"; /** The recovery availability set Id. Will throw error, if resource does not exist. */ recoveryAvailabilitySetId?: string; -}; +} /** Existing recovery virtual network input. */ -export type ExistingRecoveryVirtualNetwork = RecoveryVirtualNetworkCustomDetails & { +export interface ExistingRecoveryVirtualNetwork + extends RecoveryVirtualNetworkCustomDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ resourceType: "Existing"; /** The recovery virtual network Id. Will throw error, if resource does not exist. */ recoveryVirtualNetworkId: string; /** The recovery subnet name. */ recoverySubnetName?: string; -}; +} /** Recovery virtual network input to create new virtual network from given source network. */ -export type NewRecoveryVirtualNetwork = RecoveryVirtualNetworkCustomDetails & { +export interface NewRecoveryVirtualNetwork + extends RecoveryVirtualNetworkCustomDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ resourceType: "New"; /** The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. */ recoveryVirtualNetworkResourceGroupName?: string; /** The recovery virtual network name. */ recoveryVirtualNetworkName?: string; -}; +} /** Existing recovery proximity placement group input. */ -export type ExistingRecoveryProximityPlacementGroup = RecoveryProximityPlacementGroupCustomDetails & { +export interface ExistingRecoveryProximityPlacementGroup + extends RecoveryProximityPlacementGroupCustomDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ resourceType: "Existing"; /** The recovery proximity placement group Id. Will throw error, if resource does not exist. */ recoveryProximityPlacementGroupId?: string; -}; +} /** Existing recovery resource group input. */ -export type ExistingRecoveryResourceGroup = RecoveryResourceGroupCustomDetails & { +export interface ExistingRecoveryResourceGroup + extends RecoveryResourceGroupCustomDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ resourceType: "Existing"; /** The recovery resource group Id. Valid for V2 scenarios. */ recoveryResourceGroupId?: string; -}; +} /** VMM fabric provider specific VM settings. */ -export type VmmVirtualMachineDetails = HyperVVirtualMachineDetails & { +export interface VmmVirtualMachineDetails extends HyperVVirtualMachineDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VmmVirtualMachine"; -}; +} /** This class represents the fabric replication group task details. */ -export type FabricReplicationGroupTaskDetails = JobTaskDetails & { +export interface FabricReplicationGroupTaskDetails extends JobTaskDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "FabricReplicationGroupTaskDetails"; /** The skipped reason. */ skippedReason?: string; /** The skipped reason string. */ skippedReasonString?: string; -}; +} /** This class represents the virtual machine task details. */ -export type VirtualMachineTaskDetails = JobTaskDetails & { +export interface VirtualMachineTaskDetails extends JobTaskDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "VirtualMachineTaskDetails"; /** The skipped reason. */ skippedReason?: string; /** The skipped reason string. */ skippedReasonString?: string; -}; +} /** This class represents the recovery plan shutdown group task details. */ -export type RecoveryPlanShutdownGroupTaskDetails = RecoveryPlanGroupTaskDetails & { +export interface RecoveryPlanShutdownGroupTaskDetails + extends RecoveryPlanGroupTaskDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "RecoveryPlanShutdownGroupTaskDetails"; -}; +} /** HyperV Replica Blue policy input. */ -export type HyperVReplicaBluePolicyInput = HyperVReplicaPolicyInput & { +export interface HyperVReplicaBluePolicyInput extends HyperVReplicaPolicyInput { /** Polymorphic discriminator, which specifies the different types this object can be */ instanceType: "HyperVReplica2012R2"; /** A value indicating the replication interval. */ replicationFrequencyInSeconds?: number; -}; +} + +/** Defines headers for ReplicationProtectedItems_updateMobilityService operation. */ +export interface ReplicationProtectedItemsUpdateMobilityServiceHeaders { + location?: string; +} /** Known values of {@link HealthErrorCustomerResolvability} that the service accepts. */ export enum KnownHealthErrorCustomerResolvability { + /** Allowed */ Allowed = "Allowed", + /** NotAllowed */ NotAllowed = "NotAllowed" } @@ -8600,17 +8893,40 @@ export type HealthErrorCustomerResolvability = string; /** Known values of {@link MigrationState} that the service accepts. */ export enum KnownMigrationState { + /** None */ None = "None", + /** EnableMigrationInProgress */ EnableMigrationInProgress = "EnableMigrationInProgress", + /** EnableMigrationFailed */ EnableMigrationFailed = "EnableMigrationFailed", + /** DisableMigrationInProgress */ DisableMigrationInProgress = "DisableMigrationInProgress", + /** DisableMigrationFailed */ DisableMigrationFailed = "DisableMigrationFailed", + /** InitialSeedingInProgress */ InitialSeedingInProgress = "InitialSeedingInProgress", + /** InitialSeedingFailed */ InitialSeedingFailed = "InitialSeedingFailed", + /** Replicating */ Replicating = "Replicating", + /** MigrationInProgress */ MigrationInProgress = "MigrationInProgress", + /** MigrationSucceeded */ MigrationSucceeded = "MigrationSucceeded", - MigrationFailed = "MigrationFailed" + /** MigrationFailed */ + MigrationFailed = "MigrationFailed", + /** ResumeInProgress */ + ResumeInProgress = "ResumeInProgress", + /** ResumeInitiated */ + ResumeInitiated = "ResumeInitiated", + /** SuspendingProtection */ + SuspendingProtection = "SuspendingProtection", + /** ProtectionSuspended */ + ProtectionSuspended = "ProtectionSuspended", + /** MigrationCompletedWithInformation */ + MigrationCompletedWithInformation = "MigrationCompletedWithInformation", + /** MigrationPartiallySucceeded */ + MigrationPartiallySucceeded = "MigrationPartiallySucceeded" } /** @@ -8628,17 +8944,32 @@ export enum KnownMigrationState { * **Replicating** \ * **MigrationInProgress** \ * **MigrationSucceeded** \ - * **MigrationFailed** + * **MigrationFailed** \ + * **ResumeInProgress** \ + * **ResumeInitiated** \ + * **SuspendingProtection** \ + * **ProtectionSuspended** \ + * **MigrationCompletedWithInformation** \ + * **MigrationPartiallySucceeded** */ export type MigrationState = string; /** Known values of {@link TestMigrationState} that the service accepts. */ export enum KnownTestMigrationState { + /** None */ None = "None", + /** TestMigrationInProgress */ TestMigrationInProgress = "TestMigrationInProgress", + /** TestMigrationSucceeded */ TestMigrationSucceeded = "TestMigrationSucceeded", + /** TestMigrationFailed */ TestMigrationFailed = "TestMigrationFailed", - TestMigrationCleanupInProgress = "TestMigrationCleanupInProgress" + /** TestMigrationCleanupInProgress */ + TestMigrationCleanupInProgress = "TestMigrationCleanupInProgress", + /** TestMigrationCompletedWithInformation */ + TestMigrationCompletedWithInformation = "TestMigrationCompletedWithInformation", + /** TestMigrationPartiallySucceeded */ + TestMigrationPartiallySucceeded = "TestMigrationPartiallySucceeded" } /** @@ -8650,15 +8981,21 @@ export enum KnownTestMigrationState { * **TestMigrationInProgress** \ * **TestMigrationSucceeded** \ * **TestMigrationFailed** \ - * **TestMigrationCleanupInProgress** + * **TestMigrationCleanupInProgress** \ + * **TestMigrationCompletedWithInformation** \ + * **TestMigrationPartiallySucceeded** */ export type TestMigrationState = string; /** Known values of {@link ProtectionHealth} that the service accepts. */ export enum KnownProtectionHealth { + /** None */ None = "None", + /** Normal */ Normal = "Normal", + /** Warning */ Warning = "Warning", + /** Critical */ Critical = "Critical" } @@ -8676,11 +9013,20 @@ export type ProtectionHealth = string; /** Known values of {@link MigrationItemOperation} that the service accepts. */ export enum KnownMigrationItemOperation { + /** DisableMigration */ DisableMigration = "DisableMigration", + /** TestMigrate */ TestMigrate = "TestMigrate", + /** TestMigrateCleanup */ TestMigrateCleanup = "TestMigrateCleanup", + /** Migrate */ Migrate = "Migrate", - StartResync = "StartResync" + /** StartResync */ + StartResync = "StartResync", + /** PauseReplication */ + PauseReplication = "PauseReplication", + /** ResumeReplication */ + ResumeReplication = "ResumeReplication" } /** @@ -8692,14 +9038,19 @@ export enum KnownMigrationItemOperation { * **TestMigrate** \ * **TestMigrateCleanup** \ * **Migrate** \ - * **StartResync** + * **StartResync** \ + * **PauseReplication** \ + * **ResumeReplication** */ export type MigrationItemOperation = string; /** Known values of {@link MigrationRecoveryPointType} that the service accepts. */ export enum KnownMigrationRecoveryPointType { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** ApplicationConsistent */ ApplicationConsistent = "ApplicationConsistent", + /** CrashConsistent */ CrashConsistent = "CrashConsistent" } @@ -8716,8 +9067,11 @@ export type MigrationRecoveryPointType = string; /** Known values of {@link LicenseType} that the service accepts. */ export enum KnownLicenseType { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** NoLicenseType */ NoLicenseType = "NoLicenseType", + /** WindowsServer */ WindowsServer = "WindowsServer" } @@ -8734,7 +9088,9 @@ export type LicenseType = string; /** Known values of {@link DisableProtectionReason} that the service accepts. */ export enum KnownDisableProtectionReason { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** MigrationComplete */ MigrationComplete = "MigrationComplete" } @@ -8750,10 +9106,15 @@ export type DisableProtectionReason = string; /** Known values of {@link AgentVersionStatus} that the service accepts. */ export enum KnownAgentVersionStatus { + /** Supported */ Supported = "Supported", + /** NotSupported */ NotSupported = "NotSupported", + /** Deprecated */ Deprecated = "Deprecated", + /** UpdateRequired */ UpdateRequired = "UpdateRequired", + /** SecurityUpdateRequired */ SecurityUpdateRequired = "SecurityUpdateRequired" } @@ -8772,8 +9133,11 @@ export type AgentVersionStatus = string; /** Known values of {@link ExportJobOutputSerializationType} that the service accepts. */ export enum KnownExportJobOutputSerializationType { + /** Json */ Json = "Json", + /** Xml */ Xml = "Xml", + /** Excel */ Excel = "Excel" } @@ -8790,8 +9154,11 @@ export type ExportJobOutputSerializationType = string; /** Known values of {@link RecoveryPlanGroupType} that the service accepts. */ export enum KnownRecoveryPlanGroupType { + /** Shutdown */ Shutdown = "Shutdown", + /** Boot */ Boot = "Boot", + /** Failover */ Failover = "Failover" } @@ -8808,19 +9175,33 @@ export type RecoveryPlanGroupType = string; /** Known values of {@link ReplicationProtectedItemOperation} that the service accepts. */ export enum KnownReplicationProtectedItemOperation { + /** ReverseReplicate */ ReverseReplicate = "ReverseReplicate", + /** Commit */ Commit = "Commit", + /** PlannedFailover */ PlannedFailover = "PlannedFailover", + /** UnplannedFailover */ UnplannedFailover = "UnplannedFailover", + /** DisableProtection */ DisableProtection = "DisableProtection", + /** TestFailover */ TestFailover = "TestFailover", + /** TestFailoverCleanup */ TestFailoverCleanup = "TestFailoverCleanup", + /** Failback */ Failback = "Failback", + /** FinalizeFailback */ FinalizeFailback = "FinalizeFailback", + /** CancelFailover */ CancelFailover = "CancelFailover", + /** ChangePit */ ChangePit = "ChangePit", + /** RepairReplication */ RepairReplication = "RepairReplication", + /** SwitchProtection */ SwitchProtection = "SwitchProtection", + /** CompleteMigration */ CompleteMigration = "CompleteMigration" } @@ -8848,7 +9229,9 @@ export type ReplicationProtectedItemOperation = string; /** Known values of {@link PossibleOperationsDirections} that the service accepts. */ export enum KnownPossibleOperationsDirections { + /** PrimaryToRecovery */ PrimaryToRecovery = "PrimaryToRecovery", + /** RecoveryToPrimary */ RecoveryToPrimary = "RecoveryToPrimary" } @@ -8864,8 +9247,11 @@ export type PossibleOperationsDirections = string; /** Known values of {@link FailoverDeploymentModel} that the service accepts. */ export enum KnownFailoverDeploymentModel { + /** NotApplicable */ NotApplicable = "NotApplicable", + /** Classic */ Classic = "Classic", + /** ResourceManager */ ResourceManager = "ResourceManager" } @@ -8882,7 +9268,9 @@ export type FailoverDeploymentModel = string; /** Known values of {@link SourceSiteOperations} that the service accepts. */ export enum KnownSourceSiteOperations { + /** Required */ Required = "Required", + /** NotRequired */ NotRequired = "NotRequired" } @@ -8898,16 +9286,27 @@ export type SourceSiteOperations = string; /** Known values of {@link HealthErrorCategory} that the service accepts. */ export enum KnownHealthErrorCategory { + /** None */ None = "None", + /** Replication */ Replication = "Replication", + /** TestFailover */ TestFailover = "TestFailover", + /** Configuration */ Configuration = "Configuration", + /** FabricInfrastructure */ FabricInfrastructure = "FabricInfrastructure", + /** VersionExpiry */ VersionExpiry = "VersionExpiry", + /** AgentAutoUpdateInfra */ AgentAutoUpdateInfra = "AgentAutoUpdateInfra", + /** AgentAutoUpdateArtifactDeleted */ AgentAutoUpdateArtifactDeleted = "AgentAutoUpdateArtifactDeleted", + /** AgentAutoUpdateRunAsAccount */ AgentAutoUpdateRunAsAccount = "AgentAutoUpdateRunAsAccount", + /** AgentAutoUpdateRunAsAccountExpiry */ AgentAutoUpdateRunAsAccountExpiry = "AgentAutoUpdateRunAsAccountExpiry", + /** AgentAutoUpdateRunAsAccountExpired */ AgentAutoUpdateRunAsAccountExpired = "AgentAutoUpdateRunAsAccountExpired" } @@ -8932,9 +9331,13 @@ export type HealthErrorCategory = string; /** Known values of {@link Severity} that the service accepts. */ export enum KnownSeverity { + /** None */ None = "NONE", + /** Warning */ Warning = "Warning", + /** Error */ Error = "Error", + /** Info */ Info = "Info" } @@ -8952,7 +9355,9 @@ export type Severity = string; /** Known values of {@link AgentAutoUpdateStatus} that the service accepts. */ export enum KnownAgentAutoUpdateStatus { + /** Disabled */ Disabled = "Disabled", + /** Enabled */ Enabled = "Enabled" } @@ -8968,7 +9373,9 @@ export type AgentAutoUpdateStatus = string; /** Known values of {@link AutomationAccountAuthenticationType} that the service accepts. */ export enum KnownAutomationAccountAuthenticationType { + /** RunAsAccount */ RunAsAccount = "RunAsAccount", + /** SystemAssignedIdentity */ SystemAssignedIdentity = "SystemAssignedIdentity" } @@ -8984,8 +9391,11 @@ export type AutomationAccountAuthenticationType = string; /** Known values of {@link A2ARecoveryAvailabilityType} that the service accepts. */ export enum KnownA2ARecoveryAvailabilityType { + /** Single */ Single = "Single", + /** AvailabilitySet */ AvailabilitySet = "AvailabilitySet", + /** AvailabilityZone */ AvailabilityZone = "AvailabilityZone" } @@ -9002,7 +9412,9 @@ export type A2ARecoveryAvailabilityType = string; /** Known values of {@link AutoProtectionOfDataDisk} that the service accepts. */ export enum KnownAutoProtectionOfDataDisk { + /** Disabled */ Disabled = "Disabled", + /** Enabled */ Enabled = "Enabled" } @@ -9018,6 +9430,7 @@ export type AutoProtectionOfDataDisk = string; /** Known values of {@link ExtendedLocationType} that the service accepts. */ export enum KnownExtendedLocationType { + /** EdgeZone */ EdgeZone = "EdgeZone" } @@ -9032,7 +9445,9 @@ export type ExtendedLocationType = string; /** Known values of {@link SetMultiVmSyncStatus} that the service accepts. */ export enum KnownSetMultiVmSyncStatus { + /** Enable */ Enable = "Enable", + /** Disable */ Disable = "Disable" } @@ -9048,7 +9463,9 @@ export type SetMultiVmSyncStatus = string; /** Known values of {@link RecoveryPointSyncType} that the service accepts. */ export enum KnownRecoveryPointSyncType { + /** MultiVmSyncRecoveryPoint */ MultiVmSyncRecoveryPoint = "MultiVmSyncRecoveryPoint", + /** PerVmRecoveryPoint */ PerVmRecoveryPoint = "PerVmRecoveryPoint" } @@ -9064,7 +9481,9 @@ export type RecoveryPointSyncType = string; /** Known values of {@link MultiVmGroupCreateOption} that the service accepts. */ export enum KnownMultiVmGroupCreateOption { + /** AutoCreated */ AutoCreated = "AutoCreated", + /** UserSpecified */ UserSpecified = "UserSpecified" } @@ -9080,8 +9499,11 @@ export type MultiVmGroupCreateOption = string; /** Known values of {@link VmEncryptionType} that the service accepts. */ export enum KnownVmEncryptionType { + /** NotEncrypted */ NotEncrypted = "NotEncrypted", + /** OnePassEncrypted */ OnePassEncrypted = "OnePassEncrypted", + /** TwoPassEncrypted */ TwoPassEncrypted = "TwoPassEncrypted" } @@ -9098,8 +9520,11 @@ export type VmEncryptionType = string; /** Known values of {@link DiskAccountType} that the service accepts. */ export enum KnownDiskAccountType { + /** StandardLRS */ StandardLRS = "Standard_LRS", + /** PremiumLRS */ PremiumLRS = "Premium_LRS", + /** StandardSSDLRS */ StandardSSDLRS = "StandardSSD_LRS" } @@ -9116,9 +9541,13 @@ export type DiskAccountType = string; /** Known values of {@link SqlServerLicenseType} that the service accepts. */ export enum KnownSqlServerLicenseType { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** NoLicenseType */ NoLicenseType = "NoLicenseType", + /** Payg */ Payg = "PAYG", + /** Ahub */ Ahub = "AHUB" } @@ -9136,8 +9565,11 @@ export type SqlServerLicenseType = string; /** Known values of {@link PresenceStatus} that the service accepts. */ export enum KnownPresenceStatus { + /** Unknown */ Unknown = "Unknown", + /** Present */ Present = "Present", + /** NotPresent */ NotPresent = "NotPresent" } @@ -9154,9 +9586,13 @@ export type PresenceStatus = string; /** Known values of {@link RcmComponentStatus} that the service accepts. */ export enum KnownRcmComponentStatus { + /** Healthy */ Healthy = "Healthy", + /** Warning */ Warning = "Warning", + /** Critical */ Critical = "Critical", + /** Unknown */ Unknown = "Unknown" } @@ -9174,19 +9610,33 @@ export type RcmComponentStatus = string; /** Known values of {@link AgentUpgradeBlockedReason} that the service accepts. */ export enum KnownAgentUpgradeBlockedReason { + /** AlreadyOnLatestVersion */ AlreadyOnLatestVersion = "AlreadyOnLatestVersion", + /** RebootRequired */ RebootRequired = "RebootRequired", + /** AgentNoHeartbeat */ AgentNoHeartbeat = "AgentNoHeartbeat", + /** RcmProxyNoHeartbeat */ RcmProxyNoHeartbeat = "RcmProxyNoHeartbeat", + /** ProcessServerNoHeartbeat */ ProcessServerNoHeartbeat = "ProcessServerNoHeartbeat", + /** IncompatibleApplianceVersion */ IncompatibleApplianceVersion = "IncompatibleApplianceVersion", + /** NotProtected */ NotProtected = "NotProtected", + /** UnsupportedProtectionScenario */ UnsupportedProtectionScenario = "UnsupportedProtectionScenario", + /** DistroIsNotReported */ DistroIsNotReported = "DistroIsNotReported", + /** DistroNotSupportedForUpgrade */ DistroNotSupportedForUpgrade = "DistroNotSupportedForUpgrade", + /** MissingUpgradePath */ MissingUpgradePath = "MissingUpgradePath", + /** InvalidAgentVersion */ InvalidAgentVersion = "InvalidAgentVersion", + /** InvalidDriverVersion */ InvalidDriverVersion = "InvalidDriverVersion", + /** Unknown */ Unknown = "Unknown" } @@ -9214,7 +9664,9 @@ export type AgentUpgradeBlockedReason = string; /** Known values of {@link InMageRcmFailbackRecoveryPointType} that the service accepts. */ export enum KnownInMageRcmFailbackRecoveryPointType { + /** ApplicationConsistent */ ApplicationConsistent = "ApplicationConsistent", + /** CrashConsistent */ CrashConsistent = "CrashConsistent" } @@ -9230,10 +9682,15 @@ export type InMageRcmFailbackRecoveryPointType = string; /** Known values of {@link DiskReplicationProgressHealth} that the service accepts. */ export enum KnownDiskReplicationProgressHealth { + /** None */ None = "None", + /** InProgress */ InProgress = "InProgress", + /** SlowProgress */ SlowProgress = "SlowProgress", + /** NoProgress */ NoProgress = "NoProgress", + /** Queued */ Queued = "Queued" } @@ -9252,9 +9709,13 @@ export type DiskReplicationProgressHealth = string; /** Known values of {@link VmReplicationProgressHealth} that the service accepts. */ export enum KnownVmReplicationProgressHealth { + /** None */ None = "None", + /** InProgress */ InProgress = "InProgress", + /** SlowProgress */ SlowProgress = "SlowProgress", + /** NoProgress */ NoProgress = "NoProgress" } @@ -9272,8 +9733,11 @@ export type VmReplicationProgressHealth = string; /** Known values of {@link ResyncState} that the service accepts. */ export enum KnownResyncState { + /** None */ None = "None", + /** PreparedForResynchronization */ PreparedForResynchronization = "PreparedForResynchronization", + /** StartedResynchronization */ StartedResynchronization = "StartedResynchronization" } @@ -9290,9 +9754,13 @@ export type ResyncState = string; /** Known values of {@link PlannedFailoverStatus} that the service accepts. */ export enum KnownPlannedFailoverStatus { + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** Cancelled */ Cancelled = "Cancelled", + /** Unknown */ Unknown = "Unknown" } @@ -9310,7 +9778,9 @@ export type PlannedFailoverStatus = string; /** Known values of {@link EthernetAddressType} that the service accepts. */ export enum KnownEthernetAddressType { + /** Dynamic */ Dynamic = "Dynamic", + /** Static */ Static = "Static" } @@ -9326,9 +9796,13 @@ export type EthernetAddressType = string; /** Known values of {@link MobilityAgentUpgradeState} that the service accepts. */ export enum KnownMobilityAgentUpgradeState { + /** None */ None = "None", + /** Started */ Started = "Started", + /** Completed */ Completed = "Completed", + /** Commit */ Commit = "Commit" } @@ -9346,8 +9820,11 @@ export type MobilityAgentUpgradeState = string; /** Known values of {@link RecoveryPointType} that the service accepts. */ export enum KnownRecoveryPointType { + /** LatestTime */ LatestTime = "LatestTime", + /** LatestTag */ LatestTag = "LatestTag", + /** Custom */ Custom = "Custom" } @@ -9364,9 +9841,13 @@ export type RecoveryPointType = string; /** Known values of {@link A2ARpRecoveryPointType} that the service accepts. */ export enum KnownA2ARpRecoveryPointType { + /** Latest */ Latest = "Latest", + /** LatestApplicationConsistent */ LatestApplicationConsistent = "LatestApplicationConsistent", + /** LatestCrashConsistent */ LatestCrashConsistent = "LatestCrashConsistent", + /** LatestProcessed */ LatestProcessed = "LatestProcessed" } @@ -9384,7 +9865,9 @@ export type A2ARpRecoveryPointType = string; /** Known values of {@link MultiVmSyncPointOption} that the service accepts. */ export enum KnownMultiVmSyncPointOption { + /** UseMultiVmSyncRecoveryPoint */ UseMultiVmSyncRecoveryPoint = "UseMultiVmSyncRecoveryPoint", + /** UsePerVmRecoveryPoint */ UsePerVmRecoveryPoint = "UsePerVmRecoveryPoint" } @@ -9400,7 +9883,9 @@ export type MultiVmSyncPointOption = string; /** Known values of {@link RecoveryPlanActionLocation} that the service accepts. */ export enum KnownRecoveryPlanActionLocation { + /** Primary */ Primary = "Primary", + /** Recovery */ Recovery = "Recovery" } @@ -9416,7 +9901,9 @@ export type RecoveryPlanActionLocation = string; /** Known values of {@link DataSyncStatus} that the service accepts. */ export enum KnownDataSyncStatus { + /** ForDownTime */ ForDownTime = "ForDownTime", + /** ForSynchronization */ ForSynchronization = "ForSynchronization" } @@ -9432,7 +9919,9 @@ export type DataSyncStatus = string; /** Known values of {@link AlternateLocationRecoveryOption} that the service accepts. */ export enum KnownAlternateLocationRecoveryOption { + /** CreateVmIfNotFound */ CreateVmIfNotFound = "CreateVmIfNotFound", + /** NoAction */ NoAction = "NoAction" } @@ -9448,8 +9937,11 @@ export type AlternateLocationRecoveryOption = string; /** Known values of {@link HyperVReplicaAzureRpRecoveryPointType} that the service accepts. */ export enum KnownHyperVReplicaAzureRpRecoveryPointType { + /** Latest */ Latest = "Latest", + /** LatestApplicationConsistent */ LatestApplicationConsistent = "LatestApplicationConsistent", + /** LatestProcessed */ LatestProcessed = "LatestProcessed" } @@ -9466,9 +9958,13 @@ export type HyperVReplicaAzureRpRecoveryPointType = string; /** Known values of {@link InMageV2RpRecoveryPointType} that the service accepts. */ export enum KnownInMageV2RpRecoveryPointType { + /** Latest */ Latest = "Latest", + /** LatestApplicationConsistent */ LatestApplicationConsistent = "LatestApplicationConsistent", + /** LatestCrashConsistent */ LatestCrashConsistent = "LatestCrashConsistent", + /** LatestProcessed */ LatestProcessed = "LatestProcessed" } @@ -9486,8 +9982,11 @@ export type InMageV2RpRecoveryPointType = string; /** Known values of {@link RpInMageRecoveryPointType} that the service accepts. */ export enum KnownRpInMageRecoveryPointType { + /** LatestTime */ LatestTime = "LatestTime", + /** LatestTag */ LatestTag = "LatestTag", + /** Custom */ Custom = "Custom" } @@ -9504,9 +10003,13 @@ export type RpInMageRecoveryPointType = string; /** Known values of {@link RecoveryPlanPointType} that the service accepts. */ export enum KnownRecoveryPlanPointType { + /** Latest */ Latest = "Latest", + /** LatestApplicationConsistent */ LatestApplicationConsistent = "LatestApplicationConsistent", + /** LatestCrashConsistent */ LatestCrashConsistent = "LatestCrashConsistent", + /** LatestProcessed */ LatestProcessed = "LatestProcessed" } @@ -9576,10 +10079,7 @@ export type ReplicationAppliancesListResponse = ApplianceCollection; /** Optional parameters. */ export interface ReplicationAppliancesListNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter options. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ReplicationAppliancesListNextResponse = ApplianceCollection; @@ -9617,10 +10117,7 @@ export type ReplicationEventsGetResponse = Event; /** Optional parameters. */ export interface ReplicationEventsListNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter options. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ReplicationEventsListNextResponse = EventCollection; @@ -9996,6 +10493,30 @@ export interface ReplicationMigrationItemsMigrateOptionalParams /** Contains response data for the migrate operation. */ export type ReplicationMigrationItemsMigrateResponse = MigrationItem; +/** Optional parameters. */ +export interface ReplicationMigrationItemsPauseReplicationOptionalParams + 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 pauseReplication operation. */ +export type ReplicationMigrationItemsPauseReplicationResponse = MigrationItem; + +/** Optional parameters. */ +export interface ReplicationMigrationItemsResumeReplicationOptionalParams + 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 resumeReplication operation. */ +export type ReplicationMigrationItemsResumeReplicationResponse = MigrationItem; + /** Optional parameters. */ export interface ReplicationMigrationItemsResyncOptionalParams extends coreClient.OperationOptions { @@ -10048,28 +10569,14 @@ export type ReplicationMigrationItemsListResponse = MigrationItemCollection; /** Optional parameters. */ export interface ReplicationMigrationItemsListByReplicationProtectionContainersNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter options. */ - filter?: string; - /** The pagination token. */ - skipToken?: string; - /** The page size. */ - takeToken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByReplicationProtectionContainersNext operation. */ export type ReplicationMigrationItemsListByReplicationProtectionContainersNextResponse = MigrationItemCollection; /** Optional parameters. */ export interface ReplicationMigrationItemsListNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter options. */ - filter?: string; - /** The pagination token. */ - skipToken?: string; - /** The page size. */ - takeToken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ReplicationMigrationItemsListNextResponse = MigrationItemCollection; @@ -10118,14 +10625,7 @@ export type ReplicationProtectableItemsGetResponse = ProtectableItem; /** Optional parameters. */ export interface ReplicationProtectableItemsListByReplicationProtectionContainersNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter options. */ - filter?: string; - /** take OData query parameter. */ - take?: string; - /** skipToken OData query parameter. */ - skipToken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByReplicationProtectionContainersNext operation. */ export type ReplicationProtectableItemsListByReplicationProtectionContainersNextResponse = ProtectableItemCollection; @@ -10387,12 +10887,7 @@ export type ReplicationProtectedItemsListByReplicationProtectionContainersNextRe /** Optional parameters. */ export interface ReplicationProtectedItemsListNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter options. */ - filter?: string; - /** The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. */ - skipToken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ReplicationProtectedItemsListNextResponse = ReplicationProtectedItemCollection; @@ -10812,10 +11307,7 @@ export type ReplicationJobsExportResponse = Job; /** Optional parameters. */ export interface ReplicationJobsListNextOptionalParams - extends coreClient.OperationOptions { - /** OData filter options. */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ReplicationJobsListNextResponse = JobCollection; @@ -10902,12 +11394,7 @@ export type ReplicationProtectionIntentsCreateResponse = ReplicationProtectionIn /** Optional parameters. */ export interface ReplicationProtectionIntentsListNextOptionalParams - extends coreClient.OperationOptions { - /** The pagination token. */ - skipToken?: string; - /** The page size. */ - takeToken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ReplicationProtectionIntentsListNextResponse = ReplicationProtectionIntentCollection; diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/mappers.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/mappers.ts index 56a122bc57ff..310b5195eb01 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/mappers.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/mappers.ts @@ -1737,6 +1737,20 @@ export const MigrationItemProperties: coreClient.CompositeMapper = { name: "String" } }, + recoveryServicesProviderId: { + serializedName: "recoveryServicesProviderId", + readOnly: true, + type: { + name: "String" + } + }, + replicationStatus: { + serializedName: "replicationStatus", + readOnly: true, + type: { + name: "String" + } + }, migrationState: { serializedName: "migrationState", readOnly: true, @@ -1765,6 +1779,20 @@ export const MigrationItemProperties: coreClient.CompositeMapper = { name: "String" } }, + lastMigrationTime: { + serializedName: "lastMigrationTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + lastMigrationStatus: { + serializedName: "lastMigrationStatus", + readOnly: true, + type: { + name: "String" + } + }, testMigrateState: { serializedName: "testMigrateState", readOnly: true, @@ -1818,6 +1846,19 @@ export const MigrationItemProperties: coreClient.CompositeMapper = { className: "CurrentJobDetails" } }, + criticalJobHistory: { + serializedName: "criticalJobHistory", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CriticalJobHistoryDetails" + } + } + } + }, eventCorrelationId: { serializedName: "eventCorrelationId", readOnly: true, @@ -1866,6 +1907,43 @@ export const CurrentJobDetails: coreClient.CompositeMapper = { } }; +export const CriticalJobHistoryDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CriticalJobHistoryDetails", + modelProperties: { + jobName: { + serializedName: "jobName", + readOnly: true, + type: { + name: "String" + } + }, + jobId: { + serializedName: "jobId", + readOnly: true, + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + jobStatus: { + serializedName: "jobStatus", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const MigrationProviderSpecificSettings: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2103,6 +2181,91 @@ export const MigrationRecoveryPointProperties: coreClient.CompositeMapper = { } }; +export const PauseReplicationInput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PauseReplicationInput", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PauseReplicationInputProperties" + } + } + } + } +}; + +export const PauseReplicationInputProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PauseReplicationInputProperties", + modelProperties: { + instanceType: { + serializedName: "instanceType", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ResumeReplicationInput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResumeReplicationInput", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ResumeReplicationInputProperties" + } + } + } + } +}; + +export const ResumeReplicationInputProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResumeReplicationInputProperties", + modelProperties: { + providerSpecificDetails: { + serializedName: "providerSpecificDetails", + type: { + name: "Composite", + className: "ResumeReplicationProviderSpecificInput" + } + } + } + } +}; + +export const ResumeReplicationProviderSpecificInput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResumeReplicationProviderSpecificInput", + uberParent: "ResumeReplicationProviderSpecificInput", + polymorphicDiscriminator: { + serializedName: "instanceType", + clientName: "instanceType" + }, + modelProperties: { + instanceType: { + serializedName: "instanceType", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const ResyncInput: coreClient.CompositeMapper = { type: { name: "Composite", @@ -7163,6 +7326,29 @@ export const ExtendedLocation: coreClient.CompositeMapper = { } }; +export const A2AExtendedLocationDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "A2AExtendedLocationDetails", + modelProperties: { + primaryExtendedLocation: { + serializedName: "primaryExtendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + recoveryExtendedLocation: { + serializedName: "recoveryExtendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + } + } + } +}; + export const A2AProtectedDiskDetails: coreClient.CompositeMapper = { type: { name: "Composite", @@ -11051,6 +11237,13 @@ export const InMageRcmProtectedDiskDetails: coreClient.CompositeMapper = { name: "String" } }, + seedBlobUri: { + serializedName: "seedBlobUri", + readOnly: true, + type: { + name: "String" + } + }, targetManagedDiskId: { serializedName: "targetManagedDiskId", readOnly: true, @@ -11926,6 +12119,13 @@ export const VMwareCbtProtectedDiskDetails: coreClient.CompositeMapper = { name: "String" } }, + seedBlobUri: { + serializedName: "seedBlobUri", + readOnly: true, + type: { + name: "String" + } + }, targetManagedDiskId: { serializedName: "targetManagedDiskId", readOnly: true, @@ -11933,6 +12133,13 @@ export const VMwareCbtProtectedDiskDetails: coreClient.CompositeMapper = { name: "String" } }, + targetBlobUri: { + serializedName: "targetBlobUri", + readOnly: true, + type: { + name: "String" + } + }, targetDiskName: { serializedName: "targetDiskName", type: { @@ -12000,6 +12207,30 @@ export const VMwareCbtNicDetails: coreClient.CompositeMapper = { name: "String" } }, + testNetworkId: { + serializedName: "testNetworkId", + type: { + name: "String" + } + }, + testSubnetName: { + serializedName: "testSubnetName", + type: { + name: "String" + } + }, + testIPAddress: { + serializedName: "testIPAddress", + type: { + name: "String" + } + }, + testIPAddressType: { + serializedName: "testIPAddressType", + type: { + name: "String" + } + }, targetNicName: { serializedName: "targetNicName", type: { @@ -12058,6 +12289,18 @@ export const VMwareCbtNicInput: coreClient.CompositeMapper = { type: { name: "String" } + }, + testSubnetName: { + serializedName: "testSubnetName", + type: { + name: "String" + } + }, + testStaticIPAddress: { + serializedName: "testStaticIPAddress", + type: { + name: "String" + } } } } @@ -12080,6 +12323,12 @@ export const VMwareCbtUpdateDiskInput: coreClient.CompositeMapper = { type: { name: "String" } + }, + isOSDisk: { + serializedName: "isOSDisk", + type: { + name: "String" + } } } } @@ -12988,6 +13237,18 @@ export const AzureFabricSpecificDetails: coreClient.CompositeMapper = { } } } + }, + extendedLocations: { + serializedName: "extendedLocations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "A2AExtendedLocationDetails" + } + } + } } } } @@ -13861,6 +14122,13 @@ export const VMwareCbtMigrationDetails: coreClient.CompositeMapper = { name: "String" } }, + storageAccountId: { + serializedName: "storageAccountId", + readOnly: true, + type: { + name: "String" + } + }, targetVmName: { serializedName: "targetVmName", type: { @@ -13935,6 +14203,12 @@ export const VMwareCbtMigrationDetails: coreClient.CompositeMapper = { name: "String" } }, + testNetworkId: { + serializedName: "testNetworkId", + type: { + name: "String" + } + }, vmNics: { serializedName: "vmNics", type: { @@ -13996,6 +14270,13 @@ export const VMwareCbtMigrationDetails: coreClient.CompositeMapper = { name: "Number" } }, + resumeProgressPercentage: { + serializedName: "resumeProgressPercentage", + readOnly: true, + type: { + name: "Number" + } + }, initialSeedingRetryCount: { serializedName: "initialSeedingRetryCount", readOnly: true, @@ -14010,6 +14291,13 @@ export const VMwareCbtMigrationDetails: coreClient.CompositeMapper = { name: "Number" } }, + resumeRetryCount: { + serializedName: "resumeRetryCount", + readOnly: true, + type: { + name: "Number" + } + }, resyncRequired: { serializedName: "resyncRequired", readOnly: true, @@ -14090,6 +14378,12 @@ export const VMwareCbtEnableMigrationInput: coreClient.CompositeMapper = { name: "String" } }, + performSqlBulkRegistration: { + serializedName: "performSqlBulkRegistration", + type: { + name: "String" + } + }, dataMoverRunAsAccountId: { serializedName: "dataMoverRunAsAccountId", required: true, @@ -14130,12 +14424,24 @@ export const VMwareCbtEnableMigrationInput: coreClient.CompositeMapper = { name: "String" } }, + testNetworkId: { + serializedName: "testNetworkId", + type: { + name: "String" + } + }, targetSubnetName: { serializedName: "targetSubnetName", type: { name: "String" } }, + testSubnetName: { + serializedName: "testSubnetName", + type: { + name: "String" + } + }, targetAvailabilitySetId: { serializedName: "targetAvailabilitySetId", type: { @@ -14256,6 +14562,12 @@ export const VMwareCbtUpdateMigrationItemInput: coreClient.CompositeMapper = { name: "String" } }, + testNetworkId: { + serializedName: "testNetworkId", + type: { + name: "String" + } + }, vmNics: { serializedName: "vmNics", type: { @@ -14344,6 +14656,26 @@ export const VMwareCbtMigrateInput: coreClient.CompositeMapper = { } }; +export const VMwareCbtResumeReplicationInput: coreClient.CompositeMapper = { + serializedName: "VMwareCbt", + type: { + name: "Composite", + className: "VMwareCbtResumeReplicationInput", + uberParent: "ResumeReplicationProviderSpecificInput", + polymorphicDiscriminator: + ResumeReplicationProviderSpecificInput.type.polymorphicDiscriminator, + modelProperties: { + ...ResumeReplicationProviderSpecificInput.type.modelProperties, + deleteMigrationResources: { + serializedName: "deleteMigrationResources", + type: { + name: "String" + } + } + } + } +}; + export const VMwareCbtResyncInput: coreClient.CompositeMapper = { serializedName: "VMwareCbt", type: { @@ -14388,6 +14720,18 @@ export const VMwareCbtTestMigrateInput: coreClient.CompositeMapper = { type: { name: "String" } + }, + vmNics: { + serializedName: "vmNics", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VMwareCbtNicInput" + } + } + } } } } @@ -16223,6 +16567,13 @@ export const InMageRcmReplicationDetails: coreClient.CompositeMapper = { name: "String" } }, + storageAccountId: { + serializedName: "storageAccountId", + readOnly: true, + type: { + name: "String" + } + }, targetVmName: { serializedName: "targetVmName", type: { @@ -18963,6 +19314,14 @@ export const VMwareCbtProtectionContainerMappingDetails: coreClient.CompositeMap type: { name: "String" } + }, + roleSizeToNicCountMap: { + serializedName: "roleSizeToNicCountMap", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "Number" } } + } } } } @@ -19014,14 +19373,12 @@ export const VMwareCbtContainerMappingInput: coreClient.CompositeMapper = { ...ReplicationProviderSpecificContainerMappingInput.type.modelProperties, keyVaultId: { serializedName: "keyVaultId", - required: true, type: { name: "String" } }, keyVaultUri: { serializedName: "keyVaultUri", - required: true, type: { name: "String" } @@ -19035,14 +19392,12 @@ export const VMwareCbtContainerMappingInput: coreClient.CompositeMapper = { }, storageAccountSasSecretName: { serializedName: "storageAccountSasSecretName", - required: true, type: { name: "String" } }, serviceBusConnectionStringSecretName: { serializedName: "serviceBusConnectionStringSecretName", - required: true, type: { name: "String" } @@ -20973,6 +21328,20 @@ export const RecoveryPlanA2ADetails: coreClient.CompositeMapper = { type: { name: "String" } + }, + primaryExtendedLocation: { + serializedName: "primaryExtendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } + }, + recoveryExtendedLocation: { + serializedName: "recoveryExtendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation" + } } } } @@ -21420,9 +21789,9 @@ export const VmmVirtualMachineDetails: coreClient.CompositeMapper = { type: { name: "Composite", className: "VmmVirtualMachineDetails", - uberParent: "ConfigurationSettings", + uberParent: "HyperVVirtualMachineDetails", polymorphicDiscriminator: - ConfigurationSettings.type.polymorphicDiscriminator, + HyperVVirtualMachineDetails.type.polymorphicDiscriminator, modelProperties: { ...HyperVVirtualMachineDetails.type.modelProperties } @@ -21434,8 +21803,8 @@ export const FabricReplicationGroupTaskDetails: coreClient.CompositeMapper = { type: { name: "Composite", className: "FabricReplicationGroupTaskDetails", - uberParent: "TaskTypeDetails", - polymorphicDiscriminator: TaskTypeDetails.type.polymorphicDiscriminator, + uberParent: "JobTaskDetails", + polymorphicDiscriminator: JobTaskDetails.type.polymorphicDiscriminator, modelProperties: { ...JobTaskDetails.type.modelProperties, skippedReason: { @@ -21459,8 +21828,8 @@ export const VirtualMachineTaskDetails: coreClient.CompositeMapper = { type: { name: "Composite", className: "VirtualMachineTaskDetails", - uberParent: "TaskTypeDetails", - polymorphicDiscriminator: TaskTypeDetails.type.polymorphicDiscriminator, + uberParent: "JobTaskDetails", + polymorphicDiscriminator: JobTaskDetails.type.polymorphicDiscriminator, modelProperties: { ...JobTaskDetails.type.modelProperties, skippedReason: { @@ -21484,8 +21853,9 @@ export const RecoveryPlanShutdownGroupTaskDetails: coreClient.CompositeMapper = type: { name: "Composite", className: "RecoveryPlanShutdownGroupTaskDetails", - uberParent: "GroupTaskDetails", - polymorphicDiscriminator: GroupTaskDetails.type.polymorphicDiscriminator, + uberParent: "RecoveryPlanGroupTaskDetails", + polymorphicDiscriminator: + RecoveryPlanGroupTaskDetails.type.polymorphicDiscriminator, modelProperties: { ...RecoveryPlanGroupTaskDetails.type.modelProperties } @@ -21497,9 +21867,9 @@ export const HyperVReplicaBluePolicyInput: coreClient.CompositeMapper = { type: { name: "Composite", className: "HyperVReplicaBluePolicyInput", - uberParent: "PolicyProviderSpecificInput", + uberParent: "HyperVReplicaPolicyInput", polymorphicDiscriminator: - PolicyProviderSpecificInput.type.polymorphicDiscriminator, + HyperVReplicaPolicyInput.type.polymorphicDiscriminator, modelProperties: { ...HyperVReplicaPolicyInput.type.modelProperties, replicationFrequencyInSeconds: { @@ -21512,6 +21882,21 @@ export const HyperVReplicaBluePolicyInput: coreClient.CompositeMapper = { } }; +export const ReplicationProtectedItemsUpdateMobilityServiceHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReplicationProtectedItemsUpdateMobilityServiceHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export let discriminators = { ApplianceSpecificDetails: ApplianceSpecificDetails, EventProviderSpecificDetails: EventProviderSpecificDetails, @@ -21526,6 +21911,7 @@ export let discriminators = { EnableMigrationProviderSpecificInput: EnableMigrationProviderSpecificInput, UpdateMigrationItemProviderSpecificInput: UpdateMigrationItemProviderSpecificInput, MigrateProviderSpecificInput: MigrateProviderSpecificInput, + ResumeReplicationProviderSpecificInput: ResumeReplicationProviderSpecificInput, ResyncProviderSpecificInput: ResyncProviderSpecificInput, TestMigrateProviderSpecificInput: TestMigrateProviderSpecificInput, ConfigurationSettings: ConfigurationSettings, @@ -21600,6 +21986,7 @@ export let discriminators = { "EnableMigrationProviderSpecificInput.VMwareCbt": VMwareCbtEnableMigrationInput, "UpdateMigrationItemProviderSpecificInput.VMwareCbt": VMwareCbtUpdateMigrationItemInput, "MigrateProviderSpecificInput.VMwareCbt": VMwareCbtMigrateInput, + "ResumeReplicationProviderSpecificInput.VMwareCbt": VMwareCbtResumeReplicationInput, "ResyncProviderSpecificInput.VMwareCbt": VMwareCbtResyncInput, "TestMigrateProviderSpecificInput.VMwareCbt": VMwareCbtTestMigrateInput, "ConfigurationSettings.HyperVVirtualMachine": HyperVVirtualMachineDetails, @@ -21720,9 +22107,9 @@ export let discriminators = { "RecoveryVirtualNetworkCustomDetails.New": NewRecoveryVirtualNetwork, "RecoveryProximityPlacementGroupCustomDetails.Existing": ExistingRecoveryProximityPlacementGroup, "RecoveryResourceGroupCustomDetails.Existing": ExistingRecoveryResourceGroup, - "ConfigurationSettings.VmmVirtualMachine": VmmVirtualMachineDetails, - "TaskTypeDetails.FabricReplicationGroupTaskDetails": FabricReplicationGroupTaskDetails, - "TaskTypeDetails.VirtualMachineTaskDetails": VirtualMachineTaskDetails, - "GroupTaskDetails.RecoveryPlanShutdownGroupTaskDetails": RecoveryPlanShutdownGroupTaskDetails, - "PolicyProviderSpecificInput.HyperVReplica2012R2": HyperVReplicaBluePolicyInput + "HyperVVirtualMachineDetails.VmmVirtualMachine": VmmVirtualMachineDetails, + "JobTaskDetails.FabricReplicationGroupTaskDetails": FabricReplicationGroupTaskDetails, + "JobTaskDetails.VirtualMachineTaskDetails": VirtualMachineTaskDetails, + "RecoveryPlanGroupTaskDetails.RecoveryPlanShutdownGroupTaskDetails": RecoveryPlanShutdownGroupTaskDetails, + "HyperVReplicaPolicyInput.HyperVReplica2012R2": HyperVReplicaBluePolicyInput }; diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/parameters.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/parameters.ts index 0ba73dafd91e..c740483d22df 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/parameters.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/models/parameters.ts @@ -24,6 +24,8 @@ import { EnableMigrationInput as EnableMigrationInputMapper, UpdateMigrationItemInput as UpdateMigrationItemInputMapper, MigrateInput as MigrateInputMapper, + PauseReplicationInput as PauseReplicationInputMapper, + ResumeReplicationInput as ResumeReplicationInputMapper, ResyncInput as ResyncInputMapper, TestMigrateInput as TestMigrateInputMapper, TestMigrateCleanupInput as TestMigrateCleanupInputMapper, @@ -90,7 +92,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-11-01", + defaultValue: "2022-10-01", isConstant: true, serializedName: "api-version", type: { @@ -355,6 +357,16 @@ export const migrateInput: OperationParameter = { mapper: MigrateInputMapper }; +export const pauseReplicationInput: OperationParameter = { + parameterPath: "pauseReplicationInput", + mapper: PauseReplicationInputMapper +}; + +export const resumeReplicationInput: OperationParameter = { + parameterPath: "resumeReplicationInput", + mapper: ResumeReplicationInputMapper +}; + export const input5: OperationParameter = { parameterPath: "input", mapper: ResyncInputMapper @@ -498,17 +510,6 @@ export const updateMobilityServiceRequest: OperationParameter = { mapper: UpdateMobilityServiceRequestMapper }; -export const replicationProtectedItemName: OperationURLParameter = { - parameterPath: "replicationProtectedItemName", - mapper: { - serializedName: "replicationProtectedItemName", - required: true, - type: { - name: "String" - } - } -}; - export const recoveryPointName: OperationURLParameter = { parameterPath: "recoveryPointName", mapper: { diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/migrationRecoveryPoints.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/migrationRecoveryPoints.ts index a0dfe8e1f11b..906df566cda8 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/migrationRecoveryPoints.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/migrationRecoveryPoints.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { MigrationRecoveryPoints } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -37,18 +38,25 @@ export class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { /** * Gets the recovery points for a migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. * @param options The options parameters. */ public listByReplicationMigrationItems( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, options?: MigrationRecoveryPointsListByReplicationMigrationItemsOptionalParams ): PagedAsyncIterableIterator { const iter = this.listByReplicationMigrationItemsPagingAll( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -61,33 +69,52 @@ export class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByReplicationMigrationItemsPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, - options + options, + settings ); } }; } private async *listByReplicationMigrationItemsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, - options?: MigrationRecoveryPointsListByReplicationMigrationItemsOptionalParams + options?: MigrationRecoveryPointsListByReplicationMigrationItemsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationMigrationItems( - fabricName, - protectionContainerName, - migrationItemName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: MigrationRecoveryPointsListByReplicationMigrationItemsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationMigrationItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationMigrationItemsNext( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -95,17 +122,23 @@ export class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationMigrationItemsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, options?: MigrationRecoveryPointsListByReplicationMigrationItemsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationMigrationItemsPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -117,25 +150,40 @@ export class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { /** * Gets the recovery points for a migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. * @param options The options parameters. */ private _listByReplicationMigrationItems( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, options?: MigrationRecoveryPointsListByReplicationMigrationItemsOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, migrationItemName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + options + }, listByReplicationMigrationItemsOperationSpec ); } /** * Gets a recovery point for a migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -143,6 +191,8 @@ export class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -151,6 +201,8 @@ export class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { ): Promise { return this.client.sendOperationRequest( { + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -163,6 +215,9 @@ export class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { /** * ListByReplicationMigrationItemsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -171,6 +226,8 @@ export class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { * @param options The options parameters. */ private _listByReplicationMigrationItemsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -181,6 +238,8 @@ export class MigrationRecoveryPointsImpl implements MigrationRecoveryPoints { > { return this.client.sendOperationRequest( { + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -247,7 +306,6 @@ const listByReplicationMigrationItemsNextOperationSpec: coreClient.OperationSpec bodyMapper: Mappers.MigrationRecoveryPointCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/operations.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/operations.ts index fc04339199dc..fcf0a47d4df3 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/operations.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/operations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -35,12 +36,15 @@ export class OperationsImpl implements Operations { /** * Operation to return the list of available operations. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceGroupName: string, options?: OperationsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceGroupName, options); return { next() { return iter.next(); @@ -48,54 +52,81 @@ export class OperationsImpl implements Operations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceGroupName, options, settings); } }; } private async *listPagingPage( - options?: OperationsListOptionalParams + resourceGroupName: string, + options?: OperationsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceGroupName: string, options?: OperationsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage(resourceGroupName, options)) { yield* page; } } /** * Operation to return the list of available operations. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceGroupName: string, options?: OperationsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listOperationSpec + ); } /** * ListNext + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceGroupName: string, nextLink: string, options?: OperationsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -129,7 +160,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.OperationsDiscoveryCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/recoveryPoints.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/recoveryPoints.ts index 5043e8c6fbe1..0892597f7565 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/recoveryPoints.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/recoveryPoints.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { RecoveryPoints } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -37,18 +38,25 @@ export class RecoveryPointsImpl implements RecoveryPoints { /** * Lists the available recovery points for a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replication protected item name. * @param options The options parameters. */ public listByReplicationProtectedItems( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: RecoveryPointsListByReplicationProtectedItemsOptionalParams ): PagedAsyncIterableIterator { const iter = this.listByReplicationProtectedItemsPagingAll( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -61,33 +69,52 @@ export class RecoveryPointsImpl implements RecoveryPoints { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByReplicationProtectedItemsPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, - options + options, + settings ); } }; } private async *listByReplicationProtectedItemsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, - options?: RecoveryPointsListByReplicationProtectedItemsOptionalParams + options?: RecoveryPointsListByReplicationProtectedItemsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationProtectedItems( - fabricName, - protectionContainerName, - replicatedProtectedItemName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: RecoveryPointsListByReplicationProtectedItemsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationProtectedItemsNext( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -95,17 +122,23 @@ export class RecoveryPointsImpl implements RecoveryPoints { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationProtectedItemsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: RecoveryPointsListByReplicationProtectedItemsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationProtectedItemsPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -117,12 +150,17 @@ export class RecoveryPointsImpl implements RecoveryPoints { /** * Lists the available recovery points for a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replication protected item name. * @param options The options parameters. */ private _listByReplicationProtectedItems( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -130,6 +168,8 @@ export class RecoveryPointsImpl implements RecoveryPoints { ): Promise { return this.client.sendOperationRequest( { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -141,6 +181,9 @@ export class RecoveryPointsImpl implements RecoveryPoints { /** * Get the details of specified recovery point. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replication protected item name. @@ -148,6 +191,8 @@ export class RecoveryPointsImpl implements RecoveryPoints { * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -156,6 +201,8 @@ export class RecoveryPointsImpl implements RecoveryPoints { ): Promise { return this.client.sendOperationRequest( { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -168,6 +215,9 @@ export class RecoveryPointsImpl implements RecoveryPoints { /** * ListByReplicationProtectedItemsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replication protected item name. @@ -176,6 +226,8 @@ export class RecoveryPointsImpl implements RecoveryPoints { * @param options The options parameters. */ private _listByReplicationProtectedItemsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -184,6 +236,8 @@ export class RecoveryPointsImpl implements RecoveryPoints { ): Promise { return this.client.sendOperationRequest( { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -250,7 +304,6 @@ const listByReplicationProtectedItemsNextOperationSpec: coreClient.OperationSpec bodyMapper: Mappers.RecoveryPointCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationAlertSettings.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationAlertSettings.ts index 9f848478146f..840919d39dea 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationAlertSettings.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationAlertSettings.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationAlertSettings } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -40,12 +41,17 @@ export class ReplicationAlertSettingsImpl implements ReplicationAlertSettings { /** * Gets the list of email notification(alert) configurations for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationAlertSettingsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -53,86 +59,139 @@ export class ReplicationAlertSettingsImpl implements ReplicationAlertSettings { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationAlertSettingsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationAlertSettingsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationAlertSettingsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationAlertSettingsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Gets the list of email notification(alert) configurations for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationAlertSettingsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * Gets the details of the specified email notification(alert) configuration. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param alertSettingName The name of the email notification configuration. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, alertSettingName: string, options?: ReplicationAlertSettingsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { alertSettingName, options }, + { resourceName, resourceGroupName, alertSettingName, options }, getOperationSpec ); } /** * Create or update an email notification(alert) configuration. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param alertSettingName The name of the email notification(alert) configuration. * @param request The input to configure the email notification(alert). * @param options The options parameters. */ create( + resourceName: string, + resourceGroupName: string, alertSettingName: string, request: ConfigureAlertRequest, options?: ReplicationAlertSettingsCreateOptionalParams ): Promise { return this.client.sendOperationRequest( - { alertSettingName, request, options }, + { resourceName, resourceGroupName, alertSettingName, request, options }, createOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationAlertSettingsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -209,7 +268,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AlertCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationAppliances.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationAppliances.ts index dc0a6eb05521..aab389e1da35 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationAppliances.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationAppliances.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationAppliances } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -35,12 +36,17 @@ export class ReplicationAppliancesImpl implements ReplicationAppliances { /** * Gets the list of Azure Site Recovery appliances for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationAppliancesListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -48,54 +54,97 @@ export class ReplicationAppliancesImpl implements ReplicationAppliances { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationAppliancesListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationAppliancesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationAppliancesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationAppliancesListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Gets the list of Azure Site Recovery appliances for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationAppliancesListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationAppliancesListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -130,7 +179,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ApplianceCollection } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationEligibilityResultsOperations.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationEligibilityResultsOperations.ts index 54fcc5a5a468..a1c48850128a 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationEligibilityResultsOperations.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationEligibilityResultsOperations.ts @@ -33,30 +33,36 @@ export class ReplicationEligibilityResultsOperationsImpl /** * Validates whether a given VM can be protected or not in which case returns list of errors. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param virtualMachineName Virtual Machine name. * @param options The options parameters. */ list( + resourceGroupName: string, virtualMachineName: string, options?: ReplicationEligibilityResultsListOptionalParams ): Promise { return this.client.sendOperationRequest( - { virtualMachineName, options }, + { resourceGroupName, virtualMachineName, options }, listOperationSpec ); } /** * Validates whether a given VM can be protected or not in which case returns list of errors. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param virtualMachineName Virtual Machine name. * @param options The options parameters. */ get( + resourceGroupName: string, virtualMachineName: string, options?: ReplicationEligibilityResultsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { virtualMachineName, options }, + { resourceGroupName, virtualMachineName, options }, getOperationSpec ); } diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationEvents.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationEvents.ts index b03cb3eebfe0..3e478d438d91 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationEvents.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationEvents.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationEvents } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -37,12 +38,17 @@ export class ReplicationEventsImpl implements ReplicationEvents { /** * Gets the list of Azure Site Recovery events for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationEventsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -50,69 +56,117 @@ export class ReplicationEventsImpl implements ReplicationEvents { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationEventsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationEventsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationEventsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationEventsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Gets the list of Azure Site Recovery events for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationEventsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * The operation to get the details of an Azure Site recovery event. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param eventName The name of the Azure Site Recovery event. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, eventName: string, options?: ReplicationEventsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { eventName, options }, + { resourceName, resourceGroupName, eventName, options }, getOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationEventsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -167,7 +221,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.EventCollection } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationFabrics.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationFabrics.ts index 71fd3482115c..0b4bc569d0a5 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationFabrics.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationFabrics.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationFabrics } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -53,12 +54,17 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { /** * Gets a list of the Azure Site Recovery fabrics in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationFabricsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -66,65 +72,113 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationFabricsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationFabricsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationFabricsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationFabricsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Gets a list of the Azure Site Recovery fabrics in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationFabricsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * Gets the details of an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, getOperationSpec ); } /** * The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Name of the ASR fabric. * @param input Fabric creation input. * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, input: FabricCreationInput, options?: ReplicationFabricsCreateOptionalParams @@ -175,36 +229,54 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { const lro = new LroImpl( sendOperation, - { fabricName, input, options }, + { resourceName, resourceGroupName, fabricName, input, options }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Name of the ASR fabric. * @param input Fabric creation input. * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, input: FabricCreationInput, options?: ReplicationFabricsCreateOptionalParams ): Promise { - const poller = await this.beginCreate(fabricName, input, options); + const poller = await this.beginCreate( + resourceName, + resourceGroupName, + fabricName, + input, + options + ); return poller.pollUntilDone(); } /** * The operation to purge(force delete) an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to purge. * @param options The options parameters. */ async beginPurge( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsPurgeOptionalParams ): Promise, void>> { @@ -249,34 +321,51 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { const lro = new LroImpl( sendOperation, - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, purgeOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to purge(force delete) an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to purge. * @param options The options parameters. */ async beginPurgeAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsPurgeOptionalParams ): Promise { - const poller = await this.beginPurge(fabricName, options); + const poller = await this.beginPurge( + resourceName, + resourceGroupName, + fabricName, + options + ); return poller.pollUntilDone(); } /** * The operation to perform a consistency check on the fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ async beginCheckConsistency( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsCheckConsistencyOptionalParams ): Promise< @@ -326,34 +415,51 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { const lro = new LroImpl( sendOperation, - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, checkConsistencyOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to perform a consistency check on the fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ async beginCheckConsistencyAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsCheckConsistencyOptionalParams ): Promise { - const poller = await this.beginCheckConsistency(fabricName, options); + const poller = await this.beginCheckConsistency( + resourceName, + resourceGroupName, + fabricName, + options + ); return poller.pollUntilDone(); } /** * The operation to migrate an Azure Site Recovery fabric to AAD. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to migrate. * @param options The options parameters. */ async beginMigrateToAad( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsMigrateToAadOptionalParams ): Promise, void>> { @@ -398,35 +504,52 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { const lro = new LroImpl( sendOperation, - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, migrateToAadOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to migrate an Azure Site Recovery fabric to AAD. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to migrate. * @param options The options parameters. */ async beginMigrateToAadAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsMigrateToAadOptionalParams ): Promise { - const poller = await this.beginMigrateToAad(fabricName, options); + const poller = await this.beginMigrateToAad( + resourceName, + resourceGroupName, + fabricName, + options + ); return poller.pollUntilDone(); } /** * The operation to move replications from a process server to another process server. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric containing the process server. * @param failoverProcessServerRequest The input to the failover process server operation. * @param options The options parameters. */ async beginReassociateGateway( + resourceName: string, + resourceGroupName: string, fabricName: string, failoverProcessServerRequest: FailoverProcessServerRequest, options?: ReplicationFabricsReassociateGatewayOptionalParams @@ -477,27 +600,42 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { const lro = new LroImpl( sendOperation, - { fabricName, failoverProcessServerRequest, options }, + { + resourceName, + resourceGroupName, + fabricName, + failoverProcessServerRequest, + options + }, reassociateGatewayOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to move replications from a process server to another process server. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric containing the process server. * @param failoverProcessServerRequest The input to the failover process server operation. * @param options The options parameters. */ async beginReassociateGatewayAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, failoverProcessServerRequest: FailoverProcessServerRequest, options?: ReplicationFabricsReassociateGatewayOptionalParams ): Promise { const poller = await this.beginReassociateGateway( + resourceName, + resourceGroupName, fabricName, failoverProcessServerRequest, options @@ -507,10 +645,15 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { /** * The operation to delete or remove an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to delete. * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsDeleteOptionalParams ): Promise, void>> { @@ -555,35 +698,52 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { const lro = new LroImpl( sendOperation, - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to delete or remove an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to delete. * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsDeleteOptionalParams ): Promise { - const poller = await this.beginDelete(fabricName, options); + const poller = await this.beginDelete( + resourceName, + resourceGroupName, + fabricName, + options + ); return poller.pollUntilDone(); } /** * Renews the connection certificate for the ASR replication fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName fabric name to renew certs for. * @param renewCertificate Renew certificate input. * @param options The options parameters. */ async beginRenewCertificate( + resourceName: string, + resourceGroupName: string, fabricName: string, renewCertificate: RenewCertificateInput, options?: ReplicationFabricsRenewCertificateOptionalParams @@ -634,27 +794,42 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { const lro = new LroImpl( sendOperation, - { fabricName, renewCertificate, options }, + { + resourceName, + resourceGroupName, + fabricName, + renewCertificate, + options + }, renewCertificateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Renews the connection certificate for the ASR replication fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName fabric name to renew certs for. * @param renewCertificate Renew certificate input. * @param options The options parameters. */ async beginRenewCertificateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, renewCertificate: RenewCertificateInput, options?: ReplicationFabricsRenewCertificateOptionalParams ): Promise { const poller = await this.beginRenewCertificate( + resourceName, + resourceGroupName, fabricName, renewCertificate, options @@ -664,15 +839,20 @@ export class ReplicationFabricsImpl implements ReplicationFabrics { /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationFabricsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -894,7 +1074,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.FabricCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationJobs.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationJobs.ts index 03dfd0576800..880ba8b32a89 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationJobs.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationJobs.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationJobs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -49,12 +50,17 @@ export class ReplicationJobsImpl implements ReplicationJobs { /** * Gets the list of Azure Site Recovery Jobs for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationJobsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -62,64 +68,112 @@ export class ReplicationJobsImpl implements ReplicationJobs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationJobsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationJobsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationJobsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationJobsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Gets the list of Azure Site Recovery Jobs for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationJobsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * Get the details of an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { jobName, options }, + { resourceName, resourceGroupName, jobName, options }, getOperationSpec ); } /** * The operation to cancel an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ async beginCancel( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsCancelOptionalParams ): Promise< @@ -169,34 +223,51 @@ export class ReplicationJobsImpl implements ReplicationJobs { const lro = new LroImpl( sendOperation, - { jobName, options }, + { resourceName, resourceGroupName, jobName, options }, cancelOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to cancel an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ async beginCancelAndWait( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsCancelOptionalParams ): Promise { - const poller = await this.beginCancel(jobName, options); + const poller = await this.beginCancel( + resourceName, + resourceGroupName, + jobName, + options + ); return poller.pollUntilDone(); } /** * The operation to restart an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ async beginRestart( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsRestartOptionalParams ): Promise< @@ -246,35 +317,52 @@ export class ReplicationJobsImpl implements ReplicationJobs { const lro = new LroImpl( sendOperation, - { jobName, options }, + { resourceName, resourceGroupName, jobName, options }, restartOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to restart an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ async beginRestartAndWait( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsRestartOptionalParams ): Promise { - const poller = await this.beginRestart(jobName, options); + const poller = await this.beginRestart( + resourceName, + resourceGroupName, + jobName, + options + ); return poller.pollUntilDone(); } /** * The operation to resume an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param resumeJobParams Resume rob comments. * @param options The options parameters. */ async beginResume( + resourceName: string, + resourceGroupName: string, jobName: string, resumeJobParams: ResumeJobParams, options?: ReplicationJobsResumeOptionalParams @@ -325,36 +413,54 @@ export class ReplicationJobsImpl implements ReplicationJobs { const lro = new LroImpl( sendOperation, - { jobName, resumeJobParams, options }, + { resourceName, resourceGroupName, jobName, resumeJobParams, options }, resumeOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to resume an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param resumeJobParams Resume rob comments. * @param options The options parameters. */ async beginResumeAndWait( + resourceName: string, + resourceGroupName: string, jobName: string, resumeJobParams: ResumeJobParams, options?: ReplicationJobsResumeOptionalParams ): Promise { - const poller = await this.beginResume(jobName, resumeJobParams, options); + const poller = await this.beginResume( + resourceName, + resourceGroupName, + jobName, + resumeJobParams, + options + ); return poller.pollUntilDone(); } /** * The operation to export the details of the Azure Site Recovery jobs of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobQueryParameter job query filter. * @param options The options parameters. */ async beginExport( + resourceName: string, + resourceGroupName: string, jobQueryParameter: JobQueryParameter, options?: ReplicationJobsExportOptionalParams ): Promise< @@ -404,39 +510,56 @@ export class ReplicationJobsImpl implements ReplicationJobs { const lro = new LroImpl( sendOperation, - { jobQueryParameter, options }, + { resourceName, resourceGroupName, jobQueryParameter, options }, exportOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to export the details of the Azure Site Recovery jobs of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobQueryParameter job query filter. * @param options The options parameters. */ async beginExportAndWait( + resourceName: string, + resourceGroupName: string, jobQueryParameter: JobQueryParameter, options?: ReplicationJobsExportOptionalParams ): Promise { - const poller = await this.beginExport(jobQueryParameter, options); + const poller = await this.beginExport( + resourceName, + resourceGroupName, + jobQueryParameter, + options + ); return poller.pollUntilDone(); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationJobsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -610,7 +733,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.JobCollection } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationLogicalNetworks.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationLogicalNetworks.ts index 511da1e09ae2..f798f6859870 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationLogicalNetworks.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationLogicalNetworks.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationLogicalNetworks } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -38,14 +39,24 @@ export class ReplicationLogicalNetworksImpl /** * Lists all the logical networks of the Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Server Id. * @param options The options parameters. */ public listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationLogicalNetworksListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listByReplicationFabricsPagingAll(fabricName, options); + const iter = this.listByReplicationFabricsPagingAll( + resourceName, + resourceGroupName, + fabricName, + options + ); return { next() { return iter.next(); @@ -53,35 +64,66 @@ export class ReplicationLogicalNetworksImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByReplicationFabricsPagingPage(fabricName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, + fabricName, + options, + settings + ); } }; } private async *listByReplicationFabricsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, - options?: ReplicationLogicalNetworksListByReplicationFabricsOptionalParams + options?: ReplicationLogicalNetworksListByReplicationFabricsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationFabrics(fabricName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationLogicalNetworksListByReplicationFabricsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationFabricsNext( + resourceName, + resourceGroupName, fabricName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationFabricsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationLogicalNetworksListByReplicationFabricsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, fabricName, options )) { @@ -91,50 +133,71 @@ export class ReplicationLogicalNetworksImpl /** * Lists all the logical networks of the Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Server Id. * @param options The options parameters. */ private _listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationLogicalNetworksListByReplicationFabricsOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, listByReplicationFabricsOperationSpec ); } /** * Gets the details of a logical network. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Server Id. * @param logicalNetworkName Logical network name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, logicalNetworkName: string, options?: ReplicationLogicalNetworksGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, logicalNetworkName, options }, + { + resourceName, + resourceGroupName, + fabricName, + logicalNetworkName, + options + }, getOperationSpec ); } /** * ListByReplicationFabricsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Server Id. * @param nextLink The nextLink from the previous successful call to the ListByReplicationFabrics * method. * @param options The options parameters. */ private _listByReplicationFabricsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, nextLink: string, options?: ReplicationLogicalNetworksListByReplicationFabricsNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, nextLink, options }, + { resourceName, resourceGroupName, fabricName, nextLink, options }, listByReplicationFabricsNextOperationSpec ); } @@ -191,7 +254,6 @@ const listByReplicationFabricsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.LogicalNetworkCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationMigrationItems.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationMigrationItems.ts index a7da8dce794d..d0d9d6d44f67 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationMigrationItems.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationMigrationItems.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationMigrationItems } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { MigrationItem, ReplicationMigrationItemsListByReplicationProtectionContainersNextOptionalParams, ReplicationMigrationItemsListByReplicationProtectionContainersOptionalParams, + ReplicationMigrationItemsListByReplicationProtectionContainersResponse, ReplicationMigrationItemsListNextOptionalParams, ReplicationMigrationItemsListOptionalParams, - ReplicationMigrationItemsListByReplicationProtectionContainersResponse, + ReplicationMigrationItemsListResponse, ReplicationMigrationItemsGetOptionalParams, ReplicationMigrationItemsGetResponse, EnableMigrationInput, @@ -33,6 +35,12 @@ import { MigrateInput, ReplicationMigrationItemsMigrateOptionalParams, ReplicationMigrationItemsMigrateResponse, + PauseReplicationInput, + ReplicationMigrationItemsPauseReplicationOptionalParams, + ReplicationMigrationItemsPauseReplicationResponse, + ResumeReplicationInput, + ReplicationMigrationItemsResumeReplicationOptionalParams, + ReplicationMigrationItemsResumeReplicationResponse, ResyncInput, ReplicationMigrationItemsResyncOptionalParams, ReplicationMigrationItemsResyncResponse, @@ -42,7 +50,6 @@ import { TestMigrateCleanupInput, ReplicationMigrationItemsTestMigrateCleanupOptionalParams, ReplicationMigrationItemsTestMigrateCleanupResponse, - ReplicationMigrationItemsListResponse, ReplicationMigrationItemsListByReplicationProtectionContainersNextResponse, ReplicationMigrationItemsListNextResponse } from "../models"; @@ -63,16 +70,23 @@ export class ReplicationMigrationItemsImpl /** * Gets the list of ASR migration items in the protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ public listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationMigrationItemsListByReplicationProtectionContainersOptionalParams ): PagedAsyncIterableIterator { const iter = this.listByReplicationProtectionContainersPagingAll( + resourceName, + resourceGroupName, fabricName, protectionContainerName, options @@ -84,46 +98,71 @@ export class ReplicationMigrationItemsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByReplicationProtectionContainersPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, - options + options, + settings ); } }; } private async *listByReplicationProtectionContainersPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, - options?: ReplicationMigrationItemsListByReplicationProtectionContainersOptionalParams + options?: ReplicationMigrationItemsListByReplicationProtectionContainersOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationProtectionContainers( - fabricName, - protectionContainerName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationMigrationItemsListByReplicationProtectionContainersResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationProtectionContainersNext( + resourceName, + resourceGroupName, fabricName, protectionContainerName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationProtectionContainersPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationMigrationItemsListByReplicationProtectionContainersOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationProtectionContainersPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, options @@ -134,12 +173,17 @@ export class ReplicationMigrationItemsImpl /** * Gets the list of migration items in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationMigrationItemsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -147,40 +191,75 @@ export class ReplicationMigrationItemsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationMigrationItemsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationMigrationItemsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationMigrationItemsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationMigrationItemsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Gets the list of ASR migration items in the protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ private _listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationMigrationItemsListByReplicationProtectionContainersOptionalParams @@ -188,32 +267,53 @@ export class ReplicationMigrationItemsImpl ReplicationMigrationItemsListByReplicationProtectionContainersResponse > { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + }, listByReplicationProtectionContainersOperationSpec ); } /** * Gets the details of a migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, options?: ReplicationMigrationItemsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, migrationItemName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + options + }, getOperationSpec ); } /** * The operation to create an ASR migration item (enable migration). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -221,6 +321,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -274,6 +376,8 @@ export class ReplicationMigrationItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -282,14 +386,19 @@ export class ReplicationMigrationItemsImpl }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to create an ASR migration item (enable migration). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -297,6 +406,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -304,6 +415,8 @@ export class ReplicationMigrationItemsImpl options?: ReplicationMigrationItemsCreateOptionalParams ): Promise { const poller = await this.beginCreate( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -315,12 +428,17 @@ export class ReplicationMigrationItemsImpl /** * The operation to delete an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -367,29 +485,45 @@ export class ReplicationMigrationItemsImpl const lro = new LroImpl( sendOperation, - { fabricName, protectionContainerName, migrationItemName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + options + }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to delete an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, options?: ReplicationMigrationItemsDeleteOptionalParams ): Promise { const poller = await this.beginDelete( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -400,6 +534,9 @@ export class ReplicationMigrationItemsImpl /** * The operation to update the recovery settings of an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -407,6 +544,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -460,6 +599,8 @@ export class ReplicationMigrationItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -468,14 +609,19 @@ export class ReplicationMigrationItemsImpl }, updateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to update the recovery settings of an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -483,6 +629,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -490,6 +638,8 @@ export class ReplicationMigrationItemsImpl options?: ReplicationMigrationItemsUpdateOptionalParams ): Promise { const poller = await this.beginUpdate( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -501,6 +651,9 @@ export class ReplicationMigrationItemsImpl /** * The operation to initiate migration of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -508,6 +661,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginMigrate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -561,6 +716,8 @@ export class ReplicationMigrationItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -569,14 +726,19 @@ export class ReplicationMigrationItemsImpl }, migrateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to initiate migration of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -584,6 +746,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginMigrateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -591,6 +755,8 @@ export class ReplicationMigrationItemsImpl options?: ReplicationMigrationItemsMigrateOptionalParams ): Promise { const poller = await this.beginMigrate( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -600,8 +766,245 @@ export class ReplicationMigrationItemsImpl return poller.pollUntilDone(); } + /** + * The operation to initiate pause replication of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @param options The options parameters. + */ + async beginPauseReplication( + resourceName: string, + resourceGroupName: string, + fabricName: string, + protectionContainerName: string, + migrationItemName: string, + pauseReplicationInput: PauseReplicationInput, + options?: ReplicationMigrationItemsPauseReplicationOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ReplicationMigrationItemsPauseReplicationResponse + > + > { + 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, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + options + }, + pauseReplicationOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * The operation to initiate pause replication of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @param options The options parameters. + */ + async beginPauseReplicationAndWait( + resourceName: string, + resourceGroupName: string, + fabricName: string, + protectionContainerName: string, + migrationItemName: string, + pauseReplicationInput: PauseReplicationInput, + options?: ReplicationMigrationItemsPauseReplicationOptionalParams + ): Promise { + const poller = await this.beginPauseReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + pauseReplicationInput, + options + ); + return poller.pollUntilDone(); + } + + /** + * The operation to initiate resume replication of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @param options The options parameters. + */ + async beginResumeReplication( + resourceName: string, + resourceGroupName: string, + fabricName: string, + protectionContainerName: string, + migrationItemName: string, + resumeReplicationInput: ResumeReplicationInput, + options?: ReplicationMigrationItemsResumeReplicationOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ReplicationMigrationItemsResumeReplicationResponse + > + > { + 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, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + options + }, + resumeReplicationOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * The operation to initiate resume replication of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @param options The options parameters. + */ + async beginResumeReplicationAndWait( + resourceName: string, + resourceGroupName: string, + fabricName: string, + protectionContainerName: string, + migrationItemName: string, + resumeReplicationInput: ResumeReplicationInput, + options?: ReplicationMigrationItemsResumeReplicationOptionalParams + ): Promise { + const poller = await this.beginResumeReplication( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + migrationItemName, + resumeReplicationInput, + options + ); + return poller.pollUntilDone(); + } + /** * The operation to resynchronize replication of an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -609,6 +1012,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginResync( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -662,6 +1067,8 @@ export class ReplicationMigrationItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -670,14 +1077,19 @@ export class ReplicationMigrationItemsImpl }, resyncOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to resynchronize replication of an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -685,6 +1097,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginResyncAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -692,6 +1106,8 @@ export class ReplicationMigrationItemsImpl options?: ReplicationMigrationItemsResyncOptionalParams ): Promise { const poller = await this.beginResync( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -703,6 +1119,9 @@ export class ReplicationMigrationItemsImpl /** * The operation to initiate test migration of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -710,6 +1129,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginTestMigrate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -763,6 +1184,8 @@ export class ReplicationMigrationItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -771,14 +1194,19 @@ export class ReplicationMigrationItemsImpl }, testMigrateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to initiate test migration of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -786,6 +1214,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginTestMigrateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -793,6 +1223,8 @@ export class ReplicationMigrationItemsImpl options?: ReplicationMigrationItemsTestMigrateOptionalParams ): Promise { const poller = await this.beginTestMigrate( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -804,6 +1236,9 @@ export class ReplicationMigrationItemsImpl /** * The operation to initiate test migrate cleanup. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -811,6 +1246,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginTestMigrateCleanup( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -864,6 +1301,8 @@ export class ReplicationMigrationItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -872,14 +1311,19 @@ export class ReplicationMigrationItemsImpl }, testMigrateCleanupOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to initiate test migrate cleanup. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -887,6 +1331,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ async beginTestMigrateCleanupAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -894,6 +1340,8 @@ export class ReplicationMigrationItemsImpl options?: ReplicationMigrationItemsTestMigrateCleanupOptionalParams ): Promise { const poller = await this.beginTestMigrateCleanup( + resourceName, + resourceGroupName, fabricName, protectionContainerName, migrationItemName, @@ -905,16 +1353,27 @@ export class ReplicationMigrationItemsImpl /** * Gets the list of migration items in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationMigrationItemsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationProtectionContainersNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param nextLink The nextLink from the previous successful call to the @@ -922,6 +1381,8 @@ export class ReplicationMigrationItemsImpl * @param options The options parameters. */ private _listByReplicationProtectionContainersNext( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, nextLink: string, @@ -930,22 +1391,34 @@ export class ReplicationMigrationItemsImpl ReplicationMigrationItemsListByReplicationProtectionContainersNextResponse > { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, nextLink, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + nextLink, + options + }, listByReplicationProtectionContainersNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationMigrationItemsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -1117,6 +1590,72 @@ const migrateOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; +const pauseReplicationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/pauseReplication", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MigrationItem + }, + 201: { + bodyMapper: Mappers.MigrationItem + }, + 202: { + bodyMapper: Mappers.MigrationItem + }, + 204: { + bodyMapper: Mappers.MigrationItem + } + }, + requestBody: Parameters.pauseReplicationInput, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.fabricName, + Parameters.protectionContainerName, + Parameters.migrationItemName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const resumeReplicationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resumeReplication", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MigrationItem + }, + 201: { + bodyMapper: Mappers.MigrationItem + }, + 202: { + bodyMapper: Mappers.MigrationItem + }, + 204: { + bodyMapper: Mappers.MigrationItem + } + }, + requestBody: Parameters.resumeReplicationInput, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.resourceName, + Parameters.fabricName, + Parameters.protectionContainerName, + Parameters.migrationItemName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const resyncOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync", @@ -1248,12 +1787,6 @@ const listByReplicationProtectionContainersNextOperationSpec: coreClient.Operati bodyMapper: Mappers.MigrationItemCollection } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.skipToken, - Parameters.takeToken - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -1274,12 +1807,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.MigrationItemCollection } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.skipToken, - Parameters.takeToken - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationNetworkMappings.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationNetworkMappings.ts index 284949057fe1..3360fdedcaaf 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationNetworkMappings.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationNetworkMappings.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationNetworkMappings } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { NetworkMapping, ReplicationNetworkMappingsListByReplicationNetworksNextOptionalParams, ReplicationNetworkMappingsListByReplicationNetworksOptionalParams, + ReplicationNetworkMappingsListByReplicationNetworksResponse, ReplicationNetworkMappingsListNextOptionalParams, ReplicationNetworkMappingsListOptionalParams, - ReplicationNetworkMappingsListByReplicationNetworksResponse, + ReplicationNetworkMappingsListResponse, ReplicationNetworkMappingsGetOptionalParams, ReplicationNetworkMappingsGetResponse, CreateNetworkMappingInput, @@ -30,7 +32,6 @@ import { UpdateNetworkMappingInput, ReplicationNetworkMappingsUpdateOptionalParams, ReplicationNetworkMappingsUpdateResponse, - ReplicationNetworkMappingsListResponse, ReplicationNetworkMappingsListByReplicationNetworksNextResponse, ReplicationNetworkMappingsListNextResponse } from "../models"; @@ -51,16 +52,23 @@ export class ReplicationNetworkMappingsImpl /** * Lists all ASR network mappings for the specified network. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param options The options parameters. */ public listByReplicationNetworks( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, options?: ReplicationNetworkMappingsListByReplicationNetworksOptionalParams ): PagedAsyncIterableIterator { const iter = this.listByReplicationNetworksPagingAll( + resourceName, + resourceGroupName, fabricName, networkName, options @@ -72,46 +80,71 @@ export class ReplicationNetworkMappingsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByReplicationNetworksPagingPage( + resourceName, + resourceGroupName, fabricName, networkName, - options + options, + settings ); } }; } private async *listByReplicationNetworksPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, - options?: ReplicationNetworkMappingsListByReplicationNetworksOptionalParams + options?: ReplicationNetworkMappingsListByReplicationNetworksOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationNetworks( - fabricName, - networkName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationNetworkMappingsListByReplicationNetworksResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationNetworks( + resourceName, + resourceGroupName, + fabricName, + networkName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationNetworksNext( + resourceName, + resourceGroupName, fabricName, networkName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationNetworksPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, options?: ReplicationNetworkMappingsListByReplicationNetworksOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationNetworksPagingPage( + resourceName, + resourceGroupName, fabricName, networkName, options @@ -122,12 +155,17 @@ export class ReplicationNetworkMappingsImpl /** * Lists all ASR network mappings in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationNetworkMappingsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -135,71 +173,121 @@ export class ReplicationNetworkMappingsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationNetworkMappingsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationNetworkMappingsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationNetworkMappingsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationNetworkMappingsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists all ASR network mappings for the specified network. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param options The options parameters. */ private _listByReplicationNetworks( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, options?: ReplicationNetworkMappingsListByReplicationNetworksOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, networkName, options }, + { resourceName, resourceGroupName, fabricName, networkName, options }, listByReplicationNetworksOperationSpec ); } /** * Gets the details of an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, options?: ReplicationNetworkMappingsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, networkName, networkMappingName, options }, + { + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + options + }, getOperationSpec ); } /** * The operation to create an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. @@ -207,6 +295,8 @@ export class ReplicationNetworkMappingsImpl * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -259,17 +349,30 @@ export class ReplicationNetworkMappingsImpl const lro = new LroImpl( sendOperation, - { fabricName, networkName, networkMappingName, input, options }, + { + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + input, + options + }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to create an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. @@ -277,6 +380,8 @@ export class ReplicationNetworkMappingsImpl * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -284,6 +389,8 @@ export class ReplicationNetworkMappingsImpl options?: ReplicationNetworkMappingsCreateOptionalParams ): Promise { const poller = await this.beginCreate( + resourceName, + resourceGroupName, fabricName, networkName, networkMappingName, @@ -295,12 +402,17 @@ export class ReplicationNetworkMappingsImpl /** * The operation to delete a network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName ARM Resource Name for network mapping. * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -347,29 +459,45 @@ export class ReplicationNetworkMappingsImpl const lro = new LroImpl( sendOperation, - { fabricName, networkName, networkMappingName, options }, + { + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + options + }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to delete a network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName ARM Resource Name for network mapping. * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, options?: ReplicationNetworkMappingsDeleteOptionalParams ): Promise { const poller = await this.beginDelete( + resourceName, + resourceGroupName, fabricName, networkName, networkMappingName, @@ -380,6 +508,9 @@ export class ReplicationNetworkMappingsImpl /** * The operation to update an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. @@ -387,6 +518,8 @@ export class ReplicationNetworkMappingsImpl * @param options The options parameters. */ async beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -439,17 +572,30 @@ export class ReplicationNetworkMappingsImpl const lro = new LroImpl( sendOperation, - { fabricName, networkName, networkMappingName, input, options }, + { + resourceName, + resourceGroupName, + fabricName, + networkName, + networkMappingName, + input, + options + }, updateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to update an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. @@ -457,6 +603,8 @@ export class ReplicationNetworkMappingsImpl * @param options The options parameters. */ async beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -464,6 +612,8 @@ export class ReplicationNetworkMappingsImpl options?: ReplicationNetworkMappingsUpdateOptionalParams ): Promise { const poller = await this.beginUpdate( + resourceName, + resourceGroupName, fabricName, networkName, networkMappingName, @@ -475,16 +625,27 @@ export class ReplicationNetworkMappingsImpl /** * Lists all ASR network mappings in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationNetworkMappingsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationNetworksNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param nextLink The nextLink from the previous successful call to the ListByReplicationNetworks @@ -492,28 +653,42 @@ export class ReplicationNetworkMappingsImpl * @param options The options parameters. */ private _listByReplicationNetworksNext( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, nextLink: string, options?: ReplicationNetworkMappingsListByReplicationNetworksNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, networkName, nextLink, options }, + { + resourceName, + resourceGroupName, + fabricName, + networkName, + nextLink, + options + }, listByReplicationNetworksNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationNetworkMappingsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -674,7 +849,6 @@ const listByReplicationNetworksNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.NetworkMappingCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -695,7 +869,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.NetworkMappingCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationNetworks.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationNetworks.ts index a7f48eb23975..f9b1fd2bc78e 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationNetworks.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationNetworks.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationNetworks } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,12 +17,12 @@ import { Network, ReplicationNetworksListByReplicationFabricsNextOptionalParams, ReplicationNetworksListByReplicationFabricsOptionalParams, + ReplicationNetworksListByReplicationFabricsResponse, ReplicationNetworksListNextOptionalParams, ReplicationNetworksListOptionalParams, - ReplicationNetworksListByReplicationFabricsResponse, + ReplicationNetworksListResponse, ReplicationNetworksGetOptionalParams, ReplicationNetworksGetResponse, - ReplicationNetworksListResponse, ReplicationNetworksListByReplicationFabricsNextResponse, ReplicationNetworksListNextResponse } from "../models"; @@ -41,14 +42,24 @@ export class ReplicationNetworksImpl implements ReplicationNetworks { /** * Lists the networks available for a fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ public listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationNetworksListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listByReplicationFabricsPagingAll(fabricName, options); + const iter = this.listByReplicationFabricsPagingAll( + resourceName, + resourceGroupName, + fabricName, + options + ); return { next() { return iter.next(); @@ -56,35 +67,66 @@ export class ReplicationNetworksImpl implements ReplicationNetworks { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByReplicationFabricsPagingPage(fabricName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, + fabricName, + options, + settings + ); } }; } private async *listByReplicationFabricsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, - options?: ReplicationNetworksListByReplicationFabricsOptionalParams + options?: ReplicationNetworksListByReplicationFabricsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationFabrics(fabricName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationNetworksListByReplicationFabricsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationFabricsNext( + resourceName, + resourceGroupName, fabricName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationFabricsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationNetworksListByReplicationFabricsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, fabricName, options )) { @@ -94,12 +136,17 @@ export class ReplicationNetworksImpl implements ReplicationNetworks { /** * Lists the networks available in a vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationNetworksListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -107,104 +154,162 @@ export class ReplicationNetworksImpl implements ReplicationNetworks { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationNetworksListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationNetworksListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationNetworksListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationNetworksListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists the networks available for a fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ private _listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationNetworksListByReplicationFabricsOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, listByReplicationFabricsOperationSpec ); } /** * Gets the details of a network. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Server Id. * @param networkName Primary network name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, options?: ReplicationNetworksGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, networkName, options }, + { resourceName, resourceGroupName, fabricName, networkName, options }, getOperationSpec ); } /** * Lists the networks available in a vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationNetworksListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationFabricsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param nextLink The nextLink from the previous successful call to the ListByReplicationFabrics * method. * @param options The options parameters. */ private _listByReplicationFabricsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, nextLink: string, options?: ReplicationNetworksListByReplicationFabricsNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, nextLink, options }, + { resourceName, resourceGroupName, fabricName, nextLink, options }, listByReplicationFabricsNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationNetworksListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -280,7 +385,6 @@ const listByReplicationFabricsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.NetworkCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -300,7 +404,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.NetworkCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationPolicies.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationPolicies.ts index 55f28417fcf8..b873c50bec48 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationPolicies.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationPolicies.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationPolicies } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -46,12 +47,17 @@ export class ReplicationPoliciesImpl implements ReplicationPolicies { /** * Lists the replication policies for a vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationPoliciesListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -59,65 +65,113 @@ export class ReplicationPoliciesImpl implements ReplicationPolicies { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationPoliciesListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationPoliciesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationPoliciesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationPoliciesListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists the replication policies for a vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationPoliciesListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * Gets the details of a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, policyName: string, options?: ReplicationPoliciesGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { policyName, options }, + { resourceName, resourceGroupName, policyName, options }, getOperationSpec ); } /** * The operation to create a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param input Create policy input. * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, policyName: string, input: CreatePolicyInput, options?: ReplicationPoliciesCreateOptionalParams @@ -168,36 +222,54 @@ export class ReplicationPoliciesImpl implements ReplicationPolicies { const lro = new LroImpl( sendOperation, - { policyName, input, options }, + { resourceName, resourceGroupName, policyName, input, options }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to create a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param input Create policy input. * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, policyName: string, input: CreatePolicyInput, options?: ReplicationPoliciesCreateOptionalParams ): Promise { - const poller = await this.beginCreate(policyName, input, options); + const poller = await this.beginCreate( + resourceName, + resourceGroupName, + policyName, + input, + options + ); return poller.pollUntilDone(); } /** * The operation to delete a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, policyName: string, options?: ReplicationPoliciesDeleteOptionalParams ): Promise, void>> { @@ -242,35 +314,52 @@ export class ReplicationPoliciesImpl implements ReplicationPolicies { const lro = new LroImpl( sendOperation, - { policyName, options }, + { resourceName, resourceGroupName, policyName, options }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to delete a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, policyName: string, options?: ReplicationPoliciesDeleteOptionalParams ): Promise { - const poller = await this.beginDelete(policyName, options); + const poller = await this.beginDelete( + resourceName, + resourceGroupName, + policyName, + options + ); return poller.pollUntilDone(); } /** * The operation to update a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Policy Id. * @param input Update Policy Input. * @param options The options parameters. */ async beginUpdate( + resourceName: string, + resourceGroupName: string, policyName: string, input: UpdatePolicyInput, options?: ReplicationPoliciesUpdateOptionalParams @@ -321,41 +410,59 @@ export class ReplicationPoliciesImpl implements ReplicationPolicies { const lro = new LroImpl( sendOperation, - { policyName, input, options }, + { resourceName, resourceGroupName, policyName, input, options }, updateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to update a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Policy Id. * @param input Update Policy Input. * @param options The options parameters. */ async beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, policyName: string, input: UpdatePolicyInput, options?: ReplicationPoliciesUpdateOptionalParams ): Promise { - const poller = await this.beginUpdate(policyName, input, options); + const poller = await this.beginUpdate( + resourceName, + resourceGroupName, + policyName, + input, + options + ); return poller.pollUntilDone(); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationPoliciesListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -487,7 +594,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.PolicyCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectableItems.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectableItems.ts index 6fe558b01bb6..297238bec874 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectableItems.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectableItems.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationProtectableItems } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -38,16 +39,23 @@ export class ReplicationProtectableItemsImpl /** * Lists the protectable items in a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ public listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectableItemsListByReplicationProtectionContainersOptionalParams ): PagedAsyncIterableIterator { const iter = this.listByReplicationProtectionContainersPagingAll( + resourceName, + resourceGroupName, fabricName, protectionContainerName, options @@ -59,46 +67,71 @@ export class ReplicationProtectableItemsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByReplicationProtectionContainersPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, - options + options, + settings ); } }; } private async *listByReplicationProtectionContainersPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, - options?: ReplicationProtectableItemsListByReplicationProtectionContainersOptionalParams + options?: ReplicationProtectableItemsListByReplicationProtectionContainersOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationProtectionContainers( - fabricName, - protectionContainerName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationProtectableItemsListByReplicationProtectionContainersResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationProtectionContainersNext( + resourceName, + resourceGroupName, fabricName, protectionContainerName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationProtectionContainersPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectableItemsListByReplicationProtectionContainersOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationProtectionContainersPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, options @@ -109,11 +142,16 @@ export class ReplicationProtectableItemsImpl /** * Lists the protectable items in a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ private _listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectableItemsListByReplicationProtectionContainersOptionalParams @@ -121,32 +159,53 @@ export class ReplicationProtectableItemsImpl ReplicationProtectableItemsListByReplicationProtectionContainersResponse > { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + }, listByReplicationProtectionContainersOperationSpec ); } /** * The operation to get the details of a protectable item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param protectableItemName Protectable item name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, protectableItemName: string, options?: ReplicationProtectableItemsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, protectableItemName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + protectableItemName, + options + }, getOperationSpec ); } /** * ListByReplicationProtectionContainersNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param nextLink The nextLink from the previous successful call to the @@ -154,6 +213,8 @@ export class ReplicationProtectableItemsImpl * @param options The options parameters. */ private _listByReplicationProtectionContainersNext( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, nextLink: string, @@ -162,7 +223,14 @@ export class ReplicationProtectableItemsImpl ReplicationProtectableItemsListByReplicationProtectionContainersNextResponse > { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, nextLink, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + nextLink, + options + }, listByReplicationProtectionContainersNextOperationSpec ); } @@ -226,12 +294,6 @@ const listByReplicationProtectionContainersNextOperationSpec: coreClient.Operati bodyMapper: Mappers.ProtectableItemCollection } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.take, - Parameters.skipToken1 - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectedItems.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectedItems.ts index 69630843f861..d230e3590581 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectedItems.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectedItems.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationProtectedItems } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { ReplicationProtectedItem, ReplicationProtectedItemsListByReplicationProtectionContainersNextOptionalParams, ReplicationProtectedItemsListByReplicationProtectionContainersOptionalParams, + ReplicationProtectedItemsListByReplicationProtectionContainersResponse, ReplicationProtectedItemsListNextOptionalParams, ReplicationProtectedItemsListOptionalParams, - ReplicationProtectedItemsListByReplicationProtectionContainersResponse, + ReplicationProtectedItemsListResponse, ReplicationProtectedItemsGetOptionalParams, ReplicationProtectedItemsGetResponse, EnableProtectionInput, @@ -74,7 +76,6 @@ import { UpdateMobilityServiceRequest, ReplicationProtectedItemsUpdateMobilityServiceOptionalParams, ReplicationProtectedItemsUpdateMobilityServiceResponse, - ReplicationProtectedItemsListResponse, ReplicationProtectedItemsListByReplicationProtectionContainersNextResponse, ReplicationProtectedItemsListNextResponse } from "../models"; @@ -95,16 +96,23 @@ export class ReplicationProtectedItemsImpl /** * Gets the list of ASR replication protected items in the protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ public listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectedItemsListByReplicationProtectionContainersOptionalParams ): PagedAsyncIterableIterator { const iter = this.listByReplicationProtectionContainersPagingAll( + resourceName, + resourceGroupName, fabricName, protectionContainerName, options @@ -116,46 +124,71 @@ export class ReplicationProtectedItemsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByReplicationProtectionContainersPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, - options + options, + settings ); } }; } private async *listByReplicationProtectionContainersPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, - options?: ReplicationProtectedItemsListByReplicationProtectionContainersOptionalParams + options?: ReplicationProtectedItemsListByReplicationProtectionContainersOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationProtectionContainers( - fabricName, - protectionContainerName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationProtectedItemsListByReplicationProtectionContainersResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationProtectionContainersNext( + resourceName, + resourceGroupName, fabricName, protectionContainerName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationProtectionContainersPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectedItemsListByReplicationProtectionContainersOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationProtectionContainersPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, options @@ -166,12 +199,17 @@ export class ReplicationProtectedItemsImpl /** * Gets the list of ASR replication protected items in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectedItemsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -179,40 +217,75 @@ export class ReplicationProtectedItemsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationProtectedItemsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationProtectedItemsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationProtectedItemsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectedItemsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Gets the list of ASR replication protected items in the protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ private _listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectedItemsListByReplicationProtectionContainersOptionalParams @@ -220,19 +293,30 @@ export class ReplicationProtectedItemsImpl ReplicationProtectedItemsListByReplicationProtectionContainersResponse > { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + }, listByReplicationProtectionContainersOperationSpec ); } /** * Gets the details of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -240,6 +324,8 @@ export class ReplicationProtectedItemsImpl ): Promise { return this.client.sendOperationRequest( { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -251,6 +337,9 @@ export class ReplicationProtectedItemsImpl /** * The operation to create an ASR replication protected item (Enable replication). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Name of the fabric. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName A name for the replication protected item. @@ -258,6 +347,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -311,6 +402,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -319,14 +412,19 @@ export class ReplicationProtectedItemsImpl }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to create an ASR replication protected item (Enable replication). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Name of the fabric. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName A name for the replication protected item. @@ -334,6 +432,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -341,6 +441,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsCreateOptionalParams ): Promise { const poller = await this.beginCreate( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -354,12 +456,17 @@ export class ReplicationProtectedItemsImpl * The operation to delete or purge a replication protected item. This operation will force delete the * replication protected item. Use the remove operation on replication protected item to perform a * clean disable replication for the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ async beginPurge( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -407,6 +514,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -414,28 +523,37 @@ export class ReplicationProtectedItemsImpl }, purgeOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to delete or purge a replication protected item. This operation will force delete the * replication protected item. Use the remove operation on replication protected item to perform a * clean disable replication for the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ async beginPurgeAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsPurgeOptionalParams ): Promise { const poller = await this.beginPurge( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -446,6 +564,9 @@ export class ReplicationProtectedItemsImpl /** * The operation to update the recovery settings of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -453,6 +574,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -506,6 +629,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -514,14 +639,19 @@ export class ReplicationProtectedItemsImpl }, updateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to update the recovery settings of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -529,6 +659,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -536,6 +668,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsUpdateOptionalParams ): Promise { const poller = await this.beginUpdate( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -547,6 +681,9 @@ export class ReplicationProtectedItemsImpl /** * Operation to add disks(s) to the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -554,6 +691,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginAddDisks( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -607,6 +746,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -615,14 +756,19 @@ export class ReplicationProtectedItemsImpl }, addDisksOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to add disks(s) to the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -630,6 +776,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginAddDisksAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -637,6 +785,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsAddDisksOptionalParams ): Promise { const poller = await this.beginAddDisks( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -648,6 +798,9 @@ export class ReplicationProtectedItemsImpl /** * The operation to change the recovery point of a failed over replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The ARM fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replicated protected item name. @@ -655,6 +808,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginApplyRecoveryPoint( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -708,6 +863,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -716,14 +873,19 @@ export class ReplicationProtectedItemsImpl }, applyRecoveryPointOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to change the recovery point of a failed over replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The ARM fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replicated protected item name. @@ -731,6 +893,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginApplyRecoveryPointAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -738,6 +902,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsApplyRecoveryPointOptionalParams ): Promise { const poller = await this.beginApplyRecoveryPoint( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -749,12 +915,17 @@ export class ReplicationProtectedItemsImpl /** * Operation to cancel the failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ async beginFailoverCancel( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -807,6 +978,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -814,26 +987,35 @@ export class ReplicationProtectedItemsImpl }, failoverCancelOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to cancel the failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ async beginFailoverCancelAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCancelOptionalParams ): Promise { const poller = await this.beginFailoverCancel( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -844,12 +1026,17 @@ export class ReplicationProtectedItemsImpl /** * Operation to commit the failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ async beginFailoverCommit( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -902,6 +1089,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -909,26 +1098,35 @@ export class ReplicationProtectedItemsImpl }, failoverCommitOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to commit the failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ async beginFailoverCommitAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsFailoverCommitOptionalParams ): Promise { const poller = await this.beginFailoverCommit( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -939,6 +1137,9 @@ export class ReplicationProtectedItemsImpl /** * Operation to initiate a planned failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -946,6 +1147,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginPlannedFailover( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -999,6 +1202,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1007,14 +1212,19 @@ export class ReplicationProtectedItemsImpl }, plannedFailoverOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to initiate a planned failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1022,6 +1232,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginPlannedFailoverAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1029,6 +1241,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsPlannedFailoverOptionalParams ): Promise { const poller = await this.beginPlannedFailover( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1041,6 +1255,9 @@ export class ReplicationProtectedItemsImpl /** * The operation to disable replication on a replication protected item. This will also remove the * item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1048,6 +1265,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1096,6 +1315,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1104,15 +1325,20 @@ export class ReplicationProtectedItemsImpl }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to disable replication on a replication protected item. This will also remove the * item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1120,6 +1346,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1127,6 +1355,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsDeleteOptionalParams ): Promise { const poller = await this.beginDelete( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1138,6 +1368,9 @@ export class ReplicationProtectedItemsImpl /** * Operation to remove disk(s) from the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1145,6 +1378,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginRemoveDisks( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1198,6 +1433,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1206,14 +1443,19 @@ export class ReplicationProtectedItemsImpl }, removeDisksOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to remove disk(s) from the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1221,6 +1463,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginRemoveDisksAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1228,6 +1472,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsRemoveDisksOptionalParams ): Promise { const poller = await this.beginRemoveDisks( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1240,12 +1486,17 @@ export class ReplicationProtectedItemsImpl /** * The operation to start resynchronize/repair replication for a replication protected item requiring * resynchronization. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric. * @param protectionContainerName The name of the container. * @param replicatedProtectedItemName The name of the replication protected item. * @param options The options parameters. */ async beginRepairReplication( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1298,6 +1549,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1305,27 +1558,36 @@ export class ReplicationProtectedItemsImpl }, repairReplicationOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to start resynchronize/repair replication for a replication protected item requiring * resynchronization. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric. * @param protectionContainerName The name of the container. * @param replicatedProtectedItemName The name of the replication protected item. * @param options The options parameters. */ async beginRepairReplicationAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: ReplicationProtectedItemsRepairReplicationOptionalParams ): Promise { const poller = await this.beginRepairReplication( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1336,6 +1598,9 @@ export class ReplicationProtectedItemsImpl /** * Operation to reprotect or reverse replicate a failed over replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1343,6 +1608,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginReprotect( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1396,6 +1663,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1404,14 +1673,19 @@ export class ReplicationProtectedItemsImpl }, reprotectOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to reprotect or reverse replicate a failed over replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1419,6 +1693,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginReprotectAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1426,6 +1702,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsReprotectOptionalParams ): Promise { const poller = await this.beginReprotect( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1437,6 +1715,9 @@ export class ReplicationProtectedItemsImpl /** * Operation to resolve health issues of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1444,6 +1725,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginResolveHealthErrors( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1497,6 +1780,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1505,14 +1790,19 @@ export class ReplicationProtectedItemsImpl }, resolveHealthErrorsOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to resolve health issues of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1520,6 +1810,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginResolveHealthErrorsAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1527,6 +1819,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsResolveHealthErrorsOptionalParams ): Promise { const poller = await this.beginResolveHealthErrors( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1538,6 +1832,9 @@ export class ReplicationProtectedItemsImpl /** * Operation to initiate a switch provider of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1545,6 +1842,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginSwitchProvider( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1598,6 +1897,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1606,15 +1907,20 @@ export class ReplicationProtectedItemsImpl }, switchProviderOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, lroResourceLocationConfig: "azure-async-operation" }); + await poller.poll(); + return poller; } /** * Operation to initiate a switch provider of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1622,6 +1928,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginSwitchProviderAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1629,6 +1937,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsSwitchProviderOptionalParams ): Promise { const poller = await this.beginSwitchProvider( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1640,6 +1950,9 @@ export class ReplicationProtectedItemsImpl /** * Operation to perform a test failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1647,6 +1960,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginTestFailover( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1700,6 +2015,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1708,14 +2025,19 @@ export class ReplicationProtectedItemsImpl }, testFailoverOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to perform a test failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1723,6 +2045,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginTestFailoverAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1730,6 +2054,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsTestFailoverOptionalParams ): Promise { const poller = await this.beginTestFailover( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1741,6 +2067,9 @@ export class ReplicationProtectedItemsImpl /** * Operation to clean up the test failover of a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1748,6 +2077,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginTestFailoverCleanup( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1801,6 +2132,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1809,14 +2142,19 @@ export class ReplicationProtectedItemsImpl }, testFailoverCleanupOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to clean up the test failover of a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1824,6 +2162,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginTestFailoverCleanupAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1831,6 +2171,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsTestFailoverCleanupOptionalParams ): Promise { const poller = await this.beginTestFailoverCleanup( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1842,6 +2184,9 @@ export class ReplicationProtectedItemsImpl /** * Operation to initiate a failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1849,6 +2194,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginUnplannedFailover( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1902,6 +2249,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1910,14 +2259,19 @@ export class ReplicationProtectedItemsImpl }, unplannedFailoverOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to initiate a failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1925,6 +2279,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginUnplannedFailoverAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -1932,6 +2288,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsUnplannedFailoverOptionalParams ): Promise { const poller = await this.beginUnplannedFailover( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -1943,6 +2301,9 @@ export class ReplicationProtectedItemsImpl /** * The operation to update appliance of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -1950,6 +2311,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginUpdateAppliance( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -2003,6 +2366,8 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -2011,14 +2376,19 @@ export class ReplicationProtectedItemsImpl }, updateApplianceOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to update appliance of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -2026,6 +2396,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ async beginUpdateApplianceAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -2033,6 +2405,8 @@ export class ReplicationProtectedItemsImpl options?: ReplicationProtectedItemsUpdateApplianceOptionalParams ): Promise { const poller = await this.beginUpdateAppliance( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -2045,17 +2419,22 @@ export class ReplicationProtectedItemsImpl /** * The operation to update(push update) the installed mobility service software on a replication * protected item to the latest available version. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric containing the protected item. * @param protectionContainerName The name of the container containing the protected item. - * @param replicationProtectedItemName The name of the protected item on which the agent is to be - * updated. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be + * updated. * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. * @param options The options parameters. */ async beginUpdateMobilityService( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, - replicationProtectedItemName: string, + replicatedProtectedItemName: string, updateMobilityServiceRequest: UpdateMobilityServiceRequest, options?: ReplicationProtectedItemsUpdateMobilityServiceOptionalParams ): Promise< @@ -2108,41 +2487,53 @@ export class ReplicationProtectedItemsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, - replicationProtectedItemName, + replicatedProtectedItemName, updateMobilityServiceRequest, options }, updateMobilityServiceOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" }); + await poller.poll(); + return poller; } /** * The operation to update(push update) the installed mobility service software on a replication * protected item to the latest available version. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric containing the protected item. * @param protectionContainerName The name of the container containing the protected item. - * @param replicationProtectedItemName The name of the protected item on which the agent is to be - * updated. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be + * updated. * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. * @param options The options parameters. */ async beginUpdateMobilityServiceAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, - replicationProtectedItemName: string, + replicatedProtectedItemName: string, updateMobilityServiceRequest: UpdateMobilityServiceRequest, options?: ReplicationProtectedItemsUpdateMobilityServiceOptionalParams ): Promise { const poller = await this.beginUpdateMobilityService( + resourceName, + resourceGroupName, fabricName, protectionContainerName, - replicationProtectedItemName, + replicatedProtectedItemName, updateMobilityServiceRequest, options ); @@ -2151,16 +2542,27 @@ export class ReplicationProtectedItemsImpl /** * Gets the list of ASR replication protected items in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectedItemsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationProtectionContainersNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param nextLink The nextLink from the previous successful call to the @@ -2168,6 +2570,8 @@ export class ReplicationProtectedItemsImpl * @param options The options parameters. */ private _listByReplicationProtectionContainersNext( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, nextLink: string, @@ -2176,22 +2580,34 @@ export class ReplicationProtectedItemsImpl ReplicationProtectedItemsListByReplicationProtectionContainersNextResponse > { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, nextLink, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + nextLink, + options + }, listByReplicationProtectionContainersNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationProtectedItemsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -2803,7 +3219,7 @@ const updateApplianceOperationSpec: coreClient.OperationSpec = { }; const updateMobilityServiceOperationSpec: coreClient.OperationSpec = { path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateMobilityService", httpMethod: "POST", responses: { 200: { @@ -2828,7 +3244,7 @@ const updateMobilityServiceOperationSpec: coreClient.OperationSpec = { Parameters.resourceName, Parameters.fabricName, Parameters.protectionContainerName, - Parameters.replicationProtectedItemName + Parameters.replicatedProtectedItemName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -2865,7 +3281,6 @@ const listByReplicationProtectionContainersNextOperationSpec: coreClient.Operati bodyMapper: Mappers.ReplicationProtectedItemCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -2886,11 +3301,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ReplicationProtectedItemCollection } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.skipToken - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionContainerMappings.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionContainerMappings.ts index 667dc832fc2e..bae366e88075 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionContainerMappings.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionContainerMappings.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationProtectionContainerMappings } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { ProtectionContainerMapping, ReplicationProtectionContainerMappingsListByReplicationProtectionContainersNextOptionalParams, ReplicationProtectionContainerMappingsListByReplicationProtectionContainersOptionalParams, + ReplicationProtectionContainerMappingsListByReplicationProtectionContainersResponse, ReplicationProtectionContainerMappingsListNextOptionalParams, ReplicationProtectionContainerMappingsListOptionalParams, - ReplicationProtectionContainerMappingsListByReplicationProtectionContainersResponse, + ReplicationProtectionContainerMappingsListResponse, ReplicationProtectionContainerMappingsGetOptionalParams, ReplicationProtectionContainerMappingsGetResponse, CreateProtectionContainerMappingInput, @@ -32,7 +34,6 @@ import { ReplicationProtectionContainerMappingsUpdateResponse, RemoveProtectionContainerMappingInput, ReplicationProtectionContainerMappingsDeleteOptionalParams, - ReplicationProtectionContainerMappingsListResponse, ReplicationProtectionContainerMappingsListByReplicationProtectionContainersNextResponse, ReplicationProtectionContainerMappingsListNextResponse } from "../models"; @@ -53,16 +54,23 @@ export class ReplicationProtectionContainerMappingsImpl /** * Lists the protection container mappings for a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ public listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainerMappingsListByReplicationProtectionContainersOptionalParams ): PagedAsyncIterableIterator { const iter = this.listByReplicationProtectionContainersPagingAll( + resourceName, + resourceGroupName, fabricName, protectionContainerName, options @@ -74,46 +82,71 @@ export class ReplicationProtectionContainerMappingsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByReplicationProtectionContainersPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, - options + options, + settings ); } }; } private async *listByReplicationProtectionContainersPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, - options?: ReplicationProtectionContainerMappingsListByReplicationProtectionContainersOptionalParams + options?: ReplicationProtectionContainerMappingsListByReplicationProtectionContainersOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationProtectionContainers( - fabricName, - protectionContainerName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationProtectionContainerMappingsListByReplicationProtectionContainersResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationProtectionContainers( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationProtectionContainersNext( + resourceName, + resourceGroupName, fabricName, protectionContainerName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationProtectionContainersPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainerMappingsListByReplicationProtectionContainersOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationProtectionContainersPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, options @@ -124,12 +157,17 @@ export class ReplicationProtectionContainerMappingsImpl /** * Lists the protection container mappings in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionContainerMappingsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -137,40 +175,75 @@ export class ReplicationProtectionContainerMappingsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationProtectionContainerMappingsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationProtectionContainerMappingsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationProtectionContainerMappingsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionContainerMappingsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists the protection container mappings for a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ private _listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainerMappingsListByReplicationProtectionContainersOptionalParams @@ -178,32 +251,53 @@ export class ReplicationProtectionContainerMappingsImpl ReplicationProtectionContainerMappingsListByReplicationProtectionContainersResponse > { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + }, listByReplicationProtectionContainersOperationSpec ); } /** * Gets the details of a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection Container mapping name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, options?: ReplicationProtectionContainerMappingsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, mappingName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + options + }, getOperationSpec ); } /** * The operation to create a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -211,6 +305,8 @@ export class ReplicationProtectionContainerMappingsImpl * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -264,6 +360,8 @@ export class ReplicationProtectionContainerMappingsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, mappingName, @@ -272,14 +370,19 @@ export class ReplicationProtectionContainerMappingsImpl }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to create a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -287,6 +390,8 @@ export class ReplicationProtectionContainerMappingsImpl * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -294,6 +399,8 @@ export class ReplicationProtectionContainerMappingsImpl options?: ReplicationProtectionContainerMappingsCreateOptionalParams ): Promise { const poller = await this.beginCreate( + resourceName, + resourceGroupName, fabricName, protectionContainerName, mappingName, @@ -305,12 +412,17 @@ export class ReplicationProtectionContainerMappingsImpl /** * The operation to purge(force delete) a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. * @param options The options parameters. */ async beginPurge( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -357,29 +469,45 @@ export class ReplicationProtectionContainerMappingsImpl const lro = new LroImpl( sendOperation, - { fabricName, protectionContainerName, mappingName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + mappingName, + options + }, purgeOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to purge(force delete) a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. * @param options The options parameters. */ async beginPurgeAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, options?: ReplicationProtectionContainerMappingsPurgeOptionalParams ): Promise { const poller = await this.beginPurge( + resourceName, + resourceGroupName, fabricName, protectionContainerName, mappingName, @@ -390,6 +518,9 @@ export class ReplicationProtectionContainerMappingsImpl /** * The operation to update protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -397,6 +528,8 @@ export class ReplicationProtectionContainerMappingsImpl * @param options The options parameters. */ async beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -450,6 +583,8 @@ export class ReplicationProtectionContainerMappingsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, mappingName, @@ -458,14 +593,19 @@ export class ReplicationProtectionContainerMappingsImpl }, updateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to update protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -473,6 +613,8 @@ export class ReplicationProtectionContainerMappingsImpl * @param options The options parameters. */ async beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -480,6 +622,8 @@ export class ReplicationProtectionContainerMappingsImpl options?: ReplicationProtectionContainerMappingsUpdateOptionalParams ): Promise { const poller = await this.beginUpdate( + resourceName, + resourceGroupName, fabricName, protectionContainerName, mappingName, @@ -491,6 +635,9 @@ export class ReplicationProtectionContainerMappingsImpl /** * The operation to delete or remove a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -498,6 +645,8 @@ export class ReplicationProtectionContainerMappingsImpl * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -546,6 +695,8 @@ export class ReplicationProtectionContainerMappingsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, mappingName, @@ -554,14 +705,19 @@ export class ReplicationProtectionContainerMappingsImpl }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to delete or remove a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -569,6 +725,8 @@ export class ReplicationProtectionContainerMappingsImpl * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -576,6 +734,8 @@ export class ReplicationProtectionContainerMappingsImpl options?: ReplicationProtectionContainerMappingsDeleteOptionalParams ): Promise { const poller = await this.beginDelete( + resourceName, + resourceGroupName, fabricName, protectionContainerName, mappingName, @@ -587,16 +747,27 @@ export class ReplicationProtectionContainerMappingsImpl /** * Lists the protection container mappings in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionContainerMappingsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationProtectionContainersNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param nextLink The nextLink from the previous successful call to the @@ -604,6 +775,8 @@ export class ReplicationProtectionContainerMappingsImpl * @param options The options parameters. */ private _listByReplicationProtectionContainersNext( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, nextLink: string, @@ -612,22 +785,34 @@ export class ReplicationProtectionContainerMappingsImpl ReplicationProtectionContainerMappingsListByReplicationProtectionContainersNextResponse > { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, nextLink, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + nextLink, + options + }, listByReplicationProtectionContainersNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationProtectionContainerMappingsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -808,7 +993,6 @@ const listByReplicationProtectionContainersNextOperationSpec: coreClient.Operati bodyMapper: Mappers.ProtectionContainerMappingCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -829,7 +1013,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ProtectionContainerMappingCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionContainers.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionContainers.ts index f9681733f6db..def9eaffd024 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionContainers.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionContainers.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationProtectionContainers } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { ProtectionContainer, ReplicationProtectionContainersListByReplicationFabricsNextOptionalParams, ReplicationProtectionContainersListByReplicationFabricsOptionalParams, + ReplicationProtectionContainersListByReplicationFabricsResponse, ReplicationProtectionContainersListNextOptionalParams, ReplicationProtectionContainersListOptionalParams, - ReplicationProtectionContainersListByReplicationFabricsResponse, + ReplicationProtectionContainersListResponse, ReplicationProtectionContainersGetOptionalParams, ReplicationProtectionContainersGetResponse, CreateProtectionContainerInput, @@ -33,7 +35,6 @@ import { SwitchProtectionInput, ReplicationProtectionContainersSwitchProtectionOptionalParams, ReplicationProtectionContainersSwitchProtectionResponse, - ReplicationProtectionContainersListResponse, ReplicationProtectionContainersListByReplicationFabricsNextResponse, ReplicationProtectionContainersListNextResponse } from "../models"; @@ -54,14 +55,24 @@ export class ReplicationProtectionContainersImpl /** * Lists the protection containers in the specified fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ public listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationProtectionContainersListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listByReplicationFabricsPagingAll(fabricName, options); + const iter = this.listByReplicationFabricsPagingAll( + resourceName, + resourceGroupName, + fabricName, + options + ); return { next() { return iter.next(); @@ -69,35 +80,66 @@ export class ReplicationProtectionContainersImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByReplicationFabricsPagingPage(fabricName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, + fabricName, + options, + settings + ); } }; } private async *listByReplicationFabricsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, - options?: ReplicationProtectionContainersListByReplicationFabricsOptionalParams + options?: ReplicationProtectionContainersListByReplicationFabricsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationFabrics(fabricName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationProtectionContainersListByReplicationFabricsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationFabricsNext( + resourceName, + resourceGroupName, fabricName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationFabricsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationProtectionContainersListByReplicationFabricsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, fabricName, options )) { @@ -107,12 +149,17 @@ export class ReplicationProtectionContainersImpl /** * Lists the protection containers in a vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionContainersListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -120,73 +167,124 @@ export class ReplicationProtectionContainersImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationProtectionContainersListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationProtectionContainersListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationProtectionContainersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionContainersListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists the protection containers in the specified fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ private _listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationProtectionContainersListByReplicationFabricsOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, listByReplicationFabricsOperationSpec ); } /** * Gets the details of a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, protectionContainerName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + }, getOperationSpec ); } /** * Operation to create a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric ARM name. * @param protectionContainerName Unique protection container ARM name. * @param creationInput Creation input. * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, creationInput: CreateProtectionContainerInput, @@ -238,29 +336,45 @@ export class ReplicationProtectionContainersImpl const lro = new LroImpl( sendOperation, - { fabricName, protectionContainerName, creationInput, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + creationInput, + options + }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to create a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric ARM name. * @param protectionContainerName Unique protection container ARM name. * @param creationInput Creation input. * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, creationInput: CreateProtectionContainerInput, options?: ReplicationProtectionContainersCreateOptionalParams ): Promise { const poller = await this.beginCreate( + resourceName, + resourceGroupName, fabricName, protectionContainerName, creationInput, @@ -271,12 +385,17 @@ export class ReplicationProtectionContainersImpl /** * The operation to a add a protectable item to a protection container(Add physical server). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric. * @param protectionContainerName The name of the protection container. * @param discoverProtectableItemRequest The request object to add a protectable item. * @param options The options parameters. */ async beginDiscoverProtectableItem( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, discoverProtectableItemRequest: DiscoverProtectableItemRequest, @@ -331,6 +450,8 @@ export class ReplicationProtectionContainersImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest, @@ -338,26 +459,35 @@ export class ReplicationProtectionContainersImpl }, discoverProtectableItemOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to a add a protectable item to a protection container(Add physical server). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric. * @param protectionContainerName The name of the protection container. * @param discoverProtectableItemRequest The request object to add a protectable item. * @param options The options parameters. */ async beginDiscoverProtectableItemAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, discoverProtectableItemRequest: DiscoverProtectableItemRequest, options?: ReplicationProtectionContainersDiscoverProtectableItemOptionalParams ): Promise { const poller = await this.beginDiscoverProtectableItem( + resourceName, + resourceGroupName, fabricName, protectionContainerName, discoverProtectableItemRequest, @@ -368,11 +498,16 @@ export class ReplicationProtectionContainersImpl /** * Operation to remove a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric ARM name. * @param protectionContainerName Unique protection container ARM name. * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersDeleteOptionalParams @@ -418,27 +553,42 @@ export class ReplicationProtectionContainersImpl const lro = new LroImpl( sendOperation, - { fabricName, protectionContainerName, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + options + }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to remove a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric ARM name. * @param protectionContainerName Unique protection container ARM name. * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersDeleteOptionalParams ): Promise { const poller = await this.beginDelete( + resourceName, + resourceGroupName, fabricName, protectionContainerName, options @@ -448,12 +598,17 @@ export class ReplicationProtectionContainersImpl /** * Operation to switch protection from one container to another or one replication provider to another. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param switchInput Switch protection input. * @param options The options parameters. */ async beginSwitchProtection( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, switchInput: SwitchProtectionInput, @@ -507,29 +662,45 @@ export class ReplicationProtectionContainersImpl const lro = new LroImpl( sendOperation, - { fabricName, protectionContainerName, switchInput, options }, + { + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + switchInput, + options + }, switchProtectionOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Operation to switch protection from one container to another or one replication provider to another. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param switchInput Switch protection input. * @param options The options parameters. */ async beginSwitchProtectionAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, switchInput: SwitchProtectionInput, options?: ReplicationProtectionContainersSwitchProtectionOptionalParams ): Promise { const poller = await this.beginSwitchProtection( + resourceName, + resourceGroupName, fabricName, protectionContainerName, switchInput, @@ -540,22 +711,35 @@ export class ReplicationProtectionContainersImpl /** * Lists the protection containers in a vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionContainersListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationFabricsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param nextLink The nextLink from the previous successful call to the ListByReplicationFabrics * method. * @param options The options parameters. */ private _listByReplicationFabricsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, nextLink: string, options?: ReplicationProtectionContainersListByReplicationFabricsNextOptionalParams @@ -563,22 +747,27 @@ export class ReplicationProtectionContainersImpl ReplicationProtectionContainersListByReplicationFabricsNextResponse > { return this.client.sendOperationRequest( - { fabricName, nextLink, options }, + { resourceName, resourceGroupName, fabricName, nextLink, options }, listByReplicationFabricsNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationProtectionContainersListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -766,7 +955,6 @@ const listByReplicationFabricsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ProtectionContainerCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -786,7 +974,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ProtectionContainerCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionIntents.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionIntents.ts index 5b473bd3e311..1b74ed666898 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionIntents.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationProtectionIntents.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationProtectionIntents } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -41,12 +42,17 @@ export class ReplicationProtectionIntentsImpl /** * Gets the list of ASR replication protection intent objects in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionIntentsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -54,86 +60,139 @@ export class ReplicationProtectionIntentsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationProtectionIntentsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationProtectionIntentsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationProtectionIntentsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionIntentsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Gets the list of ASR replication protection intent objects in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionIntentsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * Gets the details of an ASR replication protection intent. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param intentObjectName Replication protection intent name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, intentObjectName: string, options?: ReplicationProtectionIntentsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { intentObjectName, options }, + { resourceName, resourceGroupName, intentObjectName, options }, getOperationSpec ); } /** * The operation to create an ASR replication protection intent item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param intentObjectName A name for the replication protection item. * @param input Create Protection Intent Input. * @param options The options parameters. */ create( + resourceName: string, + resourceGroupName: string, intentObjectName: string, input: CreateProtectionIntentInput, options?: ReplicationProtectionIntentsCreateOptionalParams ): Promise { return this.client.sendOperationRequest( - { intentObjectName, input, options }, + { resourceName, resourceGroupName, intentObjectName, input, options }, createOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationProtectionIntentsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -214,11 +273,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ReplicationProtectionIntentCollection } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.skipToken, - Parameters.takeToken - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationRecoveryPlans.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationRecoveryPlans.ts index 701bc8866a3b..d303ca773504 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationRecoveryPlans.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationRecoveryPlans.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationRecoveryPlans } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -64,12 +65,17 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { /** * Lists the recovery plans in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationRecoveryPlansListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -77,65 +83,113 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationRecoveryPlansListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationRecoveryPlansListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationRecoveryPlansListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationRecoveryPlansListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists the recovery plans in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationRecoveryPlansListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * Gets the details of the recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Name of the recovery plan. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { recoveryPlanName, options }, + { resourceName, resourceGroupName, recoveryPlanName, options }, getOperationSpec ); } /** * The operation to create a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery Plan creation input. * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: CreateRecoveryPlanInput, options?: ReplicationRecoveryPlansCreateOptionalParams @@ -186,36 +240,54 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, input, options }, + { resourceName, resourceGroupName, recoveryPlanName, input, options }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to create a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery Plan creation input. * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: CreateRecoveryPlanInput, options?: ReplicationRecoveryPlansCreateOptionalParams ): Promise { - const poller = await this.beginCreate(recoveryPlanName, input, options); + const poller = await this.beginCreate( + resourceName, + resourceGroupName, + recoveryPlanName, + input, + options + ); return poller.pollUntilDone(); } /** * Delete a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansDeleteOptionalParams ): Promise, void>> { @@ -260,35 +332,52 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, options }, + { resourceName, resourceGroupName, recoveryPlanName, options }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Delete a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansDeleteOptionalParams ): Promise { - const poller = await this.beginDelete(recoveryPlanName, options); + const poller = await this.beginDelete( + resourceName, + resourceGroupName, + recoveryPlanName, + options + ); return poller.pollUntilDone(); } /** * The operation to update a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Update recovery plan input. * @param options The options parameters. */ async beginUpdate( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: UpdateRecoveryPlanInput, options?: ReplicationRecoveryPlansUpdateOptionalParams @@ -339,36 +428,54 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, input, options }, + { resourceName, resourceGroupName, recoveryPlanName, input, options }, updateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to update a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Update recovery plan input. * @param options The options parameters. */ async beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: UpdateRecoveryPlanInput, options?: ReplicationRecoveryPlansUpdateOptionalParams ): Promise { - const poller = await this.beginUpdate(recoveryPlanName, input, options); + const poller = await this.beginUpdate( + resourceName, + resourceGroupName, + recoveryPlanName, + input, + options + ); return poller.pollUntilDone(); } /** * The operation to cancel the failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ async beginFailoverCancel( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCancelOptionalParams ): Promise< @@ -418,34 +525,51 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, options }, + { resourceName, resourceGroupName, recoveryPlanName, options }, failoverCancelOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to cancel the failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ async beginFailoverCancelAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCancelOptionalParams ): Promise { - const poller = await this.beginFailoverCancel(recoveryPlanName, options); + const poller = await this.beginFailoverCancel( + resourceName, + resourceGroupName, + recoveryPlanName, + options + ); return poller.pollUntilDone(); } /** * The operation to commit the failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ async beginFailoverCommit( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCommitOptionalParams ): Promise< @@ -495,35 +619,52 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, options }, + { resourceName, resourceGroupName, recoveryPlanName, options }, failoverCommitOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to commit the failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ async beginFailoverCommitAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCommitOptionalParams ): Promise { - const poller = await this.beginFailoverCommit(recoveryPlanName, options); + const poller = await this.beginFailoverCommit( + resourceName, + resourceGroupName, + recoveryPlanName, + options + ); return poller.pollUntilDone(); } /** * The operation to start the planned failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Failover input. * @param options The options parameters. */ async beginPlannedFailover( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanPlannedFailoverInput, options?: ReplicationRecoveryPlansPlannedFailoverOptionalParams @@ -574,27 +715,36 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, input, options }, + { resourceName, resourceGroupName, recoveryPlanName, input, options }, plannedFailoverOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to start the planned failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Failover input. * @param options The options parameters. */ async beginPlannedFailoverAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanPlannedFailoverInput, options?: ReplicationRecoveryPlansPlannedFailoverOptionalParams ): Promise { const poller = await this.beginPlannedFailover( + resourceName, + resourceGroupName, recoveryPlanName, input, options @@ -604,10 +754,15 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { /** * The operation to reprotect(reverse replicate) a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ async beginReprotect( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansReprotectOptionalParams ): Promise< @@ -657,35 +812,52 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, options }, + { resourceName, resourceGroupName, recoveryPlanName, options }, reprotectOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to reprotect(reverse replicate) a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ async beginReprotectAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansReprotectOptionalParams ): Promise { - const poller = await this.beginReprotect(recoveryPlanName, options); + const poller = await this.beginReprotect( + resourceName, + resourceGroupName, + recoveryPlanName, + options + ); return poller.pollUntilDone(); } /** * The operation to start the test failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan test failover input. * @param options The options parameters. */ async beginTestFailover( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverInput, options?: ReplicationRecoveryPlansTestFailoverOptionalParams @@ -736,27 +908,36 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, input, options }, + { resourceName, resourceGroupName, recoveryPlanName, input, options }, testFailoverOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to start the test failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan test failover input. * @param options The options parameters. */ async beginTestFailoverAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverInput, options?: ReplicationRecoveryPlansTestFailoverOptionalParams ): Promise { const poller = await this.beginTestFailover( + resourceName, + resourceGroupName, recoveryPlanName, input, options @@ -766,11 +947,16 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { /** * The operation to cleanup test failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan test failover cleanup input. * @param options The options parameters. */ async beginTestFailoverCleanup( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverCleanupInput, options?: ReplicationRecoveryPlansTestFailoverCleanupOptionalParams @@ -821,27 +1007,36 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, input, options }, + { resourceName, resourceGroupName, recoveryPlanName, input, options }, testFailoverCleanupOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to cleanup test failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan test failover cleanup input. * @param options The options parameters. */ async beginTestFailoverCleanupAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverCleanupInput, options?: ReplicationRecoveryPlansTestFailoverCleanupOptionalParams ): Promise { const poller = await this.beginTestFailoverCleanup( + resourceName, + resourceGroupName, recoveryPlanName, input, options @@ -851,11 +1046,16 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { /** * The operation to start the unplanned failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan unplanned failover input. * @param options The options parameters. */ async beginUnplannedFailover( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanUnplannedFailoverInput, options?: ReplicationRecoveryPlansUnplannedFailoverOptionalParams @@ -906,27 +1106,36 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { const lro = new LroImpl( sendOperation, - { recoveryPlanName, input, options }, + { resourceName, resourceGroupName, recoveryPlanName, input, options }, unplannedFailoverOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to start the unplanned failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan unplanned failover input. * @param options The options parameters. */ async beginUnplannedFailoverAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanUnplannedFailoverInput, options?: ReplicationRecoveryPlansUnplannedFailoverOptionalParams ): Promise { const poller = await this.beginUnplannedFailover( + resourceName, + resourceGroupName, recoveryPlanName, input, options @@ -936,15 +1145,20 @@ export class ReplicationRecoveryPlansImpl implements ReplicationRecoveryPlans { /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationRecoveryPlansListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -1287,7 +1501,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.RecoveryPlanCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationRecoveryServicesProviders.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationRecoveryServicesProviders.ts index d0996c242520..372a380890fb 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationRecoveryServicesProviders.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationRecoveryServicesProviders.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationRecoveryServicesProviders } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { RecoveryServicesProvider, ReplicationRecoveryServicesProvidersListByReplicationFabricsNextOptionalParams, ReplicationRecoveryServicesProvidersListByReplicationFabricsOptionalParams, + ReplicationRecoveryServicesProvidersListByReplicationFabricsResponse, ReplicationRecoveryServicesProvidersListNextOptionalParams, ReplicationRecoveryServicesProvidersListOptionalParams, - ReplicationRecoveryServicesProvidersListByReplicationFabricsResponse, + ReplicationRecoveryServicesProvidersListResponse, ReplicationRecoveryServicesProvidersGetOptionalParams, ReplicationRecoveryServicesProvidersGetResponse, AddRecoveryServicesProviderInput, @@ -30,7 +32,6 @@ import { ReplicationRecoveryServicesProvidersRefreshProviderOptionalParams, ReplicationRecoveryServicesProvidersRefreshProviderResponse, ReplicationRecoveryServicesProvidersDeleteOptionalParams, - ReplicationRecoveryServicesProvidersListResponse, ReplicationRecoveryServicesProvidersListByReplicationFabricsNextResponse, ReplicationRecoveryServicesProvidersListNextResponse } from "../models"; @@ -51,14 +52,24 @@ export class ReplicationRecoveryServicesProvidersImpl /** * Lists the registered recovery services providers for the specified fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ public listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationRecoveryServicesProvidersListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listByReplicationFabricsPagingAll(fabricName, options); + const iter = this.listByReplicationFabricsPagingAll( + resourceName, + resourceGroupName, + fabricName, + options + ); return { next() { return iter.next(); @@ -66,35 +77,66 @@ export class ReplicationRecoveryServicesProvidersImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByReplicationFabricsPagingPage(fabricName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, + fabricName, + options, + settings + ); } }; } private async *listByReplicationFabricsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, - options?: ReplicationRecoveryServicesProvidersListByReplicationFabricsOptionalParams + options?: ReplicationRecoveryServicesProvidersListByReplicationFabricsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationFabrics(fabricName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationRecoveryServicesProvidersListByReplicationFabricsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationFabricsNext( + resourceName, + resourceGroupName, fabricName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationFabricsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationRecoveryServicesProvidersListByReplicationFabricsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, fabricName, options )) { @@ -104,12 +146,17 @@ export class ReplicationRecoveryServicesProvidersImpl /** * Lists the registered recovery services providers in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationRecoveryServicesProvidersListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -117,75 +164,120 @@ export class ReplicationRecoveryServicesProvidersImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationRecoveryServicesProvidersListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationRecoveryServicesProvidersListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationRecoveryServicesProvidersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationRecoveryServicesProvidersListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists the registered recovery services providers for the specified fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ private _listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationRecoveryServicesProvidersListByReplicationFabricsOptionalParams ): Promise< ReplicationRecoveryServicesProvidersListByReplicationFabricsResponse > { return this.client.sendOperationRequest( - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, listByReplicationFabricsOperationSpec ); } /** * Gets the details of registered recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, providerName, options }, + { resourceName, resourceGroupName, fabricName, providerName, options }, getOperationSpec ); } /** * The operation to add a recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param addProviderInput Add provider input. * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, addProviderInput: AddRecoveryServicesProviderInput, @@ -237,29 +329,45 @@ export class ReplicationRecoveryServicesProvidersImpl const lro = new LroImpl( sendOperation, - { fabricName, providerName, addProviderInput, options }, + { + resourceName, + resourceGroupName, + fabricName, + providerName, + addProviderInput, + options + }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to add a recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param addProviderInput Add provider input. * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, addProviderInput: AddRecoveryServicesProviderInput, options?: ReplicationRecoveryServicesProvidersCreateOptionalParams ): Promise { const poller = await this.beginCreate( + resourceName, + resourceGroupName, fabricName, providerName, addProviderInput, @@ -270,11 +378,16 @@ export class ReplicationRecoveryServicesProvidersImpl /** * The operation to purge(force delete) a recovery services provider from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ async beginPurge( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersPurgeOptionalParams @@ -320,37 +433,55 @@ export class ReplicationRecoveryServicesProvidersImpl const lro = new LroImpl( sendOperation, - { fabricName, providerName, options }, + { resourceName, resourceGroupName, fabricName, providerName, options }, purgeOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to purge(force delete) a recovery services provider from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ async beginPurgeAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersPurgeOptionalParams ): Promise { - const poller = await this.beginPurge(fabricName, providerName, options); + const poller = await this.beginPurge( + resourceName, + resourceGroupName, + fabricName, + providerName, + options + ); return poller.pollUntilDone(); } /** * The operation to refresh the information from the recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ async beginRefreshProvider( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersRefreshProviderOptionalParams @@ -403,27 +534,36 @@ export class ReplicationRecoveryServicesProvidersImpl const lro = new LroImpl( sendOperation, - { fabricName, providerName, options }, + { resourceName, resourceGroupName, fabricName, providerName, options }, refreshProviderOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to refresh the information from the recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ async beginRefreshProviderAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersRefreshProviderOptionalParams ): Promise { const poller = await this.beginRefreshProvider( + resourceName, + resourceGroupName, fabricName, providerName, options @@ -433,11 +573,16 @@ export class ReplicationRecoveryServicesProvidersImpl /** * The operation to removes/delete(unregister) a recovery services provider from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersDeleteOptionalParams @@ -483,48 +628,74 @@ export class ReplicationRecoveryServicesProvidersImpl const lro = new LroImpl( sendOperation, - { fabricName, providerName, options }, + { resourceName, resourceGroupName, fabricName, providerName, options }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to removes/delete(unregister) a recovery services provider from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersDeleteOptionalParams ): Promise { - const poller = await this.beginDelete(fabricName, providerName, options); + const poller = await this.beginDelete( + resourceName, + resourceGroupName, + fabricName, + providerName, + options + ); return poller.pollUntilDone(); } /** * Lists the registered recovery services providers in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationRecoveryServicesProvidersListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationFabricsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param nextLink The nextLink from the previous successful call to the ListByReplicationFabrics * method. * @param options The options parameters. */ private _listByReplicationFabricsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, nextLink: string, options?: ReplicationRecoveryServicesProvidersListByReplicationFabricsNextOptionalParams @@ -532,22 +703,27 @@ export class ReplicationRecoveryServicesProvidersImpl ReplicationRecoveryServicesProvidersListByReplicationFabricsNextResponse > { return this.client.sendOperationRequest( - { fabricName, nextLink, options }, + { resourceName, resourceGroupName, fabricName, nextLink, options }, listByReplicationFabricsNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationRecoveryServicesProvidersListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -717,7 +893,6 @@ const listByReplicationFabricsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.RecoveryServicesProviderCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -737,7 +912,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.RecoveryServicesProviderCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationStorageClassificationMappings.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationStorageClassificationMappings.ts index 2091faebcd8a..90ed0ff727f0 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationStorageClassificationMappings.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationStorageClassificationMappings.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationStorageClassificationMappings } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,16 +19,16 @@ import { StorageClassificationMapping, ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsNextOptionalParams, ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsOptionalParams, + ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsResponse, ReplicationStorageClassificationMappingsListNextOptionalParams, ReplicationStorageClassificationMappingsListOptionalParams, - ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsResponse, + ReplicationStorageClassificationMappingsListResponse, ReplicationStorageClassificationMappingsGetOptionalParams, ReplicationStorageClassificationMappingsGetResponse, StorageClassificationMappingInput, ReplicationStorageClassificationMappingsCreateOptionalParams, ReplicationStorageClassificationMappingsCreateResponse, ReplicationStorageClassificationMappingsDeleteOptionalParams, - ReplicationStorageClassificationMappingsListResponse, ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsNextResponse, ReplicationStorageClassificationMappingsListNextResponse } from "../models"; @@ -48,16 +49,23 @@ export class ReplicationStorageClassificationMappingsImpl /** * Lists the storage classification mappings for the fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param options The options parameters. */ public listByReplicationStorageClassifications( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsOptionalParams ): PagedAsyncIterableIterator { const iter = this.listByReplicationStorageClassificationsPagingAll( + resourceName, + resourceGroupName, fabricName, storageClassificationName, options @@ -69,46 +77,71 @@ export class ReplicationStorageClassificationMappingsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByReplicationStorageClassificationsPagingPage( + resourceName, + resourceGroupName, fabricName, storageClassificationName, - options + options, + settings ); } }; } private async *listByReplicationStorageClassificationsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, - options?: ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsOptionalParams + options?: ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationStorageClassifications( - fabricName, - storageClassificationName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationStorageClassifications( + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationStorageClassificationsNext( + resourceName, + resourceGroupName, fabricName, storageClassificationName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationStorageClassificationsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationStorageClassificationsPagingPage( + resourceName, + resourceGroupName, fabricName, storageClassificationName, options @@ -119,12 +152,17 @@ export class ReplicationStorageClassificationMappingsImpl /** * Lists the storage classification mappings in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationStorageClassificationMappingsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -132,40 +170,75 @@ export class ReplicationStorageClassificationMappingsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationStorageClassificationMappingsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationStorageClassificationMappingsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationStorageClassificationMappingsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationStorageClassificationMappingsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists the storage classification mappings for the fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param options The options parameters. */ private _listByReplicationStorageClassifications( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsOptionalParams @@ -173,19 +246,30 @@ export class ReplicationStorageClassificationMappingsImpl ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsResponse > { return this.client.sendOperationRequest( - { fabricName, storageClassificationName, options }, + { + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + options + }, listByReplicationStorageClassificationsOperationSpec ); } /** * Gets the details of the specified storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, @@ -193,6 +277,8 @@ export class ReplicationStorageClassificationMappingsImpl ): Promise { return this.client.sendOperationRequest( { + resourceName, + resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, @@ -204,6 +290,9 @@ export class ReplicationStorageClassificationMappingsImpl /** * The operation to create a storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. @@ -211,6 +300,8 @@ export class ReplicationStorageClassificationMappingsImpl * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, @@ -266,6 +357,8 @@ export class ReplicationStorageClassificationMappingsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, @@ -274,14 +367,19 @@ export class ReplicationStorageClassificationMappingsImpl }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to create a storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. @@ -289,6 +387,8 @@ export class ReplicationStorageClassificationMappingsImpl * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, @@ -296,6 +396,8 @@ export class ReplicationStorageClassificationMappingsImpl options?: ReplicationStorageClassificationMappingsCreateOptionalParams ): Promise { const poller = await this.beginCreate( + resourceName, + resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, @@ -307,12 +409,17 @@ export class ReplicationStorageClassificationMappingsImpl /** * The operation to delete a storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, @@ -360,6 +467,8 @@ export class ReplicationStorageClassificationMappingsImpl const lro = new LroImpl( sendOperation, { + resourceName, + resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, @@ -367,26 +476,35 @@ export class ReplicationStorageClassificationMappingsImpl }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to delete a storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, options?: ReplicationStorageClassificationMappingsDeleteOptionalParams ): Promise { const poller = await this.beginDelete( + resourceName, + resourceGroupName, fabricName, storageClassificationName, storageClassificationMappingName, @@ -397,16 +515,27 @@ export class ReplicationStorageClassificationMappingsImpl /** * Lists the storage classification mappings in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationStorageClassificationMappingsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationStorageClassificationsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param nextLink The nextLink from the previous successful call to the @@ -414,6 +543,8 @@ export class ReplicationStorageClassificationMappingsImpl * @param options The options parameters. */ private _listByReplicationStorageClassificationsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, nextLink: string, @@ -422,22 +553,34 @@ export class ReplicationStorageClassificationMappingsImpl ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsNextResponse > { return this.client.sendOperationRequest( - { fabricName, storageClassificationName, nextLink, options }, + { + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + nextLink, + options + }, listByReplicationStorageClassificationsNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationStorageClassificationMappingsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -565,7 +708,6 @@ const listByReplicationStorageClassificationsNextOperationSpec: coreClient.Opera bodyMapper: Mappers.StorageClassificationMappingCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -586,7 +728,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.StorageClassificationMappingCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationStorageClassifications.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationStorageClassifications.ts index f5d3eb473a45..37646293c35d 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationStorageClassifications.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationStorageClassifications.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationStorageClassifications } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,12 +17,12 @@ import { StorageClassification, ReplicationStorageClassificationsListByReplicationFabricsNextOptionalParams, ReplicationStorageClassificationsListByReplicationFabricsOptionalParams, + ReplicationStorageClassificationsListByReplicationFabricsResponse, ReplicationStorageClassificationsListNextOptionalParams, ReplicationStorageClassificationsListOptionalParams, - ReplicationStorageClassificationsListByReplicationFabricsResponse, + ReplicationStorageClassificationsListResponse, ReplicationStorageClassificationsGetOptionalParams, ReplicationStorageClassificationsGetResponse, - ReplicationStorageClassificationsListResponse, ReplicationStorageClassificationsListByReplicationFabricsNextResponse, ReplicationStorageClassificationsListNextResponse } from "../models"; @@ -42,14 +43,24 @@ export class ReplicationStorageClassificationsImpl /** * Lists the storage classifications available in the specified fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Site name of interest. * @param options The options parameters. */ public listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationStorageClassificationsListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listByReplicationFabricsPagingAll(fabricName, options); + const iter = this.listByReplicationFabricsPagingAll( + resourceName, + resourceGroupName, + fabricName, + options + ); return { next() { return iter.next(); @@ -57,35 +68,66 @@ export class ReplicationStorageClassificationsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByReplicationFabricsPagingPage(fabricName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, + fabricName, + options, + settings + ); } }; } private async *listByReplicationFabricsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, - options?: ReplicationStorageClassificationsListByReplicationFabricsOptionalParams + options?: ReplicationStorageClassificationsListByReplicationFabricsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationFabrics(fabricName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationStorageClassificationsListByReplicationFabricsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationFabricsNext( + resourceName, + resourceGroupName, fabricName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationFabricsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationStorageClassificationsListByReplicationFabricsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, fabricName, options )) { @@ -95,12 +137,17 @@ export class ReplicationStorageClassificationsImpl /** * Lists the storage classifications in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationStorageClassificationsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -108,85 +155,144 @@ export class ReplicationStorageClassificationsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationStorageClassificationsListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationStorageClassificationsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationStorageClassificationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationStorageClassificationsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists the storage classifications available in the specified fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Site name of interest. * @param options The options parameters. */ private _listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationStorageClassificationsListByReplicationFabricsOptionalParams ): Promise< ReplicationStorageClassificationsListByReplicationFabricsResponse > { return this.client.sendOperationRequest( - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, listByReplicationFabricsOperationSpec ); } /** * Gets the details of the specified storage classification. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, storageClassificationName, options }, + { + resourceName, + resourceGroupName, + fabricName, + storageClassificationName, + options + }, getOperationSpec ); } /** * Lists the storage classifications in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationStorageClassificationsListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationFabricsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Site name of interest. * @param nextLink The nextLink from the previous successful call to the ListByReplicationFabrics * method. * @param options The options parameters. */ private _listByReplicationFabricsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, nextLink: string, options?: ReplicationStorageClassificationsListByReplicationFabricsNextOptionalParams @@ -194,22 +300,27 @@ export class ReplicationStorageClassificationsImpl ReplicationStorageClassificationsListByReplicationFabricsNextResponse > { return this.client.sendOperationRequest( - { fabricName, nextLink, options }, + { resourceName, resourceGroupName, fabricName, nextLink, options }, listByReplicationFabricsNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationStorageClassificationsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -285,7 +396,6 @@ const listByReplicationFabricsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.StorageClassificationCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -305,7 +415,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.StorageClassificationCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationVaultHealth.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationVaultHealth.ts index d760dcf6c23c..799a38658696 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationVaultHealth.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationVaultHealth.ts @@ -34,19 +34,32 @@ export class ReplicationVaultHealthImpl implements ReplicationVaultHealth { /** * Gets the health details of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultHealthGetOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, getOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + getOperationSpec + ); } /** * Refreshes health summary of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ async beginRefresh( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultHealthRefreshOptionalParams ): Promise< PollerLike< @@ -93,21 +106,36 @@ export class ReplicationVaultHealthImpl implements ReplicationVaultHealth { }; }; - const lro = new LroImpl(sendOperation, { options }, refreshOperationSpec); - return new LroEngine(lro, { + const lro = new LroImpl( + sendOperation, + { resourceName, resourceGroupName, options }, + refreshOperationSpec + ); + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * Refreshes health summary of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ async beginRefreshAndWait( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultHealthRefreshOptionalParams ): Promise { - const poller = await this.beginRefresh(options); + const poller = await this.beginRefresh( + resourceName, + resourceGroupName, + options + ); return poller.pollUntilDone(); } } diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationVaultSetting.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationVaultSetting.ts index d11b81225584..047614c7244a 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationVaultSetting.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationVaultSetting.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationVaultSetting } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -42,12 +43,17 @@ export class ReplicationVaultSettingImpl implements ReplicationVaultSetting { /** * Gets the list of vault setting. This includes the Migration Hub connection settings. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultSettingListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -55,65 +61,113 @@ export class ReplicationVaultSettingImpl implements ReplicationVaultSetting { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationVaultSettingListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationVaultSettingListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationVaultSettingListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultSettingListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Gets the list of vault setting. This includes the Migration Hub connection settings. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultSettingListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * Gets the vault setting. This includes the Migration Hub connection settings. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param vaultSettingName Vault setting name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, vaultSettingName: string, options?: ReplicationVaultSettingGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { vaultSettingName, options }, + { resourceName, resourceGroupName, vaultSettingName, options }, getOperationSpec ); } /** * The operation to configure vault setting. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param vaultSettingName Vault setting name. * @param input Vault setting creation input. * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, vaultSettingName: string, input: VaultSettingCreationInput, options?: ReplicationVaultSettingCreateOptionalParams @@ -164,41 +218,59 @@ export class ReplicationVaultSettingImpl implements ReplicationVaultSetting { const lro = new LroImpl( sendOperation, - { vaultSettingName, input, options }, + { resourceName, resourceGroupName, vaultSettingName, input, options }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to configure vault setting. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param vaultSettingName Vault setting name. * @param input Vault setting creation input. * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, vaultSettingName: string, input: VaultSettingCreationInput, options?: ReplicationVaultSettingCreateOptionalParams ): Promise { - const poller = await this.beginCreate(vaultSettingName, input, options); + const poller = await this.beginCreate( + resourceName, + resourceGroupName, + vaultSettingName, + input, + options + ); return poller.pollUntilDone(); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationVaultSettingListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -284,7 +356,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VaultSettingCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationvCenters.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationvCenters.ts index a541ea6d1778..f0da56a891ba 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationvCenters.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/replicationvCenters.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ReplicationvCenters } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { VCenter, ReplicationvCentersListByReplicationFabricsNextOptionalParams, ReplicationvCentersListByReplicationFabricsOptionalParams, + ReplicationvCentersListByReplicationFabricsResponse, ReplicationvCentersListNextOptionalParams, ReplicationvCentersListOptionalParams, - ReplicationvCentersListByReplicationFabricsResponse, + ReplicationvCentersListResponse, ReplicationvCentersGetOptionalParams, ReplicationvCentersGetResponse, AddVCenterRequest, @@ -30,7 +32,6 @@ import { UpdateVCenterRequest, ReplicationvCentersUpdateOptionalParams, ReplicationvCentersUpdateResponse, - ReplicationvCentersListResponse, ReplicationvCentersListByReplicationFabricsNextResponse, ReplicationvCentersListNextResponse } from "../models"; @@ -50,14 +51,24 @@ export class ReplicationvCentersImpl implements ReplicationvCenters { /** * Lists the vCenter servers registered in a fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ public listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationvCentersListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listByReplicationFabricsPagingAll(fabricName, options); + const iter = this.listByReplicationFabricsPagingAll( + resourceName, + resourceGroupName, + fabricName, + options + ); return { next() { return iter.next(); @@ -65,35 +76,66 @@ export class ReplicationvCentersImpl implements ReplicationvCenters { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByReplicationFabricsPagingPage(fabricName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, + fabricName, + options, + settings + ); } }; } private async *listByReplicationFabricsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, - options?: ReplicationvCentersListByReplicationFabricsOptionalParams + options?: ReplicationvCentersListByReplicationFabricsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationFabrics(fabricName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationvCentersListByReplicationFabricsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationFabrics( + resourceName, + resourceGroupName, + fabricName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationFabricsNext( + resourceName, + resourceGroupName, fabricName, continuationToken, options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationFabricsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationvCentersListByReplicationFabricsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationFabricsPagingPage( + resourceName, + resourceGroupName, fabricName, options )) { @@ -103,12 +145,17 @@ export class ReplicationvCentersImpl implements ReplicationvCenters { /** * Lists the vCenter servers registered in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ public list( + resourceName: string, + resourceGroupName: string, options?: ReplicationvCentersListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); + const iter = this.listPagingAll(resourceName, resourceGroupName, options); return { next() { return iter.next(); @@ -116,73 +163,118 @@ export class ReplicationvCentersImpl implements ReplicationvCenters { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceName, + resourceGroupName, + options, + settings + ); } }; } private async *listPagingPage( - options?: ReplicationvCentersListOptionalParams + resourceName: string, + resourceGroupName: string, + options?: ReplicationvCentersListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ReplicationvCentersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceName, resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { - result = await this._listNext(continuationToken, options); + result = await this._listNext( + resourceName, + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listPagingAll( + resourceName: string, + resourceGroupName: string, options?: ReplicationvCentersListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { + for await (const page of this.listPagingPage( + resourceName, + resourceGroupName, + options + )) { yield* page; } } /** * Lists the vCenter servers registered in a fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ private _listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationvCentersListByReplicationFabricsOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, options }, + { resourceName, resourceGroupName, fabricName, options }, listByReplicationFabricsOperationSpec ); } /** * Gets the details of a registered vCenter server(Add vCenter server). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, options?: ReplicationvCentersGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, vcenterName, options }, + { resourceName, resourceGroupName, fabricName, vcenterName, options }, getOperationSpec ); } /** * The operation to create a vCenter object.. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param addVCenterRequest The input to the add vCenter operation. * @param options The options parameters. */ async beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, addVCenterRequest: AddVCenterRequest, @@ -234,29 +326,45 @@ export class ReplicationvCentersImpl implements ReplicationvCenters { const lro = new LroImpl( sendOperation, - { fabricName, vcenterName, addVCenterRequest, options }, + { + resourceName, + resourceGroupName, + fabricName, + vcenterName, + addVCenterRequest, + options + }, createOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to create a vCenter object.. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param addVCenterRequest The input to the add vCenter operation. * @param options The options parameters. */ async beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, addVCenterRequest: AddVCenterRequest, options?: ReplicationvCentersCreateOptionalParams ): Promise { const poller = await this.beginCreate( + resourceName, + resourceGroupName, fabricName, vcenterName, addVCenterRequest, @@ -267,11 +375,16 @@ export class ReplicationvCentersImpl implements ReplicationvCenters { /** * The operation to remove(unregister) a registered vCenter server from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param options The options parameters. */ async beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, options?: ReplicationvCentersDeleteOptionalParams @@ -317,38 +430,56 @@ export class ReplicationvCentersImpl implements ReplicationvCenters { const lro = new LroImpl( sendOperation, - { fabricName, vcenterName, options }, + { resourceName, resourceGroupName, fabricName, vcenterName, options }, deleteOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to remove(unregister) a registered vCenter server from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param options The options parameters. */ async beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, options?: ReplicationvCentersDeleteOptionalParams ): Promise { - const poller = await this.beginDelete(fabricName, vcenterName, options); + const poller = await this.beginDelete( + resourceName, + resourceGroupName, + fabricName, + vcenterName, + options + ); return poller.pollUntilDone(); } /** * The operation to update a registered vCenter. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param updateVCenterRequest The input to the update vCenter operation. * @param options The options parameters. */ async beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, updateVCenterRequest: UpdateVCenterRequest, @@ -400,29 +531,45 @@ export class ReplicationvCentersImpl implements ReplicationvCenters { const lro = new LroImpl( sendOperation, - { fabricName, vcenterName, updateVCenterRequest, options }, + { + resourceName, + resourceGroupName, + fabricName, + vcenterName, + updateVCenterRequest, + options + }, updateOperationSpec ); - return new LroEngine(lro, { + const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); + await poller.poll(); + return poller; } /** * The operation to update a registered vCenter. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param updateVCenterRequest The input to the update vCenter operation. * @param options The options parameters. */ async beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, updateVCenterRequest: UpdateVCenterRequest, options?: ReplicationvCentersUpdateOptionalParams ): Promise { const poller = await this.beginUpdate( + resourceName, + resourceGroupName, fabricName, vcenterName, updateVCenterRequest, @@ -433,43 +580,61 @@ export class ReplicationvCentersImpl implements ReplicationvCenters { /** * Lists the vCenter servers registered in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ private _list( + resourceName: string, + resourceGroupName: string, options?: ReplicationvCentersListOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + listOperationSpec + ); } /** * ListByReplicationFabricsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param nextLink The nextLink from the previous successful call to the ListByReplicationFabrics * method. * @param options The options parameters. */ private _listByReplicationFabricsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, nextLink: string, options?: ReplicationvCentersListByReplicationFabricsNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { fabricName, nextLink, options }, + { resourceName, resourceGroupName, fabricName, nextLink, options }, listByReplicationFabricsNextOperationSpec ); } /** * ListNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( + resourceName: string, + resourceGroupName: string, nextLink: string, options?: ReplicationvCentersListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { nextLink, options }, + { resourceName, resourceGroupName, nextLink, options }, listNextOperationSpec ); } @@ -625,7 +790,6 @@ const listByReplicationFabricsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VCenterCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -645,7 +809,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VCenterCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/supportedOperatingSystemsOperations.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/supportedOperatingSystemsOperations.ts index a9065d125e79..e8e07d9520fd 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/supportedOperatingSystemsOperations.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/supportedOperatingSystemsOperations.ts @@ -31,12 +31,20 @@ export class SupportedOperatingSystemsOperationsImpl /** * Gets the data of supported operating systems by SRS. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, options?: SupportedOperatingSystemsGetOptionalParams ): Promise { - return this.client.sendOperationRequest({ options }, getOperationSpec); + return this.client.sendOperationRequest( + { resourceName, resourceGroupName, options }, + getOperationSpec + ); } } // Operation Specifications diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/targetComputeSizes.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/targetComputeSizes.ts index dde927a4bbe4..0dfb80ec25f7 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/targetComputeSizes.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operations/targetComputeSizes.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { TargetComputeSizes } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -35,18 +36,25 @@ export class TargetComputeSizesImpl implements TargetComputeSizes { /** * Lists the available target compute sizes for a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ public listByReplicationProtectedItems( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: TargetComputeSizesListByReplicationProtectedItemsOptionalParams ): PagedAsyncIterableIterator { const iter = this.listByReplicationProtectedItemsPagingAll( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -59,33 +67,52 @@ export class TargetComputeSizesImpl implements TargetComputeSizes { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByReplicationProtectedItemsPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, - options + options, + settings ); } }; } private async *listByReplicationProtectedItemsPagingPage( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, - options?: TargetComputeSizesListByReplicationProtectedItemsOptionalParams + options?: TargetComputeSizesListByReplicationProtectedItemsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByReplicationProtectedItems( - fabricName, - protectionContainerName, - replicatedProtectedItemName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: TargetComputeSizesListByReplicationProtectedItemsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByReplicationProtectedItems( + resourceName, + resourceGroupName, + fabricName, + protectionContainerName, + replicatedProtectedItemName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByReplicationProtectedItemsNext( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -93,17 +120,23 @@ export class TargetComputeSizesImpl implements TargetComputeSizes { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } private async *listByReplicationProtectedItemsPagingAll( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, options?: TargetComputeSizesListByReplicationProtectedItemsOptionalParams ): AsyncIterableIterator { for await (const page of this.listByReplicationProtectedItemsPagingPage( + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -115,12 +148,17 @@ export class TargetComputeSizesImpl implements TargetComputeSizes { /** * Lists the available target compute sizes for a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ private _listByReplicationProtectedItems( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -128,6 +166,8 @@ export class TargetComputeSizesImpl implements TargetComputeSizes { ): Promise { return this.client.sendOperationRequest( { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -139,6 +179,9 @@ export class TargetComputeSizesImpl implements TargetComputeSizes { /** * ListByReplicationProtectedItemsNext + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -147,6 +190,8 @@ export class TargetComputeSizesImpl implements TargetComputeSizes { * @param options The options parameters. */ private _listByReplicationProtectedItemsNext( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -155,6 +200,8 @@ export class TargetComputeSizesImpl implements TargetComputeSizes { ): Promise { return this.client.sendOperationRequest( { + resourceName, + resourceGroupName, fabricName, protectionContainerName, replicatedProtectedItemName, @@ -198,7 +245,6 @@ const listByReplicationProtectedItemsNextOperationSpec: coreClient.OperationSpec bodyMapper: Mappers.TargetComputeSizeCollection } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/migrationRecoveryPoints.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/migrationRecoveryPoints.ts index 8996502a340c..e7fdb1ec191e 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/migrationRecoveryPoints.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/migrationRecoveryPoints.ts @@ -19,12 +19,17 @@ import { export interface MigrationRecoveryPoints { /** * Gets the recovery points for a migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. * @param options The options parameters. */ listByReplicationMigrationItems( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -32,6 +37,9 @@ export interface MigrationRecoveryPoints { ): PagedAsyncIterableIterator; /** * Gets a recovery point for a migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -39,6 +47,8 @@ export interface MigrationRecoveryPoints { * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/operations.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/operations.ts index bfc3f13fab5d..f7404f515873 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/operations.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/operations.ts @@ -14,9 +14,12 @@ import { OperationsDiscovery, OperationsListOptionalParams } from "../models"; export interface Operations { /** * Operation to return the list of available operations. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceGroupName: string, options?: OperationsListOptionalParams ): PagedAsyncIterableIterator; } diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/recoveryPoints.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/recoveryPoints.ts index a048e734f193..67c5914abda0 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/recoveryPoints.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/recoveryPoints.ts @@ -19,12 +19,17 @@ import { export interface RecoveryPoints { /** * Lists the available recovery points for a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replication protected item name. * @param options The options parameters. */ listByReplicationProtectedItems( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -32,6 +37,9 @@ export interface RecoveryPoints { ): PagedAsyncIterableIterator; /** * Get the details of specified recovery point. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replication protected item name. @@ -39,6 +47,8 @@ export interface RecoveryPoints { * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationAlertSettings.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationAlertSettings.ts index 504ad56e0740..00d6ab5b3ca2 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationAlertSettings.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationAlertSettings.ts @@ -22,27 +22,42 @@ import { export interface ReplicationAlertSettings { /** * Gets the list of email notification(alert) configurations for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationAlertSettingsListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of the specified email notification(alert) configuration. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param alertSettingName The name of the email notification configuration. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, alertSettingName: string, options?: ReplicationAlertSettingsGetOptionalParams ): Promise; /** * Create or update an email notification(alert) configuration. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param alertSettingName The name of the email notification(alert) configuration. * @param request The input to configure the email notification(alert). * @param options The options parameters. */ create( + resourceName: string, + resourceGroupName: string, alertSettingName: string, request: ConfigureAlertRequest, options?: ReplicationAlertSettingsCreateOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationAppliances.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationAppliances.ts index 27b58e7ad502..f6ac55d84a88 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationAppliances.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationAppliances.ts @@ -17,9 +17,14 @@ import { export interface ReplicationAppliances { /** * Gets the list of Azure Site Recovery appliances for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationAppliancesListOptionalParams ): PagedAsyncIterableIterator; } diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationEligibilityResultsOperations.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationEligibilityResultsOperations.ts index b7cda009da3c..25dc97fbdbf1 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationEligibilityResultsOperations.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationEligibilityResultsOperations.ts @@ -17,19 +17,25 @@ import { export interface ReplicationEligibilityResultsOperations { /** * Validates whether a given VM can be protected or not in which case returns list of errors. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param virtualMachineName Virtual Machine name. * @param options The options parameters. */ list( + resourceGroupName: string, virtualMachineName: string, options?: ReplicationEligibilityResultsListOptionalParams ): Promise; /** * Validates whether a given VM can be protected or not in which case returns list of errors. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param virtualMachineName Virtual Machine name. * @param options The options parameters. */ get( + resourceGroupName: string, virtualMachineName: string, options?: ReplicationEligibilityResultsGetOptionalParams ): Promise; diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationEvents.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationEvents.ts index 4653a17ceed6..50018b627939 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationEvents.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationEvents.ts @@ -19,17 +19,27 @@ import { export interface ReplicationEvents { /** * Gets the list of Azure Site Recovery events for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationEventsListOptionalParams ): PagedAsyncIterableIterator; /** * The operation to get the details of an Azure Site recovery event. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param eventName The name of the Azure Site Recovery event. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, eventName: string, options?: ReplicationEventsGetOptionalParams ): Promise; diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationFabrics.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationFabrics.ts index 4a6eb9a99682..6eadc043321f 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationFabrics.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationFabrics.ts @@ -34,27 +34,42 @@ import { export interface ReplicationFabrics { /** * Gets a list of the Azure Site Recovery fabrics in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationFabricsListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsGetOptionalParams ): Promise; /** * The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Name of the ASR fabric. * @param input Fabric creation input. * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, input: FabricCreationInput, options?: ReplicationFabricsCreateOptionalParams @@ -66,39 +81,59 @@ export interface ReplicationFabrics { >; /** * The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Name of the ASR fabric. * @param input Fabric creation input. * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, input: FabricCreationInput, options?: ReplicationFabricsCreateOptionalParams ): Promise; /** * The operation to purge(force delete) an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to purge. * @param options The options parameters. */ beginPurge( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsPurgeOptionalParams ): Promise, void>>; /** * The operation to purge(force delete) an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to purge. * @param options The options parameters. */ beginPurgeAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsPurgeOptionalParams ): Promise; /** * The operation to perform a consistency check on the fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ beginCheckConsistency( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsCheckConsistencyOptionalParams ): Promise< @@ -109,38 +144,58 @@ export interface ReplicationFabrics { >; /** * The operation to perform a consistency check on the fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ beginCheckConsistencyAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsCheckConsistencyOptionalParams ): Promise; /** * The operation to migrate an Azure Site Recovery fabric to AAD. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to migrate. * @param options The options parameters. */ beginMigrateToAad( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsMigrateToAadOptionalParams ): Promise, void>>; /** * The operation to migrate an Azure Site Recovery fabric to AAD. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to migrate. * @param options The options parameters. */ beginMigrateToAadAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsMigrateToAadOptionalParams ): Promise; /** * The operation to move replications from a process server to another process server. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric containing the process server. * @param failoverProcessServerRequest The input to the failover process server operation. * @param options The options parameters. */ beginReassociateGateway( + resourceName: string, + resourceGroupName: string, fabricName: string, failoverProcessServerRequest: FailoverProcessServerRequest, options?: ReplicationFabricsReassociateGatewayOptionalParams @@ -152,40 +207,60 @@ export interface ReplicationFabrics { >; /** * The operation to move replications from a process server to another process server. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric containing the process server. * @param failoverProcessServerRequest The input to the failover process server operation. * @param options The options parameters. */ beginReassociateGatewayAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, failoverProcessServerRequest: FailoverProcessServerRequest, options?: ReplicationFabricsReassociateGatewayOptionalParams ): Promise; /** * The operation to delete or remove an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to delete. * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsDeleteOptionalParams ): Promise, void>>; /** * The operation to delete or remove an Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName ASR fabric to delete. * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationFabricsDeleteOptionalParams ): Promise; /** * Renews the connection certificate for the ASR replication fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName fabric name to renew certs for. * @param renewCertificate Renew certificate input. * @param options The options parameters. */ beginRenewCertificate( + resourceName: string, + resourceGroupName: string, fabricName: string, renewCertificate: RenewCertificateInput, options?: ReplicationFabricsRenewCertificateOptionalParams @@ -197,11 +272,16 @@ export interface ReplicationFabrics { >; /** * Renews the connection certificate for the ASR replication fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName fabric name to renew certs for. * @param renewCertificate Renew certificate input. * @param options The options parameters. */ beginRenewCertificateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, renewCertificate: RenewCertificateInput, options?: ReplicationFabricsRenewCertificateOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationJobs.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationJobs.ts index 1b34628d1742..ea545225e90d 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationJobs.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationJobs.ts @@ -30,26 +30,41 @@ import { export interface ReplicationJobs { /** * Gets the list of Azure Site Recovery Jobs for the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationJobsListOptionalParams ): PagedAsyncIterableIterator; /** * Get the details of an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsGetOptionalParams ): Promise; /** * The operation to cancel an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ beginCancel( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsCancelOptionalParams ): Promise< @@ -60,19 +75,29 @@ export interface ReplicationJobs { >; /** * The operation to cancel an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ beginCancelAndWait( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsCancelOptionalParams ): Promise; /** * The operation to restart an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ beginRestart( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsRestartOptionalParams ): Promise< @@ -83,20 +108,30 @@ export interface ReplicationJobs { >; /** * The operation to restart an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param options The options parameters. */ beginRestartAndWait( + resourceName: string, + resourceGroupName: string, jobName: string, options?: ReplicationJobsRestartOptionalParams ): Promise; /** * The operation to resume an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param resumeJobParams Resume rob comments. * @param options The options parameters. */ beginResume( + resourceName: string, + resourceGroupName: string, jobName: string, resumeJobParams: ResumeJobParams, options?: ReplicationJobsResumeOptionalParams @@ -108,21 +143,31 @@ export interface ReplicationJobs { >; /** * The operation to resume an Azure Site Recovery job. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobName Job identifier. * @param resumeJobParams Resume rob comments. * @param options The options parameters. */ beginResumeAndWait( + resourceName: string, + resourceGroupName: string, jobName: string, resumeJobParams: ResumeJobParams, options?: ReplicationJobsResumeOptionalParams ): Promise; /** * The operation to export the details of the Azure Site Recovery jobs of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobQueryParameter job query filter. * @param options The options parameters. */ beginExport( + resourceName: string, + resourceGroupName: string, jobQueryParameter: JobQueryParameter, options?: ReplicationJobsExportOptionalParams ): Promise< @@ -133,10 +178,15 @@ export interface ReplicationJobs { >; /** * The operation to export the details of the Azure Site Recovery jobs of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param jobQueryParameter job query filter. * @param options The options parameters. */ beginExportAndWait( + resourceName: string, + resourceGroupName: string, jobQueryParameter: JobQueryParameter, options?: ReplicationJobsExportOptionalParams ): Promise; diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationLogicalNetworks.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationLogicalNetworks.ts index c7a6c453ed42..edb41a6c01c4 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationLogicalNetworks.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationLogicalNetworks.ts @@ -19,20 +19,30 @@ import { export interface ReplicationLogicalNetworks { /** * Lists all the logical networks of the Azure Site Recovery fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Server Id. * @param options The options parameters. */ listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationLogicalNetworksListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of a logical network. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Server Id. * @param logicalNetworkName Logical network name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, logicalNetworkName: string, options?: ReplicationLogicalNetworksGetOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationMigrationItems.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationMigrationItems.ts index 1cadf130d44e..b3e63c41e65c 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationMigrationItems.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationMigrationItems.ts @@ -24,6 +24,12 @@ import { MigrateInput, ReplicationMigrationItemsMigrateOptionalParams, ReplicationMigrationItemsMigrateResponse, + PauseReplicationInput, + ReplicationMigrationItemsPauseReplicationOptionalParams, + ReplicationMigrationItemsPauseReplicationResponse, + ResumeReplicationInput, + ReplicationMigrationItemsResumeReplicationOptionalParams, + ReplicationMigrationItemsResumeReplicationResponse, ResyncInput, ReplicationMigrationItemsResyncOptionalParams, ReplicationMigrationItemsResyncResponse, @@ -40,30 +46,45 @@ import { export interface ReplicationMigrationItems { /** * Gets the list of ASR migration items in the protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationMigrationItemsListByReplicationProtectionContainersOptionalParams ): PagedAsyncIterableIterator; /** * Gets the list of migration items in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationMigrationItemsListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of a migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -71,6 +92,9 @@ export interface ReplicationMigrationItems { ): Promise; /** * The operation to create an ASR migration item (enable migration). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -78,6 +102,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -91,6 +117,9 @@ export interface ReplicationMigrationItems { >; /** * The operation to create an ASR migration item (enable migration). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -98,6 +127,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -106,12 +137,17 @@ export interface ReplicationMigrationItems { ): Promise; /** * The operation to delete an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -119,12 +155,17 @@ export interface ReplicationMigrationItems { ): Promise, void>>; /** * The operation to delete an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -132,6 +173,9 @@ export interface ReplicationMigrationItems { ): Promise; /** * The operation to update the recovery settings of an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -139,6 +183,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -152,6 +198,9 @@ export interface ReplicationMigrationItems { >; /** * The operation to update the recovery settings of an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -159,6 +208,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -167,6 +218,9 @@ export interface ReplicationMigrationItems { ): Promise; /** * The operation to initiate migration of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -174,6 +228,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginMigrate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -187,6 +243,9 @@ export interface ReplicationMigrationItems { >; /** * The operation to initiate migration of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -194,14 +253,109 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginMigrateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, migrateInput: MigrateInput, options?: ReplicationMigrationItemsMigrateOptionalParams ): Promise; + /** + * The operation to initiate pause replication of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @param options The options parameters. + */ + beginPauseReplication( + resourceName: string, + resourceGroupName: string, + fabricName: string, + protectionContainerName: string, + migrationItemName: string, + pauseReplicationInput: PauseReplicationInput, + options?: ReplicationMigrationItemsPauseReplicationOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ReplicationMigrationItemsPauseReplicationResponse + > + >; + /** + * The operation to initiate pause replication of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param pauseReplicationInput Pause replication input. + * @param options The options parameters. + */ + beginPauseReplicationAndWait( + resourceName: string, + resourceGroupName: string, + fabricName: string, + protectionContainerName: string, + migrationItemName: string, + pauseReplicationInput: PauseReplicationInput, + options?: ReplicationMigrationItemsPauseReplicationOptionalParams + ): Promise; + /** + * The operation to initiate resume replication of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @param options The options parameters. + */ + beginResumeReplication( + resourceName: string, + resourceGroupName: string, + fabricName: string, + protectionContainerName: string, + migrationItemName: string, + resumeReplicationInput: ResumeReplicationInput, + options?: ReplicationMigrationItemsResumeReplicationOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ReplicationMigrationItemsResumeReplicationResponse + > + >; + /** + * The operation to initiate resume replication of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. + * @param fabricName Fabric name. + * @param protectionContainerName Protection container name. + * @param migrationItemName Migration item name. + * @param resumeReplicationInput Resume replication input. + * @param options The options parameters. + */ + beginResumeReplicationAndWait( + resourceName: string, + resourceGroupName: string, + fabricName: string, + protectionContainerName: string, + migrationItemName: string, + resumeReplicationInput: ResumeReplicationInput, + options?: ReplicationMigrationItemsResumeReplicationOptionalParams + ): Promise; /** * The operation to resynchronize replication of an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -209,6 +363,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginResync( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -222,6 +378,9 @@ export interface ReplicationMigrationItems { >; /** * The operation to resynchronize replication of an ASR migration item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -229,6 +388,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginResyncAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -237,6 +398,9 @@ export interface ReplicationMigrationItems { ): Promise; /** * The operation to initiate test migration of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -244,6 +408,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginTestMigrate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -257,6 +423,9 @@ export interface ReplicationMigrationItems { >; /** * The operation to initiate test migration of the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -264,6 +433,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginTestMigrateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -272,6 +443,9 @@ export interface ReplicationMigrationItems { ): Promise; /** * The operation to initiate test migrate cleanup. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -279,6 +453,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginTestMigrateCleanup( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, @@ -292,6 +468,9 @@ export interface ReplicationMigrationItems { >; /** * The operation to initiate test migrate cleanup. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param migrationItemName Migration item name. @@ -299,6 +478,8 @@ export interface ReplicationMigrationItems { * @param options The options parameters. */ beginTestMigrateCleanupAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, migrationItemName: string, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationNetworkMappings.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationNetworkMappings.ts index 618e260a720e..4a71f49db459 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationNetworkMappings.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationNetworkMappings.ts @@ -28,30 +28,45 @@ import { export interface ReplicationNetworkMappings { /** * Lists all ASR network mappings for the specified network. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param options The options parameters. */ listByReplicationNetworks( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, options?: ReplicationNetworkMappingsListByReplicationNetworksOptionalParams ): PagedAsyncIterableIterator; /** * Lists all ASR network mappings in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationNetworkMappingsListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -59,6 +74,9 @@ export interface ReplicationNetworkMappings { ): Promise; /** * The operation to create an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. @@ -66,6 +84,8 @@ export interface ReplicationNetworkMappings { * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -79,6 +99,9 @@ export interface ReplicationNetworkMappings { >; /** * The operation to create an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. @@ -86,6 +109,8 @@ export interface ReplicationNetworkMappings { * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -94,12 +119,17 @@ export interface ReplicationNetworkMappings { ): Promise; /** * The operation to delete a network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName ARM Resource Name for network mapping. * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -107,12 +137,17 @@ export interface ReplicationNetworkMappings { ): Promise, void>>; /** * The operation to delete a network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName ARM Resource Name for network mapping. * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -120,6 +155,9 @@ export interface ReplicationNetworkMappings { ): Promise; /** * The operation to update an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. @@ -127,6 +165,8 @@ export interface ReplicationNetworkMappings { * @param options The options parameters. */ beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, @@ -140,6 +180,9 @@ export interface ReplicationNetworkMappings { >; /** * The operation to update an ASR network mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Primary fabric name. * @param networkName Primary network name. * @param networkMappingName Network mapping name. @@ -147,6 +190,8 @@ export interface ReplicationNetworkMappings { * @param options The options parameters. */ beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, networkMappingName: string, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationNetworks.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationNetworks.ts index 91f561c82a07..b081c68fedf1 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationNetworks.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationNetworks.ts @@ -20,27 +20,42 @@ import { export interface ReplicationNetworks { /** * Lists the networks available for a fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationNetworksListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator; /** * Lists the networks available in a vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationNetworksListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of a network. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Server Id. * @param networkName Primary network name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, networkName: string, options?: ReplicationNetworksGetOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationPolicies.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationPolicies.ts index 2ea286ad4776..bc7964724aed 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationPolicies.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationPolicies.ts @@ -27,27 +27,42 @@ import { export interface ReplicationPolicies { /** * Lists the replication policies for a vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationPoliciesListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, policyName: string, options?: ReplicationPoliciesGetOptionalParams ): Promise; /** * The operation to create a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param input Create policy input. * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, policyName: string, input: CreatePolicyInput, options?: ReplicationPoliciesCreateOptionalParams @@ -59,40 +74,60 @@ export interface ReplicationPolicies { >; /** * The operation to create a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param input Create policy input. * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, policyName: string, input: CreatePolicyInput, options?: ReplicationPoliciesCreateOptionalParams ): Promise; /** * The operation to delete a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, policyName: string, options?: ReplicationPoliciesDeleteOptionalParams ): Promise, void>>; /** * The operation to delete a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Replication policy name. * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, policyName: string, options?: ReplicationPoliciesDeleteOptionalParams ): Promise; /** * The operation to update a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Policy Id. * @param input Update Policy Input. * @param options The options parameters. */ beginUpdate( + resourceName: string, + resourceGroupName: string, policyName: string, input: UpdatePolicyInput, options?: ReplicationPoliciesUpdateOptionalParams @@ -104,11 +139,16 @@ export interface ReplicationPolicies { >; /** * The operation to update a replication policy. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param policyName Policy Id. * @param input Update Policy Input. * @param options The options parameters. */ beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, policyName: string, input: UpdatePolicyInput, options?: ReplicationPoliciesUpdateOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectableItems.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectableItems.ts index 9c632a243d24..759f1baf0f78 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectableItems.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectableItems.ts @@ -19,23 +19,33 @@ import { export interface ReplicationProtectableItems { /** * Lists the protectable items in a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectableItemsListByReplicationProtectionContainersOptionalParams ): PagedAsyncIterableIterator; /** * The operation to get the details of a protectable item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param protectableItemName Protectable item name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, protectableItemName: string, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectedItems.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectedItems.ts index 6de52d3298d4..888d8611d615 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectedItems.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectedItems.ts @@ -72,30 +72,45 @@ import { export interface ReplicationProtectedItems { /** * Gets the list of ASR replication protected items in the protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectedItemsListByReplicationProtectionContainersOptionalParams ): PagedAsyncIterableIterator; /** * Gets the list of ASR replication protected items in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectedItemsListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric unique name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -103,6 +118,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * The operation to create an ASR replication protected item (Enable replication). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Name of the fabric. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName A name for the replication protected item. @@ -110,6 +128,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -123,6 +143,9 @@ export interface ReplicationProtectedItems { >; /** * The operation to create an ASR replication protected item (Enable replication). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Name of the fabric. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName A name for the replication protected item. @@ -130,6 +153,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -140,12 +165,17 @@ export interface ReplicationProtectedItems { * The operation to delete or purge a replication protected item. This operation will force delete the * replication protected item. Use the remove operation on replication protected item to perform a * clean disable replication for the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ beginPurge( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -155,12 +185,17 @@ export interface ReplicationProtectedItems { * The operation to delete or purge a replication protected item. This operation will force delete the * replication protected item. Use the remove operation on replication protected item to perform a * clean disable replication for the item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ beginPurgeAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -168,6 +203,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * The operation to update the recovery settings of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -175,6 +213,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -188,6 +228,9 @@ export interface ReplicationProtectedItems { >; /** * The operation to update the recovery settings of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -195,6 +238,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -203,6 +248,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to add disks(s) to the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -210,6 +258,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginAddDisks( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -223,6 +273,9 @@ export interface ReplicationProtectedItems { >; /** * Operation to add disks(s) to the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -230,6 +283,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginAddDisksAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -238,6 +293,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * The operation to change the recovery point of a failed over replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The ARM fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replicated protected item name. @@ -245,6 +303,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginApplyRecoveryPoint( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -258,6 +318,9 @@ export interface ReplicationProtectedItems { >; /** * The operation to change the recovery point of a failed over replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The ARM fabric name. * @param protectionContainerName The protection container name. * @param replicatedProtectedItemName The replicated protected item name. @@ -265,6 +328,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginApplyRecoveryPointAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -273,12 +338,17 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to cancel the failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ beginFailoverCancel( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -291,12 +361,17 @@ export interface ReplicationProtectedItems { >; /** * Operation to cancel the failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ beginFailoverCancelAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -304,12 +379,17 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to commit the failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ beginFailoverCommit( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -322,12 +402,17 @@ export interface ReplicationProtectedItems { >; /** * Operation to commit the failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ beginFailoverCommitAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -335,6 +420,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to initiate a planned failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -342,6 +430,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginPlannedFailover( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -355,6 +445,9 @@ export interface ReplicationProtectedItems { >; /** * Operation to initiate a planned failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -362,6 +455,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginPlannedFailoverAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -371,6 +466,9 @@ export interface ReplicationProtectedItems { /** * The operation to disable replication on a replication protected item. This will also remove the * item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -378,6 +476,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -387,6 +487,9 @@ export interface ReplicationProtectedItems { /** * The operation to disable replication on a replication protected item. This will also remove the * item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -394,6 +497,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -402,6 +507,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to remove disk(s) from the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -409,6 +517,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginRemoveDisks( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -422,6 +532,9 @@ export interface ReplicationProtectedItems { >; /** * Operation to remove disk(s) from the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -429,6 +542,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginRemoveDisksAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -438,12 +553,17 @@ export interface ReplicationProtectedItems { /** * The operation to start resynchronize/repair replication for a replication protected item requiring * resynchronization. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric. * @param protectionContainerName The name of the container. * @param replicatedProtectedItemName The name of the replication protected item. * @param options The options parameters. */ beginRepairReplication( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -457,12 +577,17 @@ export interface ReplicationProtectedItems { /** * The operation to start resynchronize/repair replication for a replication protected item requiring * resynchronization. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric. * @param protectionContainerName The name of the container. * @param replicatedProtectedItemName The name of the replication protected item. * @param options The options parameters. */ beginRepairReplicationAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -470,6 +595,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to reprotect or reverse replicate a failed over replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -477,6 +605,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginReprotect( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -490,6 +620,9 @@ export interface ReplicationProtectedItems { >; /** * Operation to reprotect or reverse replicate a failed over replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -497,6 +630,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginReprotectAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -505,6 +640,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to resolve health issues of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -512,6 +650,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginResolveHealthErrors( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -525,6 +665,9 @@ export interface ReplicationProtectedItems { >; /** * Operation to resolve health issues of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -532,6 +675,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginResolveHealthErrorsAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -540,6 +685,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to initiate a switch provider of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -547,6 +695,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginSwitchProvider( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -560,6 +710,9 @@ export interface ReplicationProtectedItems { >; /** * Operation to initiate a switch provider of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -567,6 +720,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginSwitchProviderAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -575,6 +730,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to perform a test failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -582,6 +740,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginTestFailover( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -595,6 +755,9 @@ export interface ReplicationProtectedItems { >; /** * Operation to perform a test failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -602,6 +765,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginTestFailoverAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -610,6 +775,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to clean up the test failover of a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -617,6 +785,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginTestFailoverCleanup( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -630,6 +800,9 @@ export interface ReplicationProtectedItems { >; /** * Operation to clean up the test failover of a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -637,6 +810,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginTestFailoverCleanupAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -645,6 +820,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * Operation to initiate a failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -652,6 +830,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginUnplannedFailover( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -665,6 +845,9 @@ export interface ReplicationProtectedItems { >; /** * Operation to initiate a failover of the replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -672,6 +855,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginUnplannedFailoverAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -680,6 +865,9 @@ export interface ReplicationProtectedItems { ): Promise; /** * The operation to update appliance of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -687,6 +875,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginUpdateAppliance( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -700,6 +890,9 @@ export interface ReplicationProtectedItems { >; /** * The operation to update appliance of an ASR replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param replicatedProtectedItemName Replication protected item name. @@ -707,6 +900,8 @@ export interface ReplicationProtectedItems { * @param options The options parameters. */ beginUpdateApplianceAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, @@ -716,17 +911,22 @@ export interface ReplicationProtectedItems { /** * The operation to update(push update) the installed mobility service software on a replication * protected item to the latest available version. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric containing the protected item. * @param protectionContainerName The name of the container containing the protected item. - * @param replicationProtectedItemName The name of the protected item on which the agent is to be - * updated. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be + * updated. * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. * @param options The options parameters. */ beginUpdateMobilityService( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, - replicationProtectedItemName: string, + replicatedProtectedItemName: string, updateMobilityServiceRequest: UpdateMobilityServiceRequest, options?: ReplicationProtectedItemsUpdateMobilityServiceOptionalParams ): Promise< @@ -740,17 +940,22 @@ export interface ReplicationProtectedItems { /** * The operation to update(push update) the installed mobility service software on a replication * protected item to the latest available version. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric containing the protected item. * @param protectionContainerName The name of the container containing the protected item. - * @param replicationProtectedItemName The name of the protected item on which the agent is to be - * updated. + * @param replicatedProtectedItemName The name of the protected item on which the agent is to be + * updated. * @param updateMobilityServiceRequest Request to update the mobility service on the protected item. * @param options The options parameters. */ beginUpdateMobilityServiceAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, - replicationProtectedItemName: string, + replicatedProtectedItemName: string, updateMobilityServiceRequest: UpdateMobilityServiceRequest, options?: ReplicationProtectedItemsUpdateMobilityServiceOptionalParams ): Promise; diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionContainerMappings.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionContainerMappings.ts index 1602dadc425f..e52c2e0cbfa8 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionContainerMappings.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionContainerMappings.ts @@ -30,30 +30,45 @@ import { export interface ReplicationProtectionContainerMappings { /** * Lists the protection container mappings for a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ listByReplicationProtectionContainers( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainerMappingsListByReplicationProtectionContainersOptionalParams ): PagedAsyncIterableIterator; /** * Lists the protection container mappings in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionContainerMappingsListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection Container mapping name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -61,6 +76,9 @@ export interface ReplicationProtectionContainerMappings { ): Promise; /** * The operation to create a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -68,6 +86,8 @@ export interface ReplicationProtectionContainerMappings { * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -81,6 +101,9 @@ export interface ReplicationProtectionContainerMappings { >; /** * The operation to create a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -88,6 +111,8 @@ export interface ReplicationProtectionContainerMappings { * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -96,12 +121,17 @@ export interface ReplicationProtectionContainerMappings { ): Promise; /** * The operation to purge(force delete) a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. * @param options The options parameters. */ beginPurge( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -109,12 +139,17 @@ export interface ReplicationProtectionContainerMappings { ): Promise, void>>; /** * The operation to purge(force delete) a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. * @param options The options parameters. */ beginPurgeAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -122,6 +157,9 @@ export interface ReplicationProtectionContainerMappings { ): Promise; /** * The operation to update protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -129,6 +167,8 @@ export interface ReplicationProtectionContainerMappings { * @param options The options parameters. */ beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -142,6 +182,9 @@ export interface ReplicationProtectionContainerMappings { >; /** * The operation to update protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -149,6 +192,8 @@ export interface ReplicationProtectionContainerMappings { * @param options The options parameters. */ beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -157,6 +202,9 @@ export interface ReplicationProtectionContainerMappings { ): Promise; /** * The operation to delete or remove a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -164,6 +212,8 @@ export interface ReplicationProtectionContainerMappings { * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, @@ -172,6 +222,9 @@ export interface ReplicationProtectionContainerMappings { ): Promise, void>>; /** * The operation to delete or remove a protection container mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param mappingName Protection container mapping name. @@ -179,6 +232,8 @@ export interface ReplicationProtectionContainerMappings { * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, mappingName: string, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionContainers.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionContainers.ts index 213399c0deeb..09432a58ba29 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionContainers.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionContainers.ts @@ -31,39 +31,59 @@ import { export interface ReplicationProtectionContainers { /** * Lists the protection containers in the specified fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationProtectionContainersListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator; /** * Lists the protection containers in a vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionContainersListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName Protection container name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersGetOptionalParams ): Promise; /** * Operation to create a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric ARM name. * @param protectionContainerName Unique protection container ARM name. * @param creationInput Creation input. * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, creationInput: CreateProtectionContainerInput, @@ -76,12 +96,17 @@ export interface ReplicationProtectionContainers { >; /** * Operation to create a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric ARM name. * @param protectionContainerName Unique protection container ARM name. * @param creationInput Creation input. * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, creationInput: CreateProtectionContainerInput, @@ -89,12 +114,17 @@ export interface ReplicationProtectionContainers { ): Promise; /** * The operation to a add a protectable item to a protection container(Add physical server). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric. * @param protectionContainerName The name of the protection container. * @param discoverProtectableItemRequest The request object to add a protectable item. * @param options The options parameters. */ beginDiscoverProtectableItem( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, discoverProtectableItemRequest: DiscoverProtectableItemRequest, @@ -109,12 +139,17 @@ export interface ReplicationProtectionContainers { >; /** * The operation to a add a protectable item to a protection container(Add physical server). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName The name of the fabric. * @param protectionContainerName The name of the protection container. * @param discoverProtectableItemRequest The request object to add a protectable item. * @param options The options parameters. */ beginDiscoverProtectableItemAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, discoverProtectableItemRequest: DiscoverProtectableItemRequest, @@ -122,34 +157,49 @@ export interface ReplicationProtectionContainers { ): Promise; /** * Operation to remove a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric ARM name. * @param protectionContainerName Unique protection container ARM name. * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersDeleteOptionalParams ): Promise, void>>; /** * Operation to remove a protection container. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric ARM name. * @param protectionContainerName Unique protection container ARM name. * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, options?: ReplicationProtectionContainersDeleteOptionalParams ): Promise; /** * Operation to switch protection from one container to another or one replication provider to another. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param switchInput Switch protection input. * @param options The options parameters. */ beginSwitchProtection( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, switchInput: SwitchProtectionInput, @@ -164,12 +214,17 @@ export interface ReplicationProtectionContainers { >; /** * Operation to switch protection from one container to another or one replication provider to another. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Unique fabric name. * @param protectionContainerName Protection container name. * @param switchInput Switch protection input. * @param options The options parameters. */ beginSwitchProtectionAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, switchInput: SwitchProtectionInput, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionIntents.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionIntents.ts index cbd4db9d0d98..d7d0881250a5 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionIntents.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationProtectionIntents.ts @@ -22,27 +22,42 @@ import { export interface ReplicationProtectionIntents { /** * Gets the list of ASR replication protection intent objects in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationProtectionIntentsListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of an ASR replication protection intent. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param intentObjectName Replication protection intent name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, intentObjectName: string, options?: ReplicationProtectionIntentsGetOptionalParams ): Promise; /** * The operation to create an ASR replication protection intent item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param intentObjectName A name for the replication protection item. * @param input Create Protection Intent Input. * @param options The options parameters. */ create( + resourceName: string, + resourceGroupName: string, intentObjectName: string, input: CreateProtectionIntentInput, options?: ReplicationProtectionIntentsCreateOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationRecoveryPlans.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationRecoveryPlans.ts index 16a91ef88e3b..4ce5ccb496bb 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationRecoveryPlans.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationRecoveryPlans.ts @@ -45,27 +45,42 @@ import { export interface ReplicationRecoveryPlans { /** * Lists the recovery plans in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationRecoveryPlansListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of the recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Name of the recovery plan. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansGetOptionalParams ): Promise; /** * The operation to create a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery Plan creation input. * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: CreateRecoveryPlanInput, options?: ReplicationRecoveryPlansCreateOptionalParams @@ -77,40 +92,60 @@ export interface ReplicationRecoveryPlans { >; /** * The operation to create a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery Plan creation input. * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: CreateRecoveryPlanInput, options?: ReplicationRecoveryPlansCreateOptionalParams ): Promise; /** * Delete a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansDeleteOptionalParams ): Promise, void>>; /** * Delete a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansDeleteOptionalParams ): Promise; /** * The operation to update a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Update recovery plan input. * @param options The options parameters. */ beginUpdate( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: UpdateRecoveryPlanInput, options?: ReplicationRecoveryPlansUpdateOptionalParams @@ -122,21 +157,31 @@ export interface ReplicationRecoveryPlans { >; /** * The operation to update a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Update recovery plan input. * @param options The options parameters. */ beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: UpdateRecoveryPlanInput, options?: ReplicationRecoveryPlansUpdateOptionalParams ): Promise; /** * The operation to cancel the failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ beginFailoverCancel( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCancelOptionalParams ): Promise< @@ -147,19 +192,29 @@ export interface ReplicationRecoveryPlans { >; /** * The operation to cancel the failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ beginFailoverCancelAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCancelOptionalParams ): Promise; /** * The operation to commit the failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ beginFailoverCommit( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCommitOptionalParams ): Promise< @@ -170,20 +225,30 @@ export interface ReplicationRecoveryPlans { >; /** * The operation to commit the failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ beginFailoverCommitAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansFailoverCommitOptionalParams ): Promise; /** * The operation to start the planned failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Failover input. * @param options The options parameters. */ beginPlannedFailover( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanPlannedFailoverInput, options?: ReplicationRecoveryPlansPlannedFailoverOptionalParams @@ -195,21 +260,31 @@ export interface ReplicationRecoveryPlans { >; /** * The operation to start the planned failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Failover input. * @param options The options parameters. */ beginPlannedFailoverAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanPlannedFailoverInput, options?: ReplicationRecoveryPlansPlannedFailoverOptionalParams ): Promise; /** * The operation to reprotect(reverse replicate) a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ beginReprotect( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansReprotectOptionalParams ): Promise< @@ -220,20 +295,30 @@ export interface ReplicationRecoveryPlans { >; /** * The operation to reprotect(reverse replicate) a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param options The options parameters. */ beginReprotectAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, options?: ReplicationRecoveryPlansReprotectOptionalParams ): Promise; /** * The operation to start the test failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan test failover input. * @param options The options parameters. */ beginTestFailover( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverInput, options?: ReplicationRecoveryPlansTestFailoverOptionalParams @@ -245,22 +330,32 @@ export interface ReplicationRecoveryPlans { >; /** * The operation to start the test failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan test failover input. * @param options The options parameters. */ beginTestFailoverAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverInput, options?: ReplicationRecoveryPlansTestFailoverOptionalParams ): Promise; /** * The operation to cleanup test failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan test failover cleanup input. * @param options The options parameters. */ beginTestFailoverCleanup( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverCleanupInput, options?: ReplicationRecoveryPlansTestFailoverCleanupOptionalParams @@ -272,22 +367,32 @@ export interface ReplicationRecoveryPlans { >; /** * The operation to cleanup test failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan test failover cleanup input. * @param options The options parameters. */ beginTestFailoverCleanupAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanTestFailoverCleanupInput, options?: ReplicationRecoveryPlansTestFailoverCleanupOptionalParams ): Promise; /** * The operation to start the unplanned failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan unplanned failover input. * @param options The options parameters. */ beginUnplannedFailover( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanUnplannedFailoverInput, options?: ReplicationRecoveryPlansUnplannedFailoverOptionalParams @@ -299,11 +404,16 @@ export interface ReplicationRecoveryPlans { >; /** * The operation to start the unplanned failover of a recovery plan. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param recoveryPlanName Recovery plan name. * @param input Recovery plan unplanned failover input. * @param options The options parameters. */ beginUnplannedFailoverAndWait( + resourceName: string, + resourceGroupName: string, recoveryPlanName: string, input: RecoveryPlanUnplannedFailoverInput, options?: ReplicationRecoveryPlansUnplannedFailoverOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationRecoveryServicesProviders.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationRecoveryServicesProviders.ts index a09a73bf1373..f3676a4743ad 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationRecoveryServicesProviders.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationRecoveryServicesProviders.ts @@ -28,39 +28,59 @@ import { export interface ReplicationRecoveryServicesProviders { /** * Lists the registered recovery services providers for the specified fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationRecoveryServicesProvidersListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator; /** * Lists the registered recovery services providers in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationRecoveryServicesProvidersListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of registered recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersGetOptionalParams ): Promise; /** * The operation to add a recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param addProviderInput Add provider input. * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, addProviderInput: AddRecoveryServicesProviderInput, @@ -73,12 +93,17 @@ export interface ReplicationRecoveryServicesProviders { >; /** * The operation to add a recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param addProviderInput Add provider input. * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, addProviderInput: AddRecoveryServicesProviderInput, @@ -86,33 +111,48 @@ export interface ReplicationRecoveryServicesProviders { ): Promise; /** * The operation to purge(force delete) a recovery services provider from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ beginPurge( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersPurgeOptionalParams ): Promise, void>>; /** * The operation to purge(force delete) a recovery services provider from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ beginPurgeAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersPurgeOptionalParams ): Promise; /** * The operation to refresh the information from the recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ beginRefreshProvider( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersRefreshProviderOptionalParams @@ -126,33 +166,48 @@ export interface ReplicationRecoveryServicesProviders { >; /** * The operation to refresh the information from the recovery services provider. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ beginRefreshProviderAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersRefreshProviderOptionalParams ): Promise; /** * The operation to removes/delete(unregister) a recovery services provider from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersDeleteOptionalParams ): Promise, void>>; /** * The operation to removes/delete(unregister) a recovery services provider from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param providerName Recovery services provider name. * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, providerName: string, options?: ReplicationRecoveryServicesProvidersDeleteOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationStorageClassificationMappings.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationStorageClassificationMappings.ts index 5bdc71dded2f..fb9f19a0c0d9 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationStorageClassificationMappings.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationStorageClassificationMappings.ts @@ -25,30 +25,45 @@ import { export interface ReplicationStorageClassificationMappings { /** * Lists the storage classification mappings for the fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param options The options parameters. */ listByReplicationStorageClassifications( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationMappingsListByReplicationStorageClassificationsOptionalParams ): PagedAsyncIterableIterator; /** * Lists the storage classification mappings in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationStorageClassificationMappingsListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of the specified storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, @@ -56,6 +71,9 @@ export interface ReplicationStorageClassificationMappings { ): Promise; /** * The operation to create a storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. @@ -63,6 +81,8 @@ export interface ReplicationStorageClassificationMappings { * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, @@ -78,6 +98,9 @@ export interface ReplicationStorageClassificationMappings { >; /** * The operation to create a storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. @@ -85,6 +108,8 @@ export interface ReplicationStorageClassificationMappings { * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, @@ -93,12 +118,17 @@ export interface ReplicationStorageClassificationMappings { ): Promise; /** * The operation to delete a storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, @@ -106,12 +136,17 @@ export interface ReplicationStorageClassificationMappings { ): Promise, void>>; /** * The operation to delete a storage classification mapping. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param storageClassificationMappingName Storage classification mapping name. * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, storageClassificationMappingName: string, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationStorageClassifications.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationStorageClassifications.ts index 65b6fa0b2c4c..a4eb6220cd75 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationStorageClassifications.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationStorageClassifications.ts @@ -20,27 +20,42 @@ import { export interface ReplicationStorageClassifications { /** * Lists the storage classifications available in the specified fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Site name of interest. * @param options The options parameters. */ listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationStorageClassificationsListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator; /** * Lists the storage classifications in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationStorageClassificationsListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of the specified storage classification. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param storageClassificationName Storage classification name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, storageClassificationName: string, options?: ReplicationStorageClassificationsGetOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationVaultHealth.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationVaultHealth.ts index a0d35428df99..ce649d41cc1d 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationVaultHealth.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationVaultHealth.ts @@ -18,16 +18,26 @@ import { export interface ReplicationVaultHealth { /** * Gets the health details of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultHealthGetOptionalParams ): Promise; /** * Refreshes health summary of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ beginRefresh( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultHealthRefreshOptionalParams ): Promise< PollerLike< @@ -37,9 +47,14 @@ export interface ReplicationVaultHealth { >; /** * Refreshes health summary of the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ beginRefreshAndWait( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultHealthRefreshOptionalParams ): Promise; } diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationVaultSetting.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationVaultSetting.ts index c3da16493d25..b202755cd41d 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationVaultSetting.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationVaultSetting.ts @@ -23,27 +23,42 @@ import { export interface ReplicationVaultSetting { /** * Gets the list of vault setting. This includes the Migration Hub connection settings. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationVaultSettingListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the vault setting. This includes the Migration Hub connection settings. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param vaultSettingName Vault setting name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, vaultSettingName: string, options?: ReplicationVaultSettingGetOptionalParams ): Promise; /** * The operation to configure vault setting. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param vaultSettingName Vault setting name. * @param input Vault setting creation input. * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, vaultSettingName: string, input: VaultSettingCreationInput, options?: ReplicationVaultSettingCreateOptionalParams @@ -55,11 +70,16 @@ export interface ReplicationVaultSetting { >; /** * The operation to configure vault setting. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param vaultSettingName Vault setting name. * @param input Vault setting creation input. * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, vaultSettingName: string, input: VaultSettingCreationInput, options?: ReplicationVaultSettingCreateOptionalParams diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationvCenters.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationvCenters.ts index 4c376af6632d..e00f37f06a96 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationvCenters.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/replicationvCenters.ts @@ -28,39 +28,59 @@ import { export interface ReplicationvCenters { /** * Lists the vCenter servers registered in a fabric. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param options The options parameters. */ listByReplicationFabrics( + resourceName: string, + resourceGroupName: string, fabricName: string, options?: ReplicationvCentersListByReplicationFabricsOptionalParams ): PagedAsyncIterableIterator; /** * Lists the vCenter servers registered in the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ list( + resourceName: string, + resourceGroupName: string, options?: ReplicationvCentersListOptionalParams ): PagedAsyncIterableIterator; /** * Gets the details of a registered vCenter server(Add vCenter server). + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, options?: ReplicationvCentersGetOptionalParams ): Promise; /** * The operation to create a vCenter object.. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param addVCenterRequest The input to the add vCenter operation. * @param options The options parameters. */ beginCreate( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, addVCenterRequest: AddVCenterRequest, @@ -73,12 +93,17 @@ export interface ReplicationvCenters { >; /** * The operation to create a vCenter object.. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param addVCenterRequest The input to the add vCenter operation. * @param options The options parameters. */ beginCreateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, addVCenterRequest: AddVCenterRequest, @@ -86,34 +111,49 @@ export interface ReplicationvCenters { ): Promise; /** * The operation to remove(unregister) a registered vCenter server from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param options The options parameters. */ beginDelete( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, options?: ReplicationvCentersDeleteOptionalParams ): Promise, void>>; /** * The operation to remove(unregister) a registered vCenter server from the vault. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param options The options parameters. */ beginDeleteAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, options?: ReplicationvCentersDeleteOptionalParams ): Promise; /** * The operation to update a registered vCenter. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param updateVCenterRequest The input to the update vCenter operation. * @param options The options parameters. */ beginUpdate( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, updateVCenterRequest: UpdateVCenterRequest, @@ -126,12 +166,17 @@ export interface ReplicationvCenters { >; /** * The operation to update a registered vCenter. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param vcenterName vcenter name. * @param updateVCenterRequest The input to the update vCenter operation. * @param options The options parameters. */ beginUpdateAndWait( + resourceName: string, + resourceGroupName: string, fabricName: string, vcenterName: string, updateVCenterRequest: UpdateVCenterRequest, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/supportedOperatingSystemsOperations.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/supportedOperatingSystemsOperations.ts index 9f05bd9e6b20..e4507603c5c0 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/supportedOperatingSystemsOperations.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/supportedOperatingSystemsOperations.ts @@ -15,9 +15,14 @@ import { export interface SupportedOperatingSystemsOperations { /** * Gets the data of supported operating systems by SRS. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param options The options parameters. */ get( + resourceName: string, + resourceGroupName: string, options?: SupportedOperatingSystemsGetOptionalParams ): Promise; } diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/targetComputeSizes.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/targetComputeSizes.ts index 20e5e6b2b7e6..2172a12ece73 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/targetComputeSizes.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/operationsInterfaces/targetComputeSizes.ts @@ -17,12 +17,17 @@ import { export interface TargetComputeSizes { /** * Lists the available target compute sizes for a replication protected item. + * @param resourceName The name of the recovery services vault. + * @param resourceGroupName The name of the resource group where the recovery services vault is + * present. * @param fabricName Fabric name. * @param protectionContainerName protection container name. * @param replicatedProtectedItemName Replication protected item name. * @param options The options parameters. */ listByReplicationProtectedItems( + resourceName: string, + resourceGroupName: string, fabricName: string, protectionContainerName: string, replicatedProtectedItemName: string, diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/pagingHelper.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/siteRecoveryManagementClient.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/siteRecoveryManagementClient.ts index 162b19bfcad3..d6129604d628 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/siteRecoveryManagementClient.ts +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/src/siteRecoveryManagementClient.ts @@ -7,6 +7,12 @@ */ 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 { OperationsImpl, @@ -73,38 +79,25 @@ import { SiteRecoveryManagementClientOptionalParams } from "./models"; export class SiteRecoveryManagementClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - resourceGroupName: string; subscriptionId: string; - resourceName: string; /** * Initializes a new instance of the SiteRecoveryManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param resourceGroupName The name of the resource group where the recovery services vault is - * present. * @param subscriptionId The subscription Id. - * @param resourceName The name of the recovery services vault. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, - resourceGroupName: string, subscriptionId: string, - resourceName: string, options?: SiteRecoveryManagementClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (resourceGroupName === undefined) { - throw new Error("'resourceGroupName' cannot be null"); - } if (subscriptionId === undefined) { throw new Error("'subscriptionId' cannot be null"); } - if (resourceName === undefined) { - throw new Error("'resourceName' cannot be null"); - } // Initializing default values for options if (!options) { @@ -115,32 +108,60 @@ export class SiteRecoveryManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-recoveryservices-siterecovery/4.0.0`; + const packageDetails = `azsdk-js-arm-recoveryservices-siterecovery/5.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - baseUri: options.endpoint || "https://management.azure.com" + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } // Parameter assignments - this.resourceGroupName = resourceGroupName; this.subscriptionId = subscriptionId; - this.resourceName = resourceName; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-11-01"; + this.apiVersion = options.apiVersion || "2022-10-01"; this.operations = new OperationsImpl(this); this.replicationAlertSettings = new ReplicationAlertSettingsImpl(this); this.replicationAppliances = new ReplicationAppliancesImpl(this); @@ -187,6 +208,35 @@ export class SiteRecoveryManagementClient extends coreClient.ServiceClient { ); this.replicationVaultHealth = new ReplicationVaultHealthImpl(this); this.replicationVaultSetting = new ReplicationVaultSettingImpl(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); } operations: Operations; diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/test/recoveryservicessiterecovery_examples.spec.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/test/recoveryservicessiterecovery_examples.spec.ts new file mode 100644 index 000000000000..d3f318cf67ee --- /dev/null +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/test/recoveryservicessiterecovery_examples.spec.ts @@ -0,0 +1,67 @@ +/* + * 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 { + env, + Recorder, + RecorderStartOptions, + delay, + isPlaybackMode, +} from "@azure-tools/test-recorder"; +import { createTestCredential } from "@azure-tools/test-credential"; +import { assert } from "chai"; +import { Context } from "mocha"; +import { SiteRecoveryManagementClient } from "../src/siteRecoveryManagementClient"; + +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 +}; + +export const testPollingOptions = { + updateIntervalInMs: isPlaybackMode() ? 0 : undefined, +}; + +describe("RecoveryservicesSiteRecovery test", () => { + let recorder: Recorder; + let subscriptionId: string; + let client: SiteRecoveryManagementClient; + let location: string; + let resourceGroup: string; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + subscriptionId = env.SUBSCRIPTION_ID || ''; + // This is an example of how the environment variables are used + const credential = createTestCredential(); + client = new SiteRecoveryManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); + location = "eastus"; + resourceGroup = "myjstest"; + + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("operations list test", async function () { + const resArray = new Array(); + for await (let item of client.operations.list(resourceGroup)) { + resArray.push(item); + } + console.log(resArray); + }); + +}) diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/test/sampleTest.ts b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/test/sampleTest.ts deleted file mode 100644 index 7ed89b043e1b..000000000000 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/test/sampleTest.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - record, - RecorderEnvironmentSetup, - Recorder -} from "@azure-tools/test-recorder"; -import * as assert from "assert"; - -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: [] -}; - -describe("My test", () => { - let recorder: Recorder; - - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); - }); - - afterEach(async function() { - await recorder.stop(); - }); - - it("sample test", async function() { - console.log("Hi, I'm a test!"); - }); -}); diff --git a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/tsconfig.json b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/tsconfig.json index 6e3251194117..b23a972336c8 100644 --- a/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/tsconfig.json +++ b/sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery/tsconfig.json @@ -9,11 +9,25 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true + "importHelpers": true, + "paths": { + "@azure/arm-recoveryservices-siterecovery": [ + "./src/index" + ] + } }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/recoveryservicessiterecovery/ci.mgmt.yml b/sdk/recoveryservicessiterecovery/ci.mgmt.yml index 164470c8c336..2911b9599d87 100644 --- a/sdk/recoveryservicessiterecovery/ci.mgmt.yml +++ b/sdk/recoveryservicessiterecovery/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -10,6 +10,7 @@ trigger: include: - sdk/recoveryservicessiterecovery/ci.mgmt.yml - sdk/recoveryservicessiterecovery/arm-recoveryservicessiterecovery/ + - sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery pr: branches: include: @@ -23,11 +24,11 @@ pr: include: - sdk/recoveryservicessiterecovery/ci.mgmt.yml - sdk/recoveryservicessiterecovery/arm-recoveryservicessiterecovery/ - + - sdk/recoveryservicessiterecovery/arm-recoveryservices-siterecovery extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: recoveryservicessiterecovery Artifacts: - name: azure-arm-recoveryservices-siterecovery - safeName: azurearmrecoveryservicessiterecovery \ No newline at end of file + safeName: azurearmrecoveryservicessiterecovery