-
Notifications
You must be signed in to change notification settings - Fork 2
[REBASE] afs enable protection #361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,39 +18,14 @@ | |
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models | ||
{ | ||
/// <summary> | ||
/// Azure File Share Item Class | ||
/// Azure files Item Class | ||
/// </summary> | ||
public class AzureFileShareItem : ItemBase | ||
public class AzureFileShareItem : AzureItem | ||
{ | ||
/// <summary> | ||
/// Protection Status of the item | ||
/// Container id of item | ||
/// </summary> | ||
public ItemProtectionStatus ProtectionStatus { get; set; } | ||
|
||
/// <summary> | ||
/// Protection State of the item | ||
/// </summary> | ||
public ItemProtectionState ProtectionState { get; set; } | ||
|
||
/// <summary> | ||
/// Last Backup Status for the item | ||
/// </summary> | ||
public string LastBackupStatus { get; set; } | ||
|
||
/// <summary> | ||
/// Last Backup Time for the item | ||
/// </summary> | ||
public DateTime? LastBackupTime { get; set; } | ||
|
||
/// <summary> | ||
/// Protection Policy Name for the Item | ||
/// </summary> | ||
public string ProtectionPolicyName { get; set; } | ||
|
||
/// <summary> | ||
/// ExtendedInfo for the Item | ||
/// </summary | ||
public AzureFileShareItemExtendedInfo ExtendedInfo { get; set; } | ||
public string ParentContainerFabricId { get; set; } | ||
|
||
/// <summary> | ||
/// Constructor. Takes the service client object representing the protected item | ||
|
@@ -62,12 +37,11 @@ public class AzureFileShareItem : ItemBase | |
/// <param name="policyName">Name of the protection policy associated with this protected item</param> | ||
public AzureFileShareItem(ProtectedItemResource protectedItemResource, | ||
string containerName, ContainerType containerType, string policyName) | ||
: base(protectedItemResource, containerName, containerType) | ||
: base(protectedItemResource, containerName, containerType, policyName) | ||
{ | ||
AzureFileshareProtectedItem protectedItem = (AzureFileshareProtectedItem)protectedItemResource.Properties; | ||
LastBackupStatus = protectedItem.LastBackupStatus; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move the initialization for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. workload specific properties, can't move it to base class |
||
LastBackupTime = protectedItem.LastBackupTime; | ||
ProtectionPolicyName = policyName; | ||
ProtectionState = | ||
EnumUtils.GetEnum<ItemProtectionState>(protectedItem.ProtectionState.ToString()); | ||
ProtectionStatus = EnumUtils.GetEnum<ItemProtectionStatus>(protectedItem.ProtectionStatus); | ||
|
@@ -77,21 +51,6 @@ public AzureFileShareItem(ProtectedItemResource protectedItemResource, | |
/// <summary> | ||
/// Azure File Share Item ExtendedInfo Class | ||
/// </summary> | ||
public class AzureFileShareItemExtendedInfo : ItemExtendedInfoBase | ||
{ | ||
/// <summary> | ||
/// Oldest Recovery Point for the Item | ||
/// </summary | ||
public DateTime? OldestRecoveryPoint { get; set; } | ||
|
||
/// <summary> | ||
/// Recovery Points Count for the Item | ||
/// </summary | ||
public int RecoveryPointCount { get; set; } | ||
|
||
/// <summary> | ||
/// PolicyState for the Item | ||
/// </summary | ||
public string PolicyState { get; set; } | ||
} | ||
public class AzureFileShareExtendedInfo : AzureItemExtendedInfo | ||
{ } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
|
||
using System; | ||
using Microsoft.Azure.Management.RecoveryServices.Backup.Models; | ||
|
||
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models | ||
{ | ||
/// <summary> | ||
/// Base class for Azure items(AzureVM, AzureFiles) | ||
/// </summary> | ||
public class AzureItem : ItemBase | ||
{ | ||
/// <summary> | ||
/// Protection Status of the item | ||
/// </summary> | ||
public ItemProtectionStatus ProtectionStatus { get; set; } | ||
|
||
/// <summary> | ||
/// Protection State of the item | ||
/// </summary> | ||
public ItemProtectionState ProtectionState { get; set; } | ||
|
||
/// <summary> | ||
/// Last Backup Status for the item | ||
/// </summary> | ||
public string LastBackupStatus { get; set; } | ||
|
||
/// <summary> | ||
/// Last Backup Time for the item | ||
/// </summary> | ||
public DateTime? LastBackupTime { get; set; } | ||
|
||
/// <summary> | ||
/// Protection Policy Name for the Item | ||
/// </summary> | ||
public string ProtectionPolicyName { get; set; } | ||
|
||
/// <summary> | ||
/// ExtendedInfo for the Item | ||
/// </summary | ||
public AzureItemExtendedInfo ExtendedInfo { get; set; } | ||
|
||
public AzureItem(ProtectedItemResource protectedItemResource, | ||
string containerName, ContainerType containerType, string policyName) | ||
: base(protectedItemResource, containerName, containerType) | ||
{ | ||
ProtectionPolicyName = policyName; | ||
} | ||
} | ||
public class AzureItemExtendedInfo : ItemExtendedInfoBase | ||
{ | ||
/// <summary> | ||
/// Oldest Recovery Point for the Item | ||
/// </summary | ||
public DateTime? OldestRecoveryPoint { get; set; } | ||
|
||
/// <summary> | ||
/// Recovery Points Count for the Item | ||
/// </summary | ||
public int RecoveryPointCount { get; set; } | ||
|
||
/// <summary> | ||
/// PolicyState for the Item | ||
/// </summary | ||
public string PolicyState { get; set; } | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method looks very similar to this method. Can you confirm why this is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its different, the second parameter is different ( RestAzureNS.AzureOperationResponse vs RestAzureNS.AzureOperationResponse)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closed