Skip to content

Recovery Services Backup Documentation Fixes #2270

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

Merged
merged 23 commits into from
May 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5554791
[RS Backup] Fixing 7349803 (documentation fixes) for Backup in Cmdlet…
May 10, 2016
2533568
Merge branch 'dev1' into anudeeb-dev1
May 12, 2016
a052122
[RS Backup] Fixing 7349803 (documentation fixes) for Container in Cmd…
May 13, 2016
21856fc
[RS Backup] Fixing 7349803 (documentation fixes) for Item in Cmdlet L…
May 13, 2016
2183e6a
[RS Backup] Fixing 7349803 (documentation fixes) for Job in Cmdlet Layer
May 13, 2016
08e83ee
[RS Backup] Fixing 7349803 (documentation fixes) for Policy in Cmdlet…
May 16, 2016
21b3b91
[RS Backup] Fixing 7349803 (documentation fixes) for Recovery Point a…
May 16, 2016
1a1941b
[RS Backup] Fixing 7349803 (documentation fixes) for common files in …
May 16, 2016
7b238d3
[RS Backup] Fixing 7349803 (documentation fixes) for some files in He…
May 16, 2016
885d31b
[RS Backup] Fixing 7349803 (documentation fixes) for some files in Lo…
May 16, 2016
67e5576
[RS Backup] Fixing 7349803 (documentation fixes) for Azure VM in Mode…
May 16, 2016
c8891f8
[RS Backup] Fixing 7349803 (documentation fixes) for common files in …
May 16, 2016
a097f1f
[RS Backup] Fixing 7349803 (documentation fixes) for DPM, MAB and com…
May 16, 2016
c8676c5
Merge pull request #328 from MabOneSdk/anudeeb-dev1
May 16, 2016
bbcd46e
Correction according the code review
May 16, 2016
c469de1
Merge branch 'dev1' into anudeeb-dev1
May 16, 2016
8ebbb6f
[RS Backup] Fixing 7349803 (documentation fixes) in Provider Layer
May 16, 2016
646fd54
[RS Backup] Fixing 7349803 (documentation fixes) in Service Client Ad…
May 17, 2016
f43ba56
Merge pull request #329 from MabOneSdk/anudeeb-dev1
May 17, 2016
50245de
Merge branch 'dev1' into anudeeb-dev1
May 17, 2016
583d0b7
Merge branch 'release' into dev1
May 17, 2016
7d32d67
Merge branch 'dev1' into anudeeb-dev1
May 19, 2016
5f686f1
Merge pull request #330 from MabOneSdk/anudeeb-dev1
May 19, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static void AddServiceClientJobsToPSList(JobListResponse serviceClientJob
#region AzureVm job private helpers

/// <summary>
/// Helper function to convert ps auzre vm backup policy job from service response.
/// Helper function to convert ps azure vm backup policy job from service response.
/// </summary>
private static CmdletModel.AzureVmJob GetPSAzureVmJob(JobResource serviceClientJob)
{
Expand Down Expand Up @@ -154,7 +154,7 @@ private static CmdletModel.AzureVmJob GetPSAzureVmJob(JobResource serviceClientJ
}

/// <summary>
/// Helper function to convert ps auzre vm backup job error info from service response.
/// Helper function to convert ps azure vm backup job error info from service response.
/// </summary>
private static CmdletModel.AzureVmJobErrorInfo GetPSAzureVmErrorInfo(AzureIaaSVMErrorInfo serviceClientError)
{
Expand Down Expand Up @@ -187,7 +187,7 @@ public static string GetLastIdFromFullId(string fullId)


/// <summary>
/// Helper function to get job type from ps backupmanagement type.
/// Helper function to get job type from ps backup management type.
/// </summary>
public static string GetJobTypeForService(CmdletModel.BackupManagementType mgmtType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static List<DateTime> ParseDateTimesToUTC(IList<DateTime> localTimes)
}

// <summary>
/// Helper function to convert service simple schedule policy from ps scheduel policy.
/// Helper function to convert service simple schedule policy from ps schedule policy.
/// </summary>
public static ServiceClientModel.SimpleSchedulePolicy GetServiceClientSimpleSchedulePolicy(
SimpleSchedulePolicy psPolicy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,18 @@

namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers
{
/// <summary>
/// Utilities used by the helpers.
/// </summary>
public class HelperUtils
{
/// <summary>
/// Gets list of enums of type T given the corresponding list of string equivalents.
/// This method parses each of the strings and converts them into enums.
/// </summary>
/// <typeparam name="T">Type of the enum into which each string in the input list is to be type casted</typeparam>
/// <param name="strList">List of strings</param>
/// <returns></returns>
public static List<T> GetEnumListFromStringList<T>(IList<string> strList)
{
if (strList == null || strList.Count == 0)
Expand All @@ -41,6 +51,12 @@ public static List<T> GetEnumListFromStringList<T>(IList<string> strList)
return ret;
}

/// <summary>
/// Gets list of string equivalents given the corresponding list of enums of type T.
/// </summary>
/// <typeparam name="T">Type of the enum whose list should be converted to list of strings</typeparam>
/// <param name="enumList">List of enums</param>
/// <returns></returns>
public static List<string> GetStringListFromEnumList<T>(IList<T> enumList)
{
if (enumList == null || enumList.Count == 0)
Expand Down Expand Up @@ -97,6 +113,12 @@ public static List<string> GetStringListFromEnumList<T>(IList<T> enumList)
return keyValuePairDict;
}

/// <summary>
/// Gets container URI from the provided dictionary of key value pairs.
/// </summary>
/// <param name="keyValuePairDict">Dictionary of UriEnum as key and value as value of corresponding URI enum</param>
/// <param name="id">ID of the resource</param>
/// <returns></returns>
public static string GetContainerUri(
Dictionary<CmdletModel.UriEnums, string> keyValuePairDict,
string id
Expand All @@ -116,6 +138,12 @@ string id
return containerUri;
}

/// <summary>
/// Gets protected item URI from the provided dictionary of key value pairs.
/// </summary>
/// <param name="keyValuePairDict">Dictionary of UriEnum as key and value as value of corresponding URI enum</param>
/// <param name="id">ID of the resource</param>
/// <returns></returns>
public static string GetProtectedItemUri(
Dictionary<CmdletModel.UriEnums, string> keyValuePairDict,
string id
Expand All @@ -135,6 +163,12 @@ string id
return itemUri;
}

/// <summary>
/// Gets protectable item URI from the provided dictionary of key value pairs.
/// </summary>
/// <param name="keyValuePairDict">Dictionary of UriEnum as key and value as value of corresponding URI enum</param>
/// <param name="id">ID of the resource</param>
/// <returns></returns>
public static string GetProtectableItemUri(
Dictionary<CmdletModel.UriEnums, string> keyValuePairDict,
string id
Expand All @@ -154,6 +188,12 @@ string id
return protectableItemUri;
}

/// <summary>
/// Gets polcy name from the provided dictionary of key value pairs.
/// </summary>
/// <param name="keyValuePairDict">Dictionary of UriEnum as key and value as value of corresponding URI enum</param>
/// <param name="id">ID of the resource</param>
/// <returns></returns>
public static string GetPolicyNameFromPolicyId(
Dictionary<CmdletModel.UriEnums, string> keyValuePairDict,
string id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,25 @@

namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers
{
/// <summary>
/// Constants used by the service client helpers.
/// </summary>
public class ServiceClientConstants
{
public const string SkipToken = "skipToken";
}

/// <summary>
/// Helper methods used by the service client adapter.
/// </summary>
public class ServiceClientHelpers
{
/// <summary>
/// Gets the provider type with which the service client calls are to made to contact the backend service.
/// This can be determined by the container type in case of certain containers such as those of the type AzureVM.
/// </summary>
/// <param name="containerType">Type of the container</param>
/// <returns></returns>
public static string GetServiceClientProviderType(CmdletModel.ContainerType containerType)
{
string providerType = string.Empty;
Expand All @@ -43,6 +55,12 @@ public static string GetServiceClientProviderType(CmdletModel.ContainerType cont
return providerType;
}

/// <summary>
/// Gets the provider type with which the service client calls are to made to contact the backend service.
/// This is determined by the workload type in case of certain containers such as those of the type AzureVM.
/// </summary>
/// <param name="workloadType"></param>
/// <returns></returns>
public static string GetServiceClientProviderType(CmdletModel.WorkloadType workloadType)
{
string providerType = string.Empty;
Expand All @@ -59,6 +77,13 @@ public static string GetServiceClientProviderType(CmdletModel.WorkloadType workl
return providerType;
}

/// <summary>
/// Gets the skip token from the next link. Usually, next link is the location uri returned as a header
/// when an ARM call is made. When this skip token (if non-null) is used in the next call to the backend service,
/// the next set of objects are returned.
/// </summary>
/// <param name="nextLink">The next link a.k.a location url</param>
/// <param name="skipToken">The skip token extracted from the next link</param>
public static void GetSkipTokenFromNextLink(string nextLink, out string skipToken)
{
if (nextLink != null)
Expand Down Expand Up @@ -98,6 +123,11 @@ public static string GetLastIdFromFullId(string fullId)
return splitArr[splitArr.Length - 1];
}

/// <summary>
/// Gets the service client specific container type given the PS container type
/// </summary>
/// <param name="containerType">PS container type</param>
/// <returns></returns>
public static string GetServiceClientContainerType(CmdletModel.ContainerType containerType)
{
string serviceClientContainerType = string.Empty;
Expand All @@ -114,6 +144,11 @@ public static string GetServiceClientContainerType(CmdletModel.ContainerType con
return serviceClientContainerType;
}

/// <summary>
/// Gets the service client specific workload type given the PS workload type
/// </summary>
/// <param name="workloadType"></param>
/// <returns></returns>
public static string GetServiceClientWorkloadType(CmdletModel.WorkloadType workloadType)
{
string serviceClientWorkloadType = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers
{
/// <summary>
/// Backup policy validation helpers.
/// </summary>
public partial class PolicyHelpers
{
// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

namespace Microsoft.Azure.Commands.RecoveryServices.Backup
{
/// <summary>
/// Utility for logging. Uses PS logging underneath.
/// Plan to add more functionality in the upcoming releases.
/// </summary>
public class Logger
{
private Action<string> writeWarningAction;
Expand All @@ -33,6 +37,13 @@ public class Logger

public static Logger Instance { get; set; }

/// <summary>
/// Constructor. Takes the delegates for the various logging operations as input.
/// </summary>
/// <param name="writeWarning">Delegate to write warnings</param>
/// <param name="writeDebug">Delegate to write debug messages</param>
/// <param name="writeVerbose">Delegate to write verbose messages</param>
/// <param name="throwTerminatingError">Delegate to throw terminating errors</param>
public Logger(Action<string> writeWarning,
Action<string> writeDebug,
Action<string> writeVerbose,
Expand All @@ -44,21 +55,37 @@ public Logger(Action<string> writeWarning,
throwTerminatingErrorAction = throwTerminatingError;
}

/// <summary>
/// Writes verbose message.
/// </summary>
/// <param name="text"></param>
public void WriteVerbose(string text)
{
writeVerboseAction(text);
}

/// <summary>
/// Writes debug message.
/// </summary>
/// <param name="text"></param>
public void WriteDebug(string text)
{
writeDebugAction(text);
}

/// <summary>
/// Writes warning message.
/// </summary>
/// <param name="text"></param>
public void WriteWarning(string text)
{
writeWarningAction(text);
}

/// <summary>
/// Throws a terminating error.
/// </summary>
/// <param name="errorRecord"></param>
public void ThrowTerminatingError(ErrorRecord errorRecord)
{
throwTerminatingErrorAction(errorRecord);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public class AzureVmContainer : ContainerBase
/// </summary>
public ContainerRegistrationStatus Status { get; set; }

/// <summary>
/// Constructor. Takes the service client object representing the container
/// and converts it in to the PS container model
/// </summary>
/// <param name="protectionContainer">Service client object representing the container</param>
public AzureVmContainer(ProtectionContainerResource protectionContainer)
: base(protectionContainer)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ public class AzureVmItem : ItemBase
/// </summary
public AzureVmItemExtendedInfo ExtendedInfo { get; set; }

/// <summary>
/// Constructor. Takes the service client object representing the protected item
/// and converts it in to the PS protected item model
/// </summary>
/// <param name="protectedItemResource">Service client object representing the protected item resource</param>
/// <param name="containerName">Name of the container associated with this protected item</param>
/// <param name="containerType">Type of the container associated with this protected item</param>
/// <param name="policyName">Name of the protection policy associated with this protected item</param>
public AzureVmItem(ProtectedItemResource protectedItemResource,
string containerName, ContainerType containerType, string policyName)
: base(protectedItemResource, containerName, containerType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,24 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models
/// </summary>
public class AzureVmJob : JobBase
{
/// <summary>
/// Represents whether this job is cancellable.
/// </summary>
public bool IsCancellable { get; set; }

/// <summary>
/// Represents whether this job is retriable.
/// </summary>
public bool IsRetriable { get; set; }

/// <summary>
/// The VM version of the Azure VM associated with this job.
/// </summary>
public string VmVersion { get; set; }

/// <summary>
/// Error details associated with this job.
/// </summary>
public List<AzureVmJobErrorInfo> ErrorDetails { get; set; }
}

Expand All @@ -41,8 +53,14 @@ public class AzureVmJobDetails : AzureVmJob
/// </summary>
public string DynamicErrorMessage { get; set; }

/// <summary>
/// Property bag consisting of the some Azure VM specific job details.
/// </summary>
public Dictionary<string, string> Properties { get; set; }

/// <summary>
/// List of sub tasks triggered as part of this job's operation.
/// </summary>
public List<AzureVmJobSubTask> SubTasks { get; set; }
}

Expand All @@ -51,6 +69,9 @@ public class AzureVmJobDetails : AzureVmJob
/// </summary>
public class AzureVmJobErrorInfo : JobErrorInfoBase
{
/// <summary>
/// Error code of this job's error.
/// </summary>
public int ErrorCode { get; set; }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models
/// </summary>
public class AzureVmPolicy : PolicyBase
{
/// <summary>
/// Object defining the schedule associated with this policy.
/// </summary>
public SchedulePolicyBase SchedulePolicy { get; set; }

/// <summary>
/// Object defining the retention behavior of this policy.
/// </summary>
public RetentionPolicyBase RetentionPolicy { get; set; }

public override void Validate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models
/// </summary>
public class AzureVmRecoveryPoint : RecoveryPointBase
{
/// <summary>
/// Additional info associated with this recovery point serialized into a string.
/// </summary>
public string RecoveryPointAdditionalInfo { get; set; }

/// <summary>
/// Storage type of the VM whose backup operation has created this recovery point.
/// </summary>
public string SourceVMStorageType { get; set; }

public AzureVmRecoveryPoint()
Expand Down
Loading