Skip to content

Commit 7b92745

Browse files
committed
Changing ReplicationStartTime back to TimeSpan
1 parent e4b07ac commit 7b92745

File tree

2 files changed

+5
-77
lines changed

2 files changed

+5
-77
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/PSRecoveryServicesClient/PSRecoveryServicesClientHelper.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,5 @@ SubscriptionCloudCredentials creds
8686
azureStorageAccount));
8787
}
8888
}
89-
90-
/// <summary>
91-
/// Converts the given time string into a TimeSpan object.
92-
/// </summary>
93-
/// <param name="replicationStartTime">Replication Start Time</param>
94-
/// <returns></returns>
95-
public static TimeSpan? ConvertIntoTimeSpan(string replicationStartTime)
96-
{
97-
if (String.IsNullOrEmpty(replicationStartTime))
98-
{
99-
return null;
100-
}
101-
102-
// TBD
103-
104-
return new TimeSpan();
105-
}
10689
}
10790
}

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

Lines changed: 5 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -107,59 +107,10 @@ public class CreateAzureSiteRecoveryProtectionProfileObject : RecoveryServicesCm
107107
/// <summary>
108108
/// Gets or sets Replication Start time of the Protection Profile.
109109
/// </summary>
110-
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = true)]
111-
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure, Mandatory = true)]
110+
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise)]
111+
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure)]
112112
[ValidateNotNullOrEmpty]
113-
[ValidateSet(
114-
"Immediately",
115-
"12:30 AM",
116-
"1:00 AM",
117-
"1:30 AM",
118-
"2:00 AM",
119-
"2:30 AM",
120-
"3:00 AM",
121-
"3:30 AM",
122-
"4:00 AM",
123-
"4:30 AM",
124-
"5:00 AM",
125-
"5:30 AM",
126-
"6:00 AM",
127-
"6:30 AM",
128-
"7:00 AM",
129-
"7:30 AM",
130-
"8:00 AM",
131-
"8:30 AM",
132-
"9:00 AM",
133-
"9:30 AM",
134-
"10:00 AM",
135-
"10:30 AM",
136-
"11:00 AM",
137-
"11:30 AM",
138-
"12:00 PM",
139-
"12:30 PM",
140-
"1:00 PM",
141-
"1:30 PM",
142-
"2:00 PM",
143-
"2:30 PM",
144-
"3:00 PM",
145-
"3:30 PM",
146-
"4:00 PM",
147-
"4:30 PM",
148-
"5:00 PM",
149-
"5:30 PM",
150-
"6:00 PM",
151-
"6:30 PM",
152-
"7:00 PM",
153-
"7:30 PM",
154-
"8:00 PM",
155-
"8:30 PM",
156-
"9:00 PM",
157-
"9:30 PM",
158-
"10:00 PM",
159-
"10:30 PM",
160-
"11:00 PM",
161-
"11:30 PM")]
162-
public string ReplicationStartTime { get; set; }
113+
public TimeSpan? ReplicationStartTime { get; set; }
163114

164115
/// <summary>
165116
/// Gets or sets a value indicating whether Replica should be Deleted on
@@ -216,9 +167,6 @@ private void EnterpriseToAzureProtectionProfileObject()
216167
// Verify whether the subscription is associated with the account or not.
217168
PSRecoveryServicesClientHelper.ValidateSubscriptionAccountAssociation(this.RecoveryAzureSubscription);
218169

219-
// Change the Replication Start Time given from string to TimeSpan
220-
TimeSpan? timeSpan = PSRecoveryServicesClientHelper.ConvertIntoTimeSpan(this.ReplicationStartTime);
221-
222170
ASRProtectionProfile protectionProfile = new ASRProtectionProfile()
223171
{
224172
ReplicationProvider = this.ReplicationProvider,
@@ -232,7 +180,7 @@ private void EnterpriseToAzureProtectionProfileObject()
232180
ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours,
233181
CompressionEnabled = this.CompressionEnabled,
234182
ReplicationPort = this.ReplicationPort,
235-
ReplicationStartTime = timeSpan,
183+
ReplicationStartTime = this.ReplicationStartTime,
236184
AllowReplicaDeletion = this.AllowReplicaDeletion
237185
},
238186
HyperVReplicaProviderSettingsObject = null
@@ -246,9 +194,6 @@ private void EnterpriseToAzureProtectionProfileObject()
246194
/// </summary>
247195
private void EnterpriseToEnterpriseProtectionProfileObject()
248196
{
249-
// Change the Replication Start Time given from string to TimeSpan
250-
TimeSpan? timeSpan = PSRecoveryServicesClientHelper.ConvertIntoTimeSpan(this.ReplicationStartTime);
251-
252197
ASRProtectionProfile protectionProfile = new ASRProtectionProfile()
253198
{
254199
ReplicationProvider = this.ReplicationProvider,
@@ -261,7 +206,7 @@ private void EnterpriseToEnterpriseProtectionProfileObject()
261206
ApplicationConsistentSnapshotFrequencyInHours = this.ApplicationConsistentSnapshotFrequencyInHours,
262207
CompressionEnabled = this.CompressionEnabled,
263208
ReplicationPort = this.ReplicationPort,
264-
ReplicationStartTime = timeSpan,
209+
ReplicationStartTime = this.ReplicationStartTime,
265210
AllowReplicaDeletion = this.AllowReplicaDeletion
266211
}
267212
};

0 commit comments

Comments
 (0)