Skip to content

Commit f6edab8

Browse files
committed
Merge pull request #18 from AsrOneSdk/neha-dev
Adding fields - Encrypt stored data and AuthenticationType to CreateProt...
2 parents 6032c57 + 52865c9 commit f6edab8

File tree

5 files changed

+263
-31
lines changed

5 files changed

+263
-31
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Microsoft.Azure.Commands.RecoveryServices.dll-help.xml

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4865,4 +4865,220 @@
48654865
</maml:relatedLinks>
48664866
</command:command>
48674867

4868+
<!--New-AzureSiteRecoveryProtectionProfile-->
4869+
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
4870+
<command:details>
4871+
<command:name>
4872+
New-AzureSiteRecoveryProtectionProfile
4873+
</command:name>
4874+
<maml:description>
4875+
<maml:para>Creates a Protection profile object in memory.</maml:para>
4876+
</maml:description>
4877+
<maml:copyright>
4878+
<maml:para></maml:para>
4879+
</maml:copyright>
4880+
<command:verb>New</command:verb>
4881+
<command:noun>AzureSiteRecoveryProtectionProfile</command:noun>
4882+
<dev:version></dev:version>
4883+
</command:details>
4884+
<maml:description>
4885+
<maml:para>Creates a Protection profile object in memory. This command can be used to return a protection profile object to be further supplied for protectionProfile related operations.</maml:para>
4886+
</maml:description>
4887+
<!-- Cmdlet syntax section-->
4888+
<command:syntax>
4889+
<command:syntaxItem>
4890+
<maml:name>New-AzureSiteRecoveryProtectionProfile</maml:name>
4891+
4892+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
4893+
<maml:name>ReplicationProvider</maml:name>
4894+
<maml:description>
4895+
<maml:para>Replication Provider either HyperVReplica or HyperVReplicaAzure.</maml:para>
4896+
</maml:description>
4897+
<command:parameterValue required="true" variableLength="false">string</command:parameterValue>
4898+
</command:parameter>
4899+
4900+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
4901+
<maml:name>ReplicationMethod</maml:name>
4902+
<maml:description>
4903+
<maml:para>Replication Method either Online or Offline.</maml:para>
4904+
</maml:description>
4905+
<command:parameterValue required="false" variableLength="false">string</command:parameterValue>
4906+
</command:parameter>
4907+
4908+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
4909+
<maml:name>ReplicationFrequencyInSeconds</maml:name>
4910+
<maml:description>
4911+
<maml:para>Replication Frequency In Seconds. Default is taken as 0.</maml:para>
4912+
</maml:description>
4913+
<command:parameterValue required="false" variableLength="false">string</command:parameterValue>
4914+
</command:parameter>
4915+
4916+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
4917+
<maml:name>RecoveryPoints</maml:name>
4918+
<maml:description>
4919+
<maml:para>Recovery Points. Default is taken as Zero.</maml:para>
4920+
</maml:description>
4921+
<command:parameterValue required="false" variableLength="false">string</command:parameterValue>
4922+
</command:parameter>
4923+
4924+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
4925+
<maml:name>ApplicationConsistentSnapshotFrequencyInHours</maml:name>
4926+
<maml:description>
4927+
<maml:para>-Application Consistent Snapshot Frequency In Hours. Default is taken as zero.</maml:para>
4928+
</maml:description>
4929+
<command:parameterValue required="false" variableLength="false">string</command:parameterValue>
4930+
</command:parameter>
4931+
4932+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
4933+
<maml:name>ReplicationStartTime</maml:name>
4934+
<maml:description>
4935+
<maml:para>Replication Start Time. Default is taken as Immediately.</maml:para>
4936+
</maml:description>
4937+
<command:parameterValue required="false" variableLength="false">string</command:parameterValue>
4938+
</command:parameter>
4939+
4940+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
4941+
<maml:name>ReplicationPort</maml:name>
4942+
<maml:description>
4943+
<maml:para>Replication Port. Default is 0.</maml:para>
4944+
</maml:description>
4945+
<command:parameterValue required="false" variableLength="false">string</command:parameterValue>
4946+
</command:parameter>
4947+
4948+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
4949+
<maml:name>CompressionEnabled</maml:name>
4950+
<maml:description>
4951+
<maml:para>Compression to be Enabled. Default is false.</maml:para>
4952+
</maml:description>
4953+
</command:parameter>
4954+
4955+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
4956+
<maml:name>AllowReplicaDeletion</maml:name>
4957+
<maml:description>
4958+
<maml:para>Allow Replica entity Deletion to be Enabled. Default is false.</maml:para>
4959+
</maml:description>
4960+
</command:parameter>
4961+
4962+
</command:syntaxItem>
4963+
</command:syntax>
4964+
<!-- Cmdlet parameter section -->
4965+
<command:parameters>
4966+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="named">
4967+
<maml:name>ProtectionEntity</maml:name>
4968+
<maml:description>
4969+
<maml:para>Protection Entity object</maml:para>
4970+
4971+
</maml:description>
4972+
<command:parameterValue required="true" variableLength="false">ASRProtectionEntity</command:parameterValue>
4973+
<dev:type>
4974+
<maml:name>ASRProtectionEntity</maml:name>
4975+
<maml:uri/>
4976+
</dev:type>
4977+
<dev:defaultValue></dev:defaultValue>
4978+
</command:parameter>
4979+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
4980+
<maml:name>WaitForCompletion</maml:name>
4981+
<maml:description>
4982+
<maml:para>Waits till the operation completes</maml:para>
4983+
</maml:description>
4984+
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
4985+
<dev:type>
4986+
<maml:name>SwitchParameter</maml:name>
4987+
<maml:uri/>
4988+
</dev:type>
4989+
<dev:defaultValue></dev:defaultValue>
4990+
</command:parameter>
4991+
</command:parameters>
4992+
<!-- Input - Output section-->
4993+
<command:inputTypes>
4994+
<command:inputType>
4995+
<dev:type>
4996+
<maml:name></maml:name>
4997+
<maml:uri/>
4998+
<maml:description />
4999+
</dev:type>
5000+
<maml:description>
5001+
<maml:para>
5002+
<!-- description -->
5003+
5004+
</maml:para>
5005+
</maml:description>
5006+
</command:inputType>
5007+
</command:inputTypes>
5008+
<command:returnValues>
5009+
<command:returnValue>
5010+
<dev:type>
5011+
<maml:name></maml:name>
5012+
<maml:uri />
5013+
<maml:description />
5014+
</dev:type>
5015+
<maml:description>
5016+
<maml:para>
5017+
<!-- description -->
5018+
5019+
</maml:para>
5020+
</maml:description>
5021+
</command:returnValue>
5022+
</command:returnValues>
5023+
<!-- Error section-->
5024+
<command:terminatingErrors />
5025+
<command:nonTerminatingErrors />
5026+
<!-- Notes section -->
5027+
<maml:alertSet>
5028+
<maml:title></maml:title>
5029+
<maml:alert>
5030+
<maml:para>
5031+
5032+
</maml:para>
5033+
</maml:alert>
5034+
<maml:alert>
5035+
<maml:para></maml:para>
5036+
</maml:alert>
5037+
</maml:alertSet>
5038+
<!-- Example section -->
5039+
<command:examples>
5040+
5041+
<command:example>
5042+
<maml:title>
5043+
-------------------------- EXAMPLE 1 --------------------------
5044+
</maml:title>
5045+
<maml:introduction>
5046+
<maml:para>C:\PS&gt;</maml:para>
5047+
</maml:introduction>
5048+
<dev:code>
5049+
New-AzureSiteRecoveryProtectionProfile -ReplicationProvider HyperVReplica -ReplicationMethod Online -ReplicationFrequencyInSeconds 10 -RecoveryPoints 2 -ApplicationConsistentSnapshotFrequencyInHours 1 -CompressionEnabled -ReplicationPort 8085 -ReplicationStartTime 1 -AllowReplicaDeletion
5050+
5051+
Name :
5052+
ID :
5053+
ReplicationProvider : HyperVReplica
5054+
HyperVReplicaProviderSettingsObject : Microsoft.Azure.Portal.RecoveryServices.Models.Common.HyperVReplicaProviderS
5055+
ettings
5056+
HyperVReplicaAzureProviderSettingsObject :
5057+
5058+
</dev:code>
5059+
<dev:remarks>
5060+
<maml:para>Description</maml:para>
5061+
<maml:para>-----------</maml:para>
5062+
<maml:para></maml:para>
5063+
<maml:para></maml:para>
5064+
<maml:para></maml:para>
5065+
<maml:para></maml:para>
5066+
<maml:para></maml:para>
5067+
</dev:remarks>
5068+
<command:commandLines>
5069+
<command:commandLine>
5070+
<command:commandText></command:commandText>
5071+
</command:commandLine>
5072+
</command:commandLines>
5073+
</command:example>
5074+
</command:examples>
5075+
<!-- Link section -->
5076+
<maml:relatedLinks>
5077+
<maml:navigationLink>
5078+
<maml:linkText></maml:linkText>
5079+
<maml:uri/>
5080+
</maml:navigationLink>
5081+
</maml:relatedLinks>
5082+
</command:command>
5083+
48685084
</helpItems>

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/CreateAzureSiteRecoveryProtectionProfileObject.cs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class CreateAzureSiteRecoveryProtectionProfileObject : RecoveryServicesCm
5050
[ValidateSet(
5151
Constants.OnlineReplicationMethod,
5252
Constants.OfflineReplicationMethod)]
53+
[DefaultValue(Constants.OnlineReplicationMethod)]
5354
public string ReplicationMethod { get; set; }
5455

5556
/// <summary>
@@ -66,13 +67,19 @@ public class CreateAzureSiteRecoveryProtectionProfileObject : RecoveryServicesCm
6667
[ValidateNotNullOrEmpty]
6768
public string RecoveryAzureStorageAccount { get; set; }
6869

70+
/// <summary>
71+
/// Gets or sets a value indicating whether stored data needs to be encrypted.
72+
/// </summary>
73+
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure)]
74+
[DefaultValue(false)]
75+
public SwitchParameter EncryptStoredData { get; set; }
76+
6977
/// <summary>
7078
/// Gets or sets Replication Frequency of the Protection Profile in seconds.
7179
/// </summary>
7280
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise)]
7381
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure)]
7482
[ValidateNotNullOrEmpty]
75-
[DefaultValue(300)]
7683
public ushort ReplicationFrequencyInSeconds { get; set; }
7784

7885
/// <summary>
@@ -97,17 +104,27 @@ public class CreateAzureSiteRecoveryProtectionProfileObject : RecoveryServicesCm
97104
/// Gets or sets a value indicating whether Compression needs to be Enabled on the Protection Profile.
98105
/// </summary>
99106
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise)]
100-
[DefaultValue(true)]
107+
[DefaultValue(false)]
101108
public SwitchParameter CompressionEnabled { get; set; }
102109

103110
/// <summary>
104111
/// Gets or sets the Replication Port of the Protection Profile.
105112
/// </summary>
106113
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise)]
107114
[ValidateNotNullOrEmpty]
108-
[DefaultValue(8084)]
115+
[DefaultValue(0)]
109116
public ushort ReplicationPort { get; set; }
110117

118+
/// <summary>
119+
/// Gets or sets the Replication Port of the Protection Profile.
120+
/// </summary>
121+
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise)]
122+
[ValidateNotNullOrEmpty]
123+
[ValidateSet(
124+
Constants.AuthenticationTypeCertificate,
125+
Constants.AuthenticationTypeKerberos)]
126+
public string Authentication { get; set; }
127+
111128
/// <summary>
112129
/// Gets or sets Replication Start time of the Protection Profile.
113130
/// </summary>
@@ -168,8 +185,8 @@ private void EnterpriseToAzureProtectionProfileObject()
168185
//// Verify whether the storage account is associated with the account or not.
169186
//// PSRecoveryServicesClientHelper.ValidateStorageAccountAssociation(this.RecoveryAzureStorageAccount);
170187

171-
//// Verify whether the subscription is associated with the account or not.
172-
//// PSRecoveryServicesClientHelper.ValidateSubscriptionAccountAssociation(this.RecoveryAzureSubscription);
188+
// Verify whether the subscription is associated with the account or not.
189+
PSRecoveryServicesClientHelper.ValidateSubscriptionAccountAssociation(this.RecoveryAzureSubscription);
173190

174191
this.ValidateReplicationStartTime(this.ReplicationStartTime);
175192

@@ -178,15 +195,13 @@ private void EnterpriseToAzureProtectionProfileObject()
178195
ReplicationProvider = this.ReplicationProvider,
179196
HyperVReplicaAzureProviderSettingsObject = new HyperVReplicaAzureProviderSettings()
180197
{
181-
ReplicationMethod = this.ReplicationMethod,
182198
RecoveryAzureSubscription = this.RecoveryAzureSubscription,
183199
RecoveryAzureStorageAccountName = this.RecoveryAzureStorageAccount,
200+
EncryptStoredData = this.EncryptStoredData,
184201
ReplicationFrequencyInSeconds = this.ReplicationFrequencyInSeconds,
185202
RecoveryPoints = this.RecoveryPoints,
186203
ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours,
187-
ReplicationPort = this.ReplicationPort,
188204
ReplicationStartTime = this.ReplicationStartTime,
189-
AllowReplicaDeletion = this.AllowReplicaDeletion
190205
},
191206
HyperVReplicaProviderSettingsObject = null
192207
};
@@ -231,6 +246,7 @@ private void EnterpriseToEnterpriseProtectionProfileObject()
231246
ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours,
232247
CompressionEnabled = this.CompressionEnabled,
233248
ReplicationPort = this.ReplicationPort,
249+
Authentication = this.Authentication,
234250
ReplicationStartTime = this.ReplicationStartTime,
235251
AllowReplicaDeletion = this.AllowReplicaDeletion
236252
}

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Service/StartAzureSiteRecoveryProtectionProfileAssociationJob.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ HyperVReplicaAzureProtectionProfileInput hyperVReplicaAzureProtectionProfileInpu
104104
ReplicationInterval = this.ProtectionProfile.HyperVReplicaAzureProviderSettingsObject.ReplicationFrequencyInSeconds,
105105
OnlineReplicationStartTime = this.ProtectionProfile.HyperVReplicaAzureProviderSettingsObject.ReplicationStartTime,
106106
RecoveryPointHistoryDuration = this.ProtectionProfile.HyperVReplicaAzureProviderSettingsObject.RecoveryPoints,
107+
EncryptionEnabled = this.ProtectionProfile.HyperVReplicaAzureProviderSettingsObject.EncryptStoredData
107108
};
108109

109110
var storageAccount = new CustomerStorageAccount();
@@ -148,7 +149,8 @@ HyperVReplicaProtectionProfileInput hyperVReplicaProtectionProfileInput
148149
OnlineReplicationMethod = (string.Compare(this.ProtectionProfile.HyperVReplicaProviderSettingsObject.ReplicationMethod, Constants.OnlineReplicationMethod, StringComparison.OrdinalIgnoreCase) == 1) ? true : false,
149150
RecoveryPoints = this.ProtectionProfile.HyperVReplicaProviderSettingsObject.RecoveryPoints,
150151
ReplicationPort = this.ProtectionProfile.HyperVReplicaProviderSettingsObject.ReplicationPort,
151-
AllowReplicaDeletion = this.ProtectionProfile.HyperVReplicaProviderSettingsObject.AllowReplicaDeletion
152+
AllowReplicaDeletion = this.ProtectionProfile.HyperVReplicaProviderSettingsObject.AllowReplicaDeletion,
153+
AllowedAuthenticationType = (ushort)((string.Compare(this.ProtectionProfile.HyperVReplicaProviderSettingsObject.Authentication, Constants.AuthenticationTypeKerberos, StringComparison.OrdinalIgnoreCase) == 0) ? 1 : 2),
152154
};
153155

154156
CreateProtectionProfileInput createProtectionProfileInput =

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/lib/PSContracts.cs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,11 @@ public HyperVReplicaProviderSettings()
865865
/// </summary>
866866
public ushort ReplicationPort { get; set; }
867867

868+
/// <summary>
869+
/// Gets or sets the allowed authentication type.
870+
/// </summary>
871+
public string Authentication { get; set; }
872+
868873
/// <summary>
869874
/// Gets or sets Replication Start Time.
870875
/// </summary>
@@ -896,11 +901,6 @@ public HyperVReplicaAzureProviderSettings()
896901

897902
#region Properties
898903

899-
/// <summary>
900-
/// Gets or sets Replication Method.
901-
/// </summary>
902-
public string ReplicationMethod { get; set; }
903-
904904
/// <summary>
905905
/// Gets or sets a value indicating whether profile can be dissociated or not.
906906
/// </summary>
@@ -921,6 +921,11 @@ public HyperVReplicaAzureProviderSettings()
921921
/// </summary>
922922
public string RecoveryAzureStorageAccountName { get; set; }
923923

924+
/// <summary>
925+
/// Gets or sets a value indicating whether to encrypt stored data.
926+
/// </summary>
927+
public bool EncryptStoredData { get; set; }
928+
924929
/// <summary>
925930
/// Gets or sets Replication Frequency in seconds.
926931
/// </summary>
@@ -936,21 +941,11 @@ public HyperVReplicaAzureProviderSettings()
936941
/// </summary>
937942
public int ApplicationConsistentSnapshotFrequencyInHours { get; set; }
938943

939-
/// <summary>
940-
/// Gets or sets the replication port.
941-
/// </summary>
942-
public ushort ReplicationPort { get; set; }
943-
944944
/// <summary>
945945
/// Gets or sets Replication Start Time.
946946
/// </summary>
947947
public TimeSpan? ReplicationStartTime { get; set; }
948948

949-
/// <summary>
950-
/// Gets or sets a value indicating whether Replica Deletion should be enabled.
951-
/// </summary>
952-
public bool AllowReplicaDeletion { get; set; }
953-
954949
#endregion
955950
}
956951

0 commit comments

Comments
 (0)