Skip to content

Commit

Permalink
Fix Az.RecoveryServices XML Comments (#18666)
Browse files Browse the repository at this point in the history
* Fix Az.RecoveryServices XML Comments

* Fix Az.RecoveryServices XML Comments
  • Loading branch information
ziyuezh576 authored Jun 24, 2022
1 parent 6e5f46b commit f8a293b
Show file tree
Hide file tree
Showing 22 changed files with 79 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class AzureWorkloadProtectableItem : ProtectableItemBase
/// Constructor. Takes the service client object representing the protected item
/// and converts it in to the PS protected item model
/// </summary>
/// <param name="workloadProtectableItemResource"></param>
/// <param name="workloadProtectableItemResource">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>
public AzureWorkloadProtectableItem(WorkloadProtectableItemResource workloadProtectableItemResource,
Expand All @@ -111,7 +111,7 @@ public AzureWorkloadProtectableItem(WorkloadProtectableItemResource workloadProt
Subinquireditemcount = protectedItem.Subinquireditemcount;
Subprotectableitemcount = protectedItem.Subprotectableitemcount;
Prebackupvalidation = protectedItem.Prebackupvalidation;
ProtectableItemType = workloadProtectableItemResource.Properties.GetType().ToString();
ProtectableItemType = workloadProtectableItemResource.Properties.GetType().ToString();

if (workloadProtectableItemResource.Properties.GetType() == typeof(AzureVmWorkloadSQLAvailabilityGroupProtectableItem))
{
Expand All @@ -124,7 +124,7 @@ public AzureWorkloadProtectableItem(WorkloadProtectableItemResource workloadProt
else if (workloadProtectableItemResource.Properties.GetType() == typeof(AzureVmWorkloadSQLDatabaseProtectableItem))
{
ProtectableItemType = CmdletModel.ProtectableItemType.SQLDataBase.ToString();
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public List<SubProtectionPolicy> GetSubProtectionPolicyOfType(IList<SubProtectio
{
return newSubProtectionPolicies.Where(
newSubProtectionPolicy =>
{
{
return (newSubProtectionPolicy.PolicyType == policyType);
}).ToList();
}
Expand All @@ -546,8 +546,8 @@ public bool checkInstantRpRetentionRange(int? oldSnapshotRetention, int? newSnap
/// checks if daily retention is reduced first, then weekly, then monthly and then yearly; breaks and return true whenever it finds retention is reduced in any schedule.
/// if retention is not reduced in any schedule, returns false at the end.
/// </summary>
/// <param name="newRetentionPolicy"></param>
/// <param name="oldRetentionPolicy"></param>
/// <param name="newRetentionPolicy"></param>
/// <returns></returns>
public bool checkMUAForLongTermRetentionPolicy(ServiceClientModel.LongTermRetentionPolicy oldRetentionPolicy, ServiceClientModel.LongTermRetentionPolicy newRetentionPolicy)
{
Expand Down Expand Up @@ -578,7 +578,7 @@ public bool checkMUAForLongTermRetentionPolicy(ServiceClientModel.LongTermRetent
{
return true;
}
}
}

return false;
}
Expand All @@ -600,13 +600,13 @@ public bool checkMUAForSimpleRetentionPolicy(ServiceClientModel.SimpleRetentionP
/// <param name="newRetentionPolicy"></param>
/// <returns></returns>
public bool checkMUAForMSSQLPolicy(ServiceClientModel.AzureVmWorkloadProtectionPolicy oldRetentionPolicy, ServiceClientModel.AzureVmWorkloadProtectionPolicy newRetentionPolicy)
{
{
IList<SubProtectionPolicy> oldSubProtectionPolicies = oldRetentionPolicy.SubProtectionPolicy;
IList<SubProtectionPolicy> newSubProtectionPolicies = newRetentionPolicy.SubProtectionPolicy;

foreach (SubProtectionPolicy oldSubProtectionPolicy in oldSubProtectionPolicies)
{
string policyType = oldSubProtectionPolicy.PolicyType;
string policyType = oldSubProtectionPolicy.PolicyType;
List<SubProtectionPolicy> newSubProtectionPolicy = GetSubProtectionPolicyOfType(newSubProtectionPolicies, policyType);
if(newSubProtectionPolicy == null || newSubProtectionPolicy.Count == 0) return true;
else
Expand All @@ -616,7 +616,7 @@ public bool checkMUAForMSSQLPolicy(ServiceClientModel.AzureVmWorkloadProtectionP
if(checkMUAForSimpleRetentionPolicy((ServiceClientModel.SimpleRetentionPolicy)oldSubProtectionPolicy.RetentionPolicy, (ServiceClientModel.SimpleRetentionPolicy)newSubProtectionPolicy[0].RetentionPolicy))
{
return true;
}
}
}
else if (oldSubProtectionPolicy.RetentionPolicy.GetType() == typeof(ServiceClientModel.LongTermRetentionPolicy))
{
Expand Down Expand Up @@ -654,15 +654,15 @@ public bool checkMUAForRetentionPolicy(ProtectionPolicyResource oldPolicy, Prote
}

else if (newPolicy.Properties.GetType() == typeof(ServiceClientModel.AzureVmWorkloadProtectionPolicy))
{
{
return checkMUAForMSSQLPolicy((ServiceClientModel.AzureVmWorkloadProtectionPolicy)oldPolicy.Properties, (ServiceClientModel.AzureVmWorkloadProtectionPolicy)newPolicy.Properties);
}

return false;
}

public bool checkMUAForModifyPolicy(ProtectionPolicyResource oldPolicy, ProtectionPolicyResource newPolicy, bool enableMUA = false)
{
{
if( enableMUA && (checkMUAForSchedulePolicy(oldPolicy, newPolicy) || checkMUAForRetentionPolicy(oldPolicy, newPolicy)))
{
return true;
Expand Down Expand Up @@ -706,7 +706,7 @@ public void CopyScheduleTimeToRetentionTimes(CmdletModel.LongTermRetentionPolicy

// schedule runTimes is already validated if in UTC/not during validate()
// now copy times from schedule to retention policy

List<DateTime> hourlyWindowStartTime = (schPolicyV2.HourlySchedule != null) ? new List<DateTime>{(DateTime)schPolicyV2.HourlySchedule.WindowStartTime} : null;

if (retPolicy.IsDailyScheduleEnabled && retPolicy.DailySchedule != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public RestAzureNS.AzureOperationResponse<ProtectedItemResource> CreateOrUpdateP
customHeaders.Add("x-ms-authorization-auxiliary", new List<string> { "Bearer " + auxiliaryAccessToken });
}
else
{
{
throw new ArgumentException(String.Format(Resources.UnexpectedParameterToken, "ModifyProtection"));
}
}
Expand Down Expand Up @@ -116,33 +116,33 @@ public RestAzureNS.AzureOperationResponse DeleteProtectedItem(

string operationRequest = null;

// unlock
UnlockDeleteRequest unlockDeleteRequest = new UnlockDeleteRequest();
// unlock
UnlockDeleteRequest unlockDeleteRequest = new UnlockDeleteRequest();

List<ResourceGuardProxyBaseResource> resourceGuardMapping = ListResourceGuardMapping(vaultName, resourceGroupName);

if (resourceGuardMapping != null && resourceGuardMapping.Count != 0)
{
{
foreach (ResourceGuardOperationDetail operationDetail in resourceGuardMapping[0].Properties.ResourceGuardOperationDetails)
{
if (operationDetail.VaultCriticalOperation == "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/delete") operationRequest = operationDetail.DefaultResourceRequest;
}

if(operationRequest != null)
{
unlockDeleteRequest.ResourceGuardOperationRequests = new List<string>();
unlockDeleteRequest.ResourceGuardOperationRequests.Add(operationRequest);

if(protectedItemUri == null)
{
{
throw new ArgumentException(String.Format(Resources.ProtectedItemURICantBeNull));
}

unlockDeleteRequest.ResourceToBeDeleted = protectedItemUri;
UnlockDeleteResponse unlockDeleteResponse = BmsAdapter.Client.ResourceGuardProxy.UnlockDeleteWithHttpMessagesAsync(vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName(), resourceGuardMapping[0].Name, unlockDeleteRequest, customHeaders).Result.Body;
}
else if (auxiliaryAccessToken != null && auxiliaryAccessToken != "")
{
{
throw new ArgumentException(String.Format(Resources.UnexpectedParameterToken, "Delete protection with DeleteBackupData"));
}
}
Expand All @@ -156,7 +156,7 @@ public RestAzureNS.AzureOperationResponse DeleteProtectedItem(
resourceGroupName ?? BmsAdapter.GetResourceGroupName(),
AzureFabricName,
containerName,
protectedItemName,
protectedItemName,
cancellationToken: BmsAdapter.CmdletCancellationToken).Result;
}

Expand Down Expand Up @@ -231,7 +231,7 @@ public List<ProtectedItemResource> ListProtectedItem(
string skipToken = default(string),
string vaultName = null,
string resourceGroupName = null)
{
{
Func<RestAzureNS.IPage<CrrModel.ProtectedItemResource>> listAsync =
() => CrrAdapter.Client.BackupProtectedItemsCrr.ListWithHttpMessagesAsync(
vaultName ?? BmsAdapter.GetResourceName(),
Expand Down Expand Up @@ -383,7 +383,7 @@ public List<ProtectionIntentResource> ListProtectionIntent(
/// <summary>
/// Lists workload items according to the query filter and the pagination params
/// </summary>
/// <param name="containerName"></param>
/// <param name="containerName">Name of the container which this item belongs to</param>
/// <param name="queryFilter">Query filter</param>
/// <param name="skipToken">Skip token for pagination</param>
/// <param name="vaultName"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public RestAzureNS.AzureOperationResponse<ServiceClientModel.OperationStatus>
/// <summary>
/// Gets status of a generic operation on the protected item using the operation ID
/// </summary>
/// <param name="secondaryRegion"></param>
/// <param name="secondaryRegion">secondary region where to trigger the restore</param>
/// <param name="operationId">ID of the operation in progress</param>
/// <returns>Operation status response returned by the service</returns>
public RestAzureNS.AzureOperationResponse<CrrModel.OperationStatus>
Expand Down Expand Up @@ -105,7 +105,7 @@ public RestAzureNS.AzureOperationResponse GetContainerRefreshOrInquiryOperationR
/// Gets result of the refresh operation on the protection container using the operation ID
/// </summary>
/// <param name="operationId">ID of the operation in progress</param>
/// <param name="containerName"></param>
/// <param name="containerName">Name of the container which this item belongs to</param>
/// <param name="vaultName"></param>
/// <param name="resourceGroupName"></param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public List<RecoveryPointResource> GetRecoveryPoints(
/// </summary>
/// <param name="containerName">Name of the container which the item belongs to</param>
/// <param name="protectedItemName">Name of the item</param>
/// <param name="moveRequest"></param>
/// <param name="moveRequest">List Recovery points Recommended for Move Request</param>
/// <param name="vaultName"></param>
/// <param name="resourceGroupName"></param>
/// <returns>List of recovery points</returns>
Expand All @@ -145,7 +145,7 @@ public List<RecoveryPointResource> GetMoveRecommendedRecoveryPoints(
AzureFabricName,
containerName,
protectedItemName,
moveRequest
moveRequest
).Result.Body;

Func<string, RestAzureNS.IPage<RecoveryPointResource>> listNextAsync =
Expand All @@ -162,7 +162,7 @@ public List<RecoveryPointResource> GetMoveRecommendedRecoveryPoints(
/// </summary>
/// <param name="containerName">Name of the container which the item belongs to</param>
/// <param name="protectedItemName">Name of the item</param>
/// <param name="moveRPAcrossTiersRequest"></param>
/// <param name="moveRPAcrossTiersRequest">Move Resource Across Tiers Request</param>
/// <param name="recoveryPointId"></param>
/// <param name="vaultName"></param>
/// <param name="resourceGroupName"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ public CmdletModel.JobBase GetJobObject(string jobId, string vaultName = null, s
/// <summary>
/// Get the job PS model after fetching the job object from the service given the job ID.
/// </summary>
/// <param name="secondaryRegion"></param>
/// <param name="vaultId"></param>
/// <param name="secondaryRegion">secondaryRegion for the vault </param>
/// <param name="vaultId">ResourceId of the vault to be fetched</param>
/// <param name="jobId">ID of the job to be fetched</param>
/// <returns></returns>
public CmdletModel.JobBase GetCrrJobObject(string secondaryRegion, string vaultId, string jobId)
{
CrrModel.CrrJobRequest jobRequest = new CrrModel.CrrJobRequest();
jobRequest.JobName = jobId;
jobRequest.ResourceId = vaultId;

JobBase job = JobConversions.GetPSJobCrr(ServiceClientAdapter.GetCRRJobDetails(
secondaryRegion,
jobRequest));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public partial class PSRecoveryServicesClient
/// Initializes a new instance of the <see cref="PSRecoveryServicesClient" /> class with
/// required current subscription.
/// </summary>
/// <param name="azureProfile"></param>
/// <param name="azureProfile">Azure context.</param>
public PSRecoveryServicesClient(
IAzureContextContainer azureProfile)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public partial class PSAsrComputeManagementClient
/// Initializes a new instance of the <see cref="PSRecoveryServicesClient" /> class with
/// required current subscription.
/// </summary>
/// <param name="azureProfile"></param>
/// <param name="azureProfile">Azure context.</param>
public PSAsrComputeManagementClient(
IAzureContextContainer azureProfile)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public partial class PSRecoveryServicesClient
/// <summary>
/// Gets the events.
/// </summary>
/// <param name="eventName"></param>
/// <param name="eventName">The name of the Azure Site Recovery event.</param>
/// <returns></returns>
public EventModel GetAzureRmSiteRecoveryEvent(string eventName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public List<Network> GetAzureSiteRecoveryNetworks()
/// <summary>
/// Gets all Azure Site Recovery Networks under a Server
/// </summary>
/// <param name="fabricName"></param>
/// <param name="fabricName">Fabric name</param>
/// <returns>Network list response</returns>
public List<Network> GetAzureSiteRecoveryNetworks(
string fabricName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public NetworkMapping GetAzureSiteRecoveryNetworkMappings(
/// <param name="primaryFabricName">Primary fabric name</param>
/// <param name="primaryNetworkName">Primary network name</param>
/// <param name="mappingName">Mapping name</param>
/// <param name="input"></param>
/// <param name="input">Input data to be passed as request body.</param>
/// <returns>Long running operation response</returns>
public PSSiteRecoveryLongRunningOperation NewAzureSiteRecoveryNetworkMapping(
string primaryFabricName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public partial class PSRecoveryServicesClient
/// <summary>
/// Creates Azure Site Recovery Policy.
/// </summary>
/// <param name="policyName">Policy name</param>
/// <param name="policyName">Policy Name</param>
/// <param name="input">Policy Input</param>
/// <returns>Long operation response</returns>
public PSSiteRecoveryLongRunningOperation CreatePolicy(
Expand All @@ -47,7 +47,7 @@ public PSSiteRecoveryLongRunningOperation CreatePolicy(
/// <summary>
/// Deletes Azure Site Recovery Policy.
/// </summary>
/// <param name="policyName"></param>
/// <param name="policyName">Policy Name</param>
/// <returns>Long operation response</returns>
public PSSiteRecoveryLongRunningOperation DeletePolicy(
string policyName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public List<ProtectionContainer> GetAzureSiteRecoveryProtectionContainer()
/// <summary>
/// Gets Azure Site Recovery Protection Container.
/// </summary>
/// <param name="fabricName">Fabric Name</param>
/// <returns>Protection Container list response</returns>
public List<ProtectionContainer> GetAzureSiteRecoveryProtectionContainer(
string fabricName)
Expand Down Expand Up @@ -127,7 +128,7 @@ public List<ProtectionContainer> GetAzureSiteRecoveryProtectionContainer(
/// <summary>
/// Gets Azure Site Recovery Protection Container.
/// </summary>
/// <param name="fabricName"></param>
/// <param name="fabricName">Fabric Name</param>
/// <param name="protectionContainerName">Protection Container ID</param>
/// <returns>Protection Container response</returns>
public ProtectionContainer GetAzureSiteRecoveryProtectionContainer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private IList<ASRHealthError> TranslateHealthErrors(IList<HealthError> healthErr
/// <summary>
/// Translate Health errors to Powershell object.
/// </summary>
/// <param name="eventSpecificDetails">Rest API ASREventSpecificDetails object.</param>
/// <param name="eventSpecificDetails">Rest API EventSpecificDetails object.</param>
/// <returns></returns>
private ASREventSpecificDetails TranslateEventSpecificDetails(
EventSpecificDetails eventSpecificDetails)
Expand All @@ -160,7 +160,7 @@ private ASREventSpecificDetails TranslateEventSpecificDetails(
/// <summary>
/// Translate Health errors to Powershell object.
/// </summary>
/// <param name="eventSpecificDetails">Rest API ASREventSpecificDetails object.</param>
/// <param name="eventSpecificDetails">Rest API EventProviderSpecificDetails object.</param>
/// <returns></returns>
private ASREventProviderSpecificDetails TranslateProviderSpecificEventDetails(
EventProviderSpecificDetails eventSpecificDetails)
Expand Down Expand Up @@ -319,7 +319,7 @@ public class ASRHyperVReplicaAzureEventDetails : ASREventProviderSpecificDetails
/// <summary>
/// Converts REST API object to Powershell object.
/// </summary>
/// <param name="eventDetails"></param>
/// <param name="eventDetails">Internal object for a monitoring event.</param>
/// <returns>
/// REST API object for HyperVReplica E2A event provider specific
/// details.
Expand Down
Loading

0 comments on commit f8a293b

Please sign in to comment.