Skip to content

Commit dfd55e1

Browse files
committed
Moving objects to PSContracts
1 parent fca5e0a commit dfd55e1

File tree

3 files changed

+156
-153
lines changed

3 files changed

+156
-153
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/CreateAzureSiteRecoveryProtectionProfileObject.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using System;
1616
using System.Management.Automation;
1717
using Microsoft.Azure.Commands.RecoveryServices.SiteRecovery;
18+
using Microsoft.Azure.Portal.RecoveryServices.Models.Common;
1819
using Microsoft.WindowsAzure.Management.SiteRecovery.Models;
1920
using Microsoft.WindowsAzure.Management.Storage.Models;
2021

@@ -60,7 +61,7 @@ public class CreateAzureSiteRecoveryProtectionProfileObject : RecoveryServicesCm
6061
/// <summary>
6162
/// Gets or sets Recovery Azure Storage Account Name of the Protection Profile for E2A scenarios.
6263
/// </summary>
63-
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure, Mandatory = true, ValueFromPipeline = true)]
64+
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure, Mandatory = true)]
6465
[ValidateNotNullOrEmpty]
6566
public string RecoveryAzureStorageAccount { get; set; }
6667

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/lib/PSContracts.cs

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,158 @@ public class HyperVReplicaAzureProtectionProfileDetails
740740
public CustomerStorageAccount ActiveStorageAccount { get; set; }
741741
}
742742

743+
/// <summary>
744+
/// Azure Site Recovery Protection Profile HyperVReplicaProviderSettings.
745+
/// </summary>
746+
[SuppressMessage(
747+
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
748+
"SA1402:FileMayOnlyContainASingleClass",
749+
Justification = "Keeping all related objects together.")]
750+
public class HyperVReplicaProviderSettings
751+
{
752+
/// <summary>
753+
/// Initializes a new instance of the <see cref="HyperVReplicaProviderSettings" /> class.
754+
/// </summary>
755+
public HyperVReplicaProviderSettings()
756+
{
757+
}
758+
759+
#region Properties
760+
761+
/// <summary>
762+
/// Gets or sets Replication Method.
763+
/// </summary>
764+
public string ReplicationMethod { get; set; }
765+
766+
/// <summary>
767+
/// Gets or sets a value indicating whether profile can be dissociated or not.
768+
/// </summary>
769+
public bool CanDissociate { get; set; }
770+
771+
/// <summary>
772+
/// Gets or sets Association Details.
773+
/// </summary>
774+
public List<ASRProtectionProfileAssociationDetails> AssociationDetail { get; set; }
775+
776+
/// <summary>
777+
/// Gets or sets Replication Frequency in seconds.
778+
/// </summary>
779+
public int ReplicationFrequencyInSeconds { get; set; }
780+
781+
/// <summary>
782+
/// Gets or sets Recovery Points.
783+
/// </summary>
784+
public int RecoveryPoints { get; set; }
785+
786+
/// <summary>
787+
/// Gets or sets Application Consistent Snapshot Frequency in hours.
788+
/// </summary>
789+
public int ApplicationConsistentSnapshotFrequencyInHours { get; set; }
790+
791+
/// <summary>
792+
/// Gets or sets a value indicating whether Compression is Enabled.
793+
/// </summary>
794+
public bool CompressionEnabled { get; set; }
795+
796+
/// <summary>
797+
/// Gets or sets the replication port.
798+
/// </summary>
799+
public int ReplicationPort { get; set; }
800+
801+
/// <summary>
802+
/// Gets or sets Replication Start Time.
803+
/// </summary>
804+
public TimeSpan? ReplicationStartTime { get; set; }
805+
806+
/// <summary>
807+
/// Gets or sets a value indicating whether Replica Deletion should be enabled.
808+
/// </summary>
809+
public bool AllowReplicaDeletion { get; set; }
810+
811+
#endregion
812+
}
813+
814+
/// <summary>
815+
/// Azure Site Recovery Protection Profile HyperVReplicaAzureProviderSettings.
816+
/// </summary>
817+
[SuppressMessage(
818+
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
819+
"SA1402:FileMayOnlyContainASingleClass",
820+
Justification = "Keeping all related objects together.")]
821+
public class HyperVReplicaAzureProviderSettings
822+
{
823+
/// <summary>
824+
/// Initializes a new instance of the <see cref="HyperVReplicaAzureProviderSettings" /> class.
825+
/// </summary>
826+
public HyperVReplicaAzureProviderSettings()
827+
{
828+
}
829+
830+
#region Properties
831+
832+
/// <summary>
833+
/// Gets or sets Replication Method.
834+
/// </summary>
835+
public string ReplicationMethod { get; set; }
836+
837+
/// <summary>
838+
/// Gets or sets a value indicating whether profile can be dissociated or not.
839+
/// </summary>
840+
public bool CanDissociate { get; set; }
841+
842+
/// <summary>
843+
/// Gets or sets Association Details.
844+
/// </summary>
845+
public List<ASRProtectionProfileAssociationDetails> AssociationDetail { get; set; }
846+
847+
/// <summary>
848+
/// Gets or sets Recovery Azure Subscription.
849+
/// </summary>
850+
public string RecoveryAzureSubscription { get; set; }
851+
852+
/// <summary>
853+
/// Gets or sets Recovery Azure Storage Account Name.
854+
/// </summary>
855+
public string RecoveryAzureStorageAccountName { get; set; }
856+
857+
/// <summary>
858+
/// Gets or sets Replication Frequency in seconds.
859+
/// </summary>
860+
public int ReplicationFrequencyInSeconds { get; set; }
861+
862+
/// <summary>
863+
/// Gets or sets Recovery Points.
864+
/// </summary>
865+
public int RecoveryPoints { get; set; }
866+
867+
/// <summary>
868+
/// Gets or sets Application Consistent Snapshot Frequency in hours.
869+
/// </summary>
870+
public int ApplicationConsistentSnapshotFrequencyInHours { get; set; }
871+
872+
/// <summary>
873+
/// Gets or sets a value indicating whether Compression is Enabled.
874+
/// </summary>
875+
public bool CompressionEnabled { get; set; }
876+
877+
/// <summary>
878+
/// Gets or sets the replication port.
879+
/// </summary>
880+
public int ReplicationPort { get; set; }
881+
882+
/// <summary>
883+
/// Gets or sets Replication Start Time.
884+
/// </summary>
885+
public TimeSpan? ReplicationStartTime { get; set; }
886+
887+
/// <summary>
888+
/// Gets or sets a value indicating whether Replica Deletion should be enabled.
889+
/// </summary>
890+
public bool AllowReplicaDeletion { get; set; }
891+
892+
#endregion
893+
}
894+
743895
/// <summary>
744896
/// This is the class which defines the Azure VM failover input.
745897
/// </summary>

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/lib/PSObjects.cs

Lines changed: 2 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,12 @@ public ASRProtectionContainer(ProtectionContainer pc)
300300

301301
if (profile.ReplicationProvider == Constants.HyperVReplicaAzure)
302302
{
303+
asrProtectionProfile.HyperVReplicaAzureProviderSettingsObject = new HyperVReplicaAzureProviderSettings();
303304
asrProtectionProfile.HyperVReplicaAzureProviderSettingsObject.AssociationDetail = new List<ASRProtectionProfileAssociationDetails>();
304305
}
305306
else if (profile.ReplicationProvider == Constants.HyperVReplica)
306307
{
308+
asrProtectionProfile.HyperVReplicaProviderSettingsObject = new HyperVReplicaProviderSettings();
307309
asrProtectionProfile.HyperVReplicaProviderSettingsObject.AssociationDetail = new List<ASRProtectionProfileAssociationDetails>();
308310
}
309311

@@ -523,158 +525,6 @@ public ASRProtectionProfile(ProtectionProfile protectionProfile)
523525
#endregion Properties
524526
}
525527

526-
/// <summary>
527-
/// Azure Site Recovery Protection Profile HyperVReplicaProviderSettings.
528-
/// </summary>
529-
[SuppressMessage(
530-
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
531-
"SA1402:FileMayOnlyContainASingleClass",
532-
Justification = "Keeping all related objects together.")]
533-
public class HyperVReplicaProviderSettings
534-
{
535-
/// <summary>
536-
/// Initializes a new instance of the <see cref="HyperVReplicaProviderSettings" /> class.
537-
/// </summary>
538-
public HyperVReplicaProviderSettings()
539-
{
540-
}
541-
542-
#region Properties
543-
544-
/// <summary>
545-
/// Gets or sets Replication Method.
546-
/// </summary>
547-
public string ReplicationMethod { get; set; }
548-
549-
/// <summary>
550-
/// Gets or sets a value indicating whether profile can be dissociated or not.
551-
/// </summary>
552-
public bool CanDissociate { get; set; }
553-
554-
/// <summary>
555-
/// Gets or sets Association Details.
556-
/// </summary>
557-
public List<ASRProtectionProfileAssociationDetails> AssociationDetail { get; set; }
558-
559-
/// <summary>
560-
/// Gets or sets Replication Frequency in seconds.
561-
/// </summary>
562-
public int ReplicationFrequencyInSeconds { get; set; }
563-
564-
/// <summary>
565-
/// Gets or sets Recovery Points.
566-
/// </summary>
567-
public int RecoveryPoints { get; set; }
568-
569-
/// <summary>
570-
/// Gets or sets Application Consistent Snapshot Frequency in hours.
571-
/// </summary>
572-
public int ApplicationConsistentSnapshotFrequencyInHours { get; set; }
573-
574-
/// <summary>
575-
/// Gets or sets a value indicating whether Compression is Enabled.
576-
/// </summary>
577-
public bool CompressionEnabled { get; set; }
578-
579-
/// <summary>
580-
/// Gets or sets the replication port.
581-
/// </summary>
582-
public int ReplicationPort { get; set; }
583-
584-
/// <summary>
585-
/// Gets or sets Replication Start Time.
586-
/// </summary>
587-
public TimeSpan? ReplicationStartTime { get; set; }
588-
589-
/// <summary>
590-
/// Gets or sets a value indicating whether Replica Deletion should be enabled.
591-
/// </summary>
592-
public bool AllowReplicaDeletion { get; set; }
593-
594-
#endregion
595-
}
596-
597-
/// <summary>
598-
/// Azure Site Recovery Protection Profile HyperVReplicaAzureProviderSettings.
599-
/// </summary>
600-
[SuppressMessage(
601-
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
602-
"SA1402:FileMayOnlyContainASingleClass",
603-
Justification = "Keeping all related objects together.")]
604-
public class HyperVReplicaAzureProviderSettings
605-
{
606-
/// <summary>
607-
/// Initializes a new instance of the <see cref="HyperVReplicaAzureProviderSettings" /> class.
608-
/// </summary>
609-
public HyperVReplicaAzureProviderSettings()
610-
{
611-
}
612-
613-
#region Properties
614-
615-
/// <summary>
616-
/// Gets or sets Replication Method.
617-
/// </summary>
618-
public string ReplicationMethod { get; set; }
619-
620-
/// <summary>
621-
/// Gets or sets a value indicating whether profile can be dissociated or not.
622-
/// </summary>
623-
public bool CanDissociate { get; set; }
624-
625-
/// <summary>
626-
/// Gets or sets Association Details.
627-
/// </summary>
628-
public List<ASRProtectionProfileAssociationDetails> AssociationDetail { get; set; }
629-
630-
/// <summary>
631-
/// Gets or sets Recovery Azure Subscription.
632-
/// </summary>
633-
public string RecoveryAzureSubscription { get; set; }
634-
635-
/// <summary>
636-
/// Gets or sets Recovery Azure Storage Account Name.
637-
/// </summary>
638-
public string RecoveryAzureStorageAccountName { get; set; }
639-
640-
/// <summary>
641-
/// Gets or sets Replication Frequency in seconds.
642-
/// </summary>
643-
public int ReplicationFrequencyInSeconds { get; set; }
644-
645-
/// <summary>
646-
/// Gets or sets Recovery Points.
647-
/// </summary>
648-
public int RecoveryPoints { get; set; }
649-
650-
/// <summary>
651-
/// Gets or sets Application Consistent Snapshot Frequency in hours.
652-
/// </summary>
653-
public int ApplicationConsistentSnapshotFrequencyInHours { get; set; }
654-
655-
/// <summary>
656-
/// Gets or sets a value indicating whether Compression is Enabled.
657-
/// </summary>
658-
public bool CompressionEnabled { get; set; }
659-
660-
/// <summary>
661-
/// Gets or sets the replication port.
662-
/// </summary>
663-
public int ReplicationPort { get; set; }
664-
665-
/// <summary>
666-
/// Gets or sets Replication Start Time.
667-
/// </summary>
668-
public TimeSpan? ReplicationStartTime { get; set; }
669-
670-
/// <summary>
671-
/// Gets or sets a value indicating whether Replica Deletion should be enabled.
672-
/// </summary>
673-
public bool AllowReplicaDeletion { get; set; }
674-
675-
#endregion
676-
}
677-
678528
/// <summary>
679529
/// Azure Site Recovery Virtual Machine.
680530
/// </summary>

0 commit comments

Comments
 (0)