Skip to content

Commit

Permalink
Merge pull request #2 from huangpf/dev
Browse files Browse the repository at this point in the history
AzureRT S42 PR #2
  • Loading branch information
AzureRT committed Dec 5, 2014
2 parents a1e76af + 3744de0 commit 24965c0
Show file tree
Hide file tree
Showing 26 changed files with 61 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common.Test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Storage" version="3.1.0" targetFramework="net45" />
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.ScenarioTest/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Storage" version="3.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.WebSites" version="4.0.1-prerelease" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Storage" version="3.1.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Network" version="4.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Storage" version="3.1.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,14 @@ public void AzureVMImageTest()

string oldLabel = "old label";
string newLabel = "new label";
string vmSize = "Small";
var iconUri = "http://www.bing.com";
var smallIconUri = "http://www.bing.com";
bool showInGui = true;

try
{
OSImageContext result = vmPowershellCmdlets.AddAzureVMImage(newImageName, mediaLocation, OS.Windows, oldLabel);
OSImageContext result = vmPowershellCmdlets.AddAzureVMImage(newImageName, mediaLocation, OS.Windows, oldLabel, vmSize, iconUri, smallIconUri, showInGui);

OSImageContext resultReturned = vmPowershellCmdlets.GetAzureVMImage(newImageName)[0];
Assert.IsTrue(!string.IsNullOrEmpty(resultReturned.IOType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@ public AddAzureVMImageCmdletInfo(string imageName, string mediaLocation, OS os,
}
}

public AddAzureVMImageCmdletInfo(string imageName, string mediaLocation, OS os, string label, string recommendedSize, string iconUri, string smallIconUri, bool showInGui)
: this(imageName, mediaLocation, os, label, recommendedSize)
{
if (!string.IsNullOrEmpty(iconUri))
{
cmdletParams.Add(new CmdletParam("IconUri", iconUri));
}

if (!string.IsNullOrEmpty(iconUri))
{
cmdletParams.Add(new CmdletParam("SmallIconUri", smallIconUri));
}

if (showInGui)
{
cmdletParams.Add(new CmdletParam("ShowInGui"));
}
}

public AddAzureVMImageCmdletInfo(
string imageName,
string mediaLocation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1356,11 +1356,11 @@ public ManagementOperationContext UpdateAzureVM(string vmName, string serviceNam

#region AzureVMImage

public SM.OSImageContext AddAzureVMImage(string imageName, string mediaLocation, OS os, string label = null, string recommendedSize = null)
public SM.OSImageContext AddAzureVMImage(string imageName, string mediaLocation, OS os, string label = null, string recommendedSize = null, string iconUri = null, string smallIconUri = null, bool showInGui = false)
{
SM.OSImageContext result = new SM.OSImageContext();
Utilities.RetryActionUntilSuccess(
() => result = RunPSCmdletAndReturnFirst<SM.OSImageContext>(new AddAzureVMImageCmdletInfo(imageName, mediaLocation, os, label, recommendedSize)),
() => result = RunPSCmdletAndReturnFirst<SM.OSImageContext>(new AddAzureVMImageCmdletInfo(imageName, mediaLocation, os, label, recommendedSize, iconUri, smallIconUri, showInGui)),
"409", 3, 60);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Network" version="4.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Storage" version="3.1.0" targetFramework="net45" />
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Network, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ public class AddAzureVMImage : ServiceManagementBaseCmdlet
[Parameter(Position = 9, ValueFromPipelineByPropertyName = true, HelpMessage = " Specifies the size to use for the virtual machine that is created from the OS image.")]
public string RecommendedVMSize { get; set; }

[Parameter(Position = 10, ValueFromPipelineByPropertyName = true, HelpMessage = "Icon Uri.")]
public Uri IconUri { get; set; }

[Parameter(Position = 11, ValueFromPipelineByPropertyName = true, HelpMessage = "Small Icon Uri.")]
public Uri SmallIconUri { get; set; }

[Parameter(Position = 12, ValueFromPipelineByPropertyName = true, HelpMessage = "To show in GUI.")]
public SwitchParameter ShowInGui { get; set; }

public void ExecuteCommand()
{
var imageType = new VirtualMachineImageHelper(this.ComputeClient).GetImageType(this.ImageName);
Expand Down Expand Up @@ -94,7 +103,10 @@ public void ExecuteCommand()
ImageFamily = this.ImageFamily,
PublishedDate = this.PublishedDate,
PrivacyUri = this.PrivacyUri,
RecommendedVMSize = this.RecommendedVMSize
RecommendedVMSize = this.RecommendedVMSize,
IconUri = this.IconUri,
SmallIconUri = this.SmallIconUri,
ShowInGui = this.ShowInGui
};

this.ExecuteClientActionNewSM(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Network" version="4.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Storage" version="3.1.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.MediaServices">
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.MediaServices.2.0.0\lib\net40\Microsoft.WindowsAzure.Management.MediaServices.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<package id="Microsoft.WindowsAzure.Common" version="1.4.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Libraries" version="2.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.MediaServices" version="2.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Monitoring" version="1.0.0" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<package id="Microsoft.WindowsAzure.Common" version="1.4.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Storage" version="3.1.0" targetFramework="net45" />
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.ExpressRoute, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.16.2-preview" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.MediaServices" version="1.2.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.ServiceBus" version="0.15.0-preview" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.ExpressRoute, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<package id="Microsoft.WindowsAzure.Common.Dependencies" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Compute" version="6.1.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.11.2-preview" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.MediaServices" version="1.2.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.Network" version="4.1.0" targetFramework="net45" />
Expand Down
Loading

0 comments on commit 24965c0

Please sign in to comment.