Skip to content

Commit 4343459

Browse files
committed
Merge pull request #49 from AsrOneSdk/sanjkuma-dev
Bug fixes.
2 parents 2599eae + f7de03b commit 4343459

File tree

12 files changed

+49
-40
lines changed

12 files changed

+49
-40
lines changed

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/Commands.RecoveryServices.Test.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@
8383
<SpecificVersion>False</SpecificVersion>
8484
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
8585
</Reference>
86-
<Reference Include="Microsoft.WindowsAzure.Management.SiteRecovery">
87-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.0.4.1-preview\lib\net40\Microsoft.WindowsAzure.Management.SiteRecovery.dll</HintPath>
86+
<Reference Include="Microsoft.WindowsAzure.Management.SiteRecovery, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
87+
<SpecificVersion>False</SpecificVersion>
88+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.0.5.0-preview\lib\net40\Microsoft.WindowsAzure.Management.SiteRecovery.dll</HintPath>
8889
</Reference>
8990
<Reference Include="Microsoft.WindowsAzure.Testing, Version=1.0.5417.13285, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9091
<SpecificVersion>False</SpecificVersion>

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<package id="Microsoft.Azure.Common" version="2.0.1" targetFramework="net45" />
77
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
88
<package id="Microsoft.Azure.Common.Extensions" version="0.14.0-preview" targetFramework="net45" />
9-
<package id="Microsoft.Azure.Management.RecoveryServices" version="0.4.1-preview" targetFramework="net45" />
9+
<package id="Microsoft.Azure.Management.RecoveryServices" version="0.5.0-preview" targetFramework="net45" />
1010
<package id="Microsoft.Azure.Management.Resources" version="2.12.0-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Test.Framework" version="1.0.5486.28526-prerelease" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5486.28526-prerelease" targetFramework="net45" />

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@
9090
<SpecificVersion>False</SpecificVersion>
9191
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll</HintPath>
9292
</Reference>
93-
<Reference Include="Microsoft.WindowsAzure.Management.SiteRecovery">
94-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.0.4.1-preview\lib\net40\Microsoft.WindowsAzure.Management.SiteRecovery.dll</HintPath>
93+
<Reference Include="Microsoft.WindowsAzure.Management.SiteRecovery, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
94+
<SpecificVersion>False</SpecificVersion>
95+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServices.0.5.0-preview\lib\net40\Microsoft.WindowsAzure.Management.SiteRecovery.dll</HintPath>
9596
</Reference>
9697
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9798
<SpecificVersion>False</SpecificVersion>

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Properties/Resources.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Properties/Resources.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ ClientRequestId: {3}</value>
231231
<value>Please provide both Source Nic and Recovery Target to update</value>
232232
</data>
233233
<data name="MandatoryParamFromNextRelease" xml:space="preserve">
234-
<value>"'{0}' will be a mandatory paramter from next release."</value>
234+
<value>"{0} will be a mandatory paramter from next release."</value>
235235
</data>
236236
<data name="IDBasedParamUsageNotSupportedFromNextRelease" xml:space="preserve">
237-
<value>"Calls using ID based parameter '{0}' will not be supported from next release. Please use its corresponding full object parameter instead."</value>
237+
<value>"Calls using ID based parameter {0} will not be supported from next release. Please use its corresponding full object parameter instead."</value>
238238
</data>
239239
<data name="InvalidReplicationFrequency" xml:space="preserve">
240240
<value>Replication Frequency {0} is invalid</value>

src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/RecoveryServicesCmdletBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ protected void ValidateUsageById(string replicationProvider, string paramName)
177177
{
178178
throw new Exception(
179179
string.Format(
180-
Properties.Resources.IDBasedParamUsageNotSupportedFromNextRelease,
180+
"Call using ID based parameter {0} is not supported for this provider. Please use its corresponding full object parameter instead",
181181
paramName));
182182
}
183183
else

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ public class NewAzureSiteRecoverySite : RecoveryServicesCmdletBase
3636
[ValidateNotNullOrEmpty]
3737
public string Name { get; set; }
3838

39-
/// <summary>
40-
/// Gets or sets the name of the site to be created
41-
/// </summary>
42-
[Parameter(ParameterSetName = ASRParameterSets.Default, Mandatory = false, HelpMessage = "Type of the site to be created")]
43-
[ValidateNotNullOrEmpty]
44-
public string Type { get; set; }
45-
4639
/// <summary>
4740
/// Gets or sets the vault name
4841
/// </summary>
@@ -59,7 +52,12 @@ public override void ExecuteCmdlet()
5952
{
6053
try
6154
{
62-
JobResponse response = RecoveryServicesClient.CreateAzureSiteRecoverySite(this.Name, this.Type, this.Vault);
55+
// Currently we support only FabricProviders.HyperVSite.
56+
JobResponse response =
57+
RecoveryServicesClient.CreateAzureSiteRecoverySite(
58+
this.Name,
59+
FabricProviders.HyperVSite,
60+
this.Vault);
6361

6462
this.WriteObject(response.Job, true);
6563
}

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,13 @@ public class SetAzureSiteRecoveryProtectionEntity : RecoveryServicesCmdletBase
6161
/// Gets or sets Protection Entity Object.
6262
/// </summary>
6363
[Parameter(ParameterSetName = ASRParameterSets.ByPEObject, Mandatory = true, ValueFromPipeline = true)]
64-
[Parameter(ParameterSetName = ASRParameterSets.ByPEObjectE2AEnable, Mandatory = true, ValueFromPipeline = true)]
6564
[ValidateNotNullOrEmpty]
6665
public ASRProtectionEntity ProtectionEntity { get; set; }
6766

6867
/// <summary>
6968
/// Gets or sets Protection profile.
7069
/// </summary>
71-
[Parameter(ParameterSetName = ASRParameterSets.ByPEObjectE2AEnable, Mandatory = true)]
70+
[Parameter]
7271
[ValidateNotNullOrEmpty]
7372
public ASRProtectionProfile ProtectionProfile { get; set; }
7473

@@ -85,14 +84,14 @@ public class SetAzureSiteRecoveryProtectionEntity : RecoveryServicesCmdletBase
8584
/// <summary>
8685
/// Gets or sets OS disk name.
8786
/// </summary>
88-
[Parameter(ParameterSetName = ASRParameterSets.ByPEObjectE2AEnable)]
87+
[Parameter]
8988
[ValidateNotNullOrEmpty]
9089
public string OSDiskName { get; set; }
9190

9291
/// <summary>
9392
/// Gets or sets OS.
9493
/// </summary>
95-
[Parameter(ParameterSetName = ASRParameterSets.ByPEObjectE2AEnable)]
94+
[Parameter]
9695
[ValidateNotNullOrEmpty]
9796
[ValidateSet(
9897
Constants.OSWindows,
@@ -120,7 +119,6 @@ public override void ExecuteCmdlet()
120119
switch (this.ParameterSetName)
121120
{
122121
case ASRParameterSets.ByPEObject:
123-
case ASRParameterSets.ByPEObjectE2AEnable:
124122
this.Id = this.ProtectionEntity.ID;
125123
this.ProtectionContainerId = this.ProtectionEntity.ProtectionContainerId;
126124
this.targetNameOrId = this.ProtectionEntity.Name;
@@ -143,8 +141,9 @@ public override void ExecuteCmdlet()
143141
this.Protection.Equals(Constants.EnableProtection, StringComparison.OrdinalIgnoreCase))
144142
{
145143
throw new ArgumentException(
146-
Properties.Resources.ProtectionEntityAlreadyEnabled,
147-
this.targetNameOrId);
144+
string.Format(
145+
Properties.Resources.ProtectionEntityAlreadyEnabled,
146+
this.targetNameOrId));
148147
}
149148
else if (!this.alreadyEnabled &&
150149
this.Protection.Equals(Constants.DisableProtection, StringComparison.OrdinalIgnoreCase))
@@ -187,10 +186,6 @@ public override void ExecuteCmdlet()
187186
}
188187
else
189188
{
190-
this.WriteWarningWithTimestamp(
191-
string.Format(
192-
Properties.Resources.MandatoryParamFromNextRelease,
193-
"ProtectionProfile"));
194189
string pcId = this.ProtectionContainerId ?? this.ProtectionEntity.ProtectionContainerId;
195190
var pc = RecoveryServicesClient.GetAzureSiteRecoveryProtectionContainer(
196191
pcId);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public class StartAzureSiteRecoveryUnplannedFailoverJob : RecoveryServicesCmdlet
8585
/// <summary>
8686
/// Gets or sets a value indicating whether primary site actions are required or not.
8787
/// </summary>
88-
[Parameter(ParameterSetName = ASRParameterSets.ByRPObject, Mandatory = true)]
89-
[Parameter(ParameterSetName = ASRParameterSets.ByRPId, Mandatory = true)]
88+
[Parameter(ParameterSetName = ASRParameterSets.ByRPObject, Mandatory = false)]
89+
[Parameter(ParameterSetName = ASRParameterSets.ByRPId, Mandatory = false)]
9090
public bool PrimaryAction { get; set; }
9191

9292
/// <summary>

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

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,18 @@ public ASRProtectionEntity(ProtectionEntity pe)
858858
this.ReplicationHealth = pe.ReplicationHealth;
859859
this.TestFailoverStateDescription = pe.TestFailoverStateDescription;
860860

861+
if (!string.IsNullOrWhiteSpace(pe.ReplicationProviderSettings))
862+
{
863+
AzureVmDiskDetails diskDetails;
864+
DataContractUtils.Deserialize<AzureVmDiskDetails>(
865+
pe.ReplicationProviderSettings, out diskDetails);
866+
867+
this.Disks = diskDetails.Disks;
868+
this.OSDiskId = diskDetails.VHDId;
869+
this.OSDiskName = diskDetails.OsDisk;
870+
this.OS = diskDetails.OsType;
871+
}
872+
861873
if (pe.ProtectionProfile != null &&
862874
!string.IsNullOrWhiteSpace(pe.ProtectionProfile.ID))
863875
{
@@ -1107,10 +1119,17 @@ public ASRJob(Job job)
11071119
this.StateDescription = job.StateDescription;
11081120
this.EndTime = job.EndTime;
11091121
this.StartTime = job.StartTime;
1110-
this.AllowedActions = job.AllowedActions as List<string>;
11111122
this.Name = job.Name;
11121123
this.TargetObjectId = job.TargetObjectId;
11131124
this.TargetObjectName = job.TargetObjectName;
1125+
if (job.AllowedActions != null && job.AllowedActions.Count > 0)
1126+
{
1127+
this.AllowedActions = new List<string>();
1128+
foreach (var action in job.AllowedActions)
1129+
{
1130+
this.AllowedActions.Add(action);
1131+
}
1132+
}
11141133

11151134
if (!string.IsNullOrEmpty(job.TargetObjectId))
11161135
{
@@ -1164,12 +1183,12 @@ public ASRJob(Job job)
11641183
/// <summary>
11651184
/// Gets or sets Start timestamp.
11661185
/// </summary>
1167-
public string StartTime { get; set; }
1186+
public DateTimeOffset? StartTime { get; set; }
11681187

11691188
/// <summary>
11701189
/// Gets or sets End timestamp.
11711190
/// </summary>
1172-
public string EndTime { get; set; }
1191+
public DateTimeOffset? EndTime { get; set; }
11731192

11741193
/// <summary>
11751194
/// Gets or sets TargetObjectId.

0 commit comments

Comments
 (0)