Represents Azure Backup Container
Inheritance: AzureRMBackupContainerContextObject
Exemplo n.º 1
0
 public AzureRMBackupItem(CSMItemResponse pPOItem, AzureRMBackupContainer azureBackupContainer)
     : base(pPOItem, azureBackupContainer)
 {
     ProtectionStatus = pPOItem.Properties.Status;
     ItemName = pPOItem.Name;
     Name = pPOItem.Properties.FriendlyName;
     Type = ItemHelpers.GetTypeForItem(pPOItem.Properties.ItemType);
 }
Exemplo n.º 2
0
 public AzureRMBackupItem(CSMItemResponse pPOItem, AzureRMBackupContainer azureBackupContainer)
     : base(pPOItem, azureBackupContainer)
 {
     ProtectionStatus = pPOItem.Properties.Status;
     ItemName         = pPOItem.Name;
     Name             = pPOItem.Properties.FriendlyName;
     Type             = ItemHelpers.GetTypeForItem(pPOItem.Properties.ItemType);
 }
Exemplo n.º 3
0
        public AzureRMBackupItem(CSMProtectedItemResponse datasource, AzureRMBackupContainer azureBackupContainer)
            : base(datasource, azureBackupContainer)
        {
            DataSourceStatus = datasource.Properties.ProtectionStatus;
            ProtectionStatus = datasource.Properties.Status;
            ItemName = datasource.Name;
            Name = datasource.Properties.FriendlyName;

            if (datasource.Properties.ProtectionPolicyId != null)
            {
                ProtectionPolicyName = datasource.Properties.ProtectionPolicyId.Split('/').Last();
            }

            ProtectionPolicyId = datasource.Properties.ProtectionPolicyId;
            RecoveryPointsCount = datasource.Properties.RecoveryPointsCount;
            Type = ItemHelpers.GetTypeForItem(datasource.Properties.ItemType);
        }
Exemplo n.º 4
0
        public AzureRMBackupItem(CSMProtectedItemResponse datasource, AzureRMBackupContainer azureBackupContainer)
            : base(datasource, azureBackupContainer)
        {
            DataSourceStatus = datasource.Properties.ProtectionStatus;
            ProtectionStatus = datasource.Properties.Status;
            ItemName         = datasource.Name;
            Name             = datasource.Properties.FriendlyName;

            if (datasource.Properties.ProtectionPolicyId != null)
            {
                ProtectionPolicyName = datasource.Properties.ProtectionPolicyId.Split('/').Last();
            }

            ProtectionPolicyId  = datasource.Properties.ProtectionPolicyId;
            RecoveryPointsCount = datasource.Properties.RecoveryPointsCount;
            Type = ItemHelpers.GetTypeForItem(datasource.Properties.ItemType);
        }
 public AzureRMBackupContainerContextObject(AzureRMBackupContainer azureBackupContainer)
     : base(azureBackupContainer.ResourceGroupName, azureBackupContainer.ResourceName, azureBackupContainer.Location)
 {
     ContainerType = azureBackupContainer.ContainerType;
     ContainerUniqueName = azureBackupContainer.ContainerUniqueName;
 }
 public AzureRMBackupItemContextObject(CSMItemResponse item, AzureRMBackupContainer azureBackupContainer)
     : base(azureBackupContainer)
 {
     ItemName = item.Name;
 }
        public void WriteAzureBackupItem(List<CSMProtectedItemResponse> sourceDataSourceList, List<CSMItemResponse> sourcePOList, AzureRMBackupContainer azureBackupContainer)
        {
            List<AzureRMBackupItem> targetList = new List<AzureRMBackupItem>();

            if (sourceDataSourceList != null)
            {
                foreach (var item in sourceDataSourceList)
                {
                    targetList.Add(new AzureRMBackupItem(item, azureBackupContainer));
                }
            }

            if (sourcePOList != null)
            {
                foreach (var item in sourcePOList)
                {
                    //If user has stopped protection for some datasoure then we will have duplicate items(po and ds).
                    //So in this case removing  po items from the list.
                    if (targetList.FindIndex(element => element.ItemName == item.Name) < 0)
                    {
                        targetList.Add(new AzureRMBackupItem(item, azureBackupContainer));
                    }
                }
            }

            if (targetList.Count() == 1)
            {
                this.WriteObject(targetList.First(), true);
            }
            else
            {
                this.WriteObject(targetList, true);
            }
        }
 public void WriteAzureBackupItem(CSMProtectedItemResponse sourceItem, AzureRMBackupContainer azureBackupItem)
 {
     this.WriteObject(new AzureRMBackupItem(sourceItem, azureBackupItem));
 }
 public AzureRMBackupContainerContextObject(AzureRMBackupContainer azureBackupContainer)
     : base(azureBackupContainer.ResourceGroupName, azureBackupContainer.ResourceName, azureBackupContainer.Location)
 {
     ContainerType       = azureBackupContainer.ContainerType;
     ContainerUniqueName = azureBackupContainer.ContainerUniqueName;
 }
 public AzureRMBackupItemContextObject(CSMItemResponse item, AzureRMBackupContainer azureBackupContainer)
     : base(azureBackupContainer)
 {
     ItemName = item.Name;
 }