/// <summary>
 /// Writes Protection Entity.
 /// </summary>
 /// <param name="pe">Protection Entity</param>
 private void WriteProtectionEntity(ProtectionEntity pe)
 {
     this.WriteObject(new ASRProtectionEntity(pe));
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ASRProtectionEntity" /> class.
        /// </summary>
        /// <param name="pe">Protection entity object to read values from.</param>
        public ASRProtectionEntity(ProtectionEntity pe)
        {
            this.ID = pe.ID;
            this.ServerId = pe.ServerId;
            this.ProtectionContainerId = pe.ProtectionContainerId;
            this.Name = pe.Name;
            this.Type = pe.Type;
            this.FabricObjectId =
                (0 == string.Compare(this.Type, "VirtualMachine", StringComparison.OrdinalIgnoreCase)) ?
                pe.FabricObjectId.ToUpper() :
                pe.FabricObjectId;
            this.Protected = pe.Protected;
            this.ProtectionStateDescription = pe.ProtectionStateDescription;
            this.CanCommit = pe.CanCommit;
            this.CanFailover = pe.CanFailover;
            this.CanReverseReplicate = pe.CanReverseReplicate;
            this.ReplicationProvider = pe.ReplicationProvider;
            this.ActiveLocation = pe.ActiveLocation;
            this.ReplicationHealth = pe.ReplicationHealth;
            this.TestFailoverStateDescription = pe.TestFailoverStateDescription;

            if (!string.IsNullOrWhiteSpace(pe.ReplicationProviderSettings))
            {
                AzureVmDiskDetails diskDetails;
                DataContractUtils.Deserialize<AzureVmDiskDetails>(
                    pe.ReplicationProviderSettings, out diskDetails);

                this.Disks = diskDetails.Disks;
                this.OSDiskId = diskDetails.VHDId;
                this.OSDiskName = diskDetails.OsDisk;
                this.OS = diskDetails.OsType;
            }

            if (pe.ProtectionProfile != null &&
                !string.IsNullOrWhiteSpace(pe.ProtectionProfile.ID))
            {
                this.ProtectionProfile = new ASRProtectionProfile(pe.ProtectionProfile);
            }
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ASRProtectionEntity" /> class.
 /// </summary>
 /// <param name="pe">Protection entity object to read values from.</param>
 public ASRProtectionEntity(ProtectionEntity pe)
 {
     this.ID = pe.ID;
     this.ServerId = pe.ServerId;
     this.ProtectionContainerId = pe.ProtectionContainerId;
     this.Name = pe.Name;
     this.Type = pe.Type;
     this.FabricObjectId =
         (0 == string.Compare(this.Type, "VirtualMachine", StringComparison.OrdinalIgnoreCase)) ?
         pe.FabricObjectId.ToUpper() :
         pe.FabricObjectId;
     this.Protected = pe.Protected;
     this.ProtectionStateDescription = pe.ProtectionStateDescription;
     this.CanCommit = pe.CanCommit;
     this.CanFailover = pe.CanFailover;
     this.CanReverseReplicate = pe.CanReverseReplicate;
     this.ReplicationProvider = pe.ReplicationProvider;
     this.ActiveLocation = pe.ActiveLocation;
     this.ReplicationHealth = pe.ReplicationHealth;
     this.TestFailoverStateDescription = pe.TestFailoverStateDescription;
 }