Skip to content

Commit 969808c

Browse files
committed
Adding fields - Encrypt stored data and AuthenticationType to CreateProtectionProfile cmdlet
1 parent 592b2fe commit 969808c

File tree

4 files changed

+260
-3
lines changed

4 files changed

+260
-3
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. Default is taken as Online.</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 300.</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 taken as 8084.</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 true.</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 & 3 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,6 +67,13 @@ 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>
@@ -108,6 +116,17 @@ public class CreateAzureSiteRecoveryProtectionProfileObject : RecoveryServicesCm
108116
[DefaultValue(8084)]
109117
public ushort ReplicationPort { get; set; }
110118

119+
/// <summary>
120+
/// Gets or sets the Replication Port of the Protection Profile.
121+
/// </summary>
122+
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise)]
123+
[ValidateNotNullOrEmpty]
124+
[ValidateSet(
125+
Constants.AuthenticationTypeCertificate,
126+
Constants.AuthenticationTypeKerberos)]
127+
[DefaultValue(Constants.AuthenticationTypeCertificate)]
128+
public string Authentication { get; set; }
129+
111130
/// <summary>
112131
/// Gets or sets Replication Start time of the Protection Profile.
113132
/// </summary>
@@ -165,11 +184,11 @@ protected override void StopProcessing()
165184
/// </summary>
166185
private void EnterpriseToAzureProtectionProfileObject()
167186
{
168-
// Verify whether the storage account is associated with the account or not.
169-
// PSRecoveryServicesClientHelper.ValidateStorageAccountAssociation(this.RecoveryAzureStorageAccount);
187+
//// Verify whether the storage account is associated with the account or not.
188+
//// PSRecoveryServicesClientHelper.ValidateStorageAccountAssociation(this.RecoveryAzureStorageAccount);
170189

171190
// Verify whether the subscription is associated with the account or not.
172-
// PSRecoveryServicesClientHelper.ValidateSubscriptionAccountAssociation(this.RecoveryAzureSubscription);
191+
PSRecoveryServicesClientHelper.ValidateSubscriptionAccountAssociation(this.RecoveryAzureSubscription);
173192

174193
this.ValidateReplicationStartTime(this.ReplicationStartTime);
175194

@@ -181,6 +200,7 @@ private void EnterpriseToAzureProtectionProfileObject()
181200
ReplicationMethod = this.ReplicationMethod,
182201
RecoveryAzureSubscription = this.RecoveryAzureSubscription,
183202
RecoveryAzureStorageAccountName = this.RecoveryAzureStorageAccount,
203+
EncryptStoredData = this.EncryptStoredData,
184204
ReplicationFrequencyInSeconds = this.ReplicationFrequencyInSeconds,
185205
RecoveryPoints = this.RecoveryPoints,
186206
ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours,
@@ -232,6 +252,7 @@ private void EnterpriseToEnterpriseProtectionProfileObject()
232252
ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours,
233253
CompressionEnabled = this.CompressionEnabled,
234254
ReplicationPort = this.ReplicationPort,
255+
Authentication = this.Authentication,
235256
ReplicationStartTime = this.ReplicationStartTime,
236257
AllowReplicaDeletion = this.AllowReplicaDeletion
237258
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,11 @@ public HyperVReplicaProviderSettings()
877877
/// </summary>
878878
public ushort ReplicationPort { get; set; }
879879

880+
/// <summary>
881+
/// Gets or sets the allowed authentication type.
882+
/// </summary>
883+
public string Authentication { get; set; }
884+
880885
/// <summary>
881886
/// Gets or sets Replication Start Time.
882887
/// </summary>
@@ -933,6 +938,11 @@ public HyperVReplicaAzureProviderSettings()
933938
/// </summary>
934939
public string RecoveryAzureStorageAccountName { get; set; }
935940

941+
/// <summary>
942+
/// Gets or sets a value indicating whether to encrypt stored data.
943+
/// </summary>
944+
public bool EncryptStoredData { get; set; }
945+
936946
/// <summary>
937947
/// Gets or sets Replication Frequency in seconds.
938948
/// </summary>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@ public class Constants
172172
/// Azure fabric Id. In E2A context Recovery Server Id is always this.
173173
/// </summary>
174174
public const string AzureFabricId = "21a9403c-6ec1-44f2-b744-b4e50b792387";
175+
176+
/// <summary>
177+
/// Authentication Type as Certificate based authentication.
178+
/// </summary>
179+
public const string AuthenticationTypeCertificate = "Certificate";
180+
181+
/// <summary>
182+
/// Authentication Type as Kerberos.
183+
/// </summary>
184+
public const string AuthenticationTypeKerberos = "Kerberos";
175185
}
176186

177187
/// <summary>

0 commit comments

Comments
 (0)