Skip to content

Commit 159d126

Browse files
committed
Merge pull request #251 from vhamine/dev
HDInsight: Powershell changes for creating/deleting IaaS clusters
2 parents 81cfe93 + 3f55b94 commit 159d126

File tree

10 files changed

+230
-36
lines changed

10 files changed

+230
-36
lines changed

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
<Prefer32Bit>false</Prefer32Bit>
4242
</PropertyGroup>
4343
<ItemGroup>
44+
<Reference Include="BouncyCastle.Crypto">
45+
<HintPath>..\..\..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
46+
</Reference>
4447
<Reference Include="Hyak.Common">
4548
<HintPath>..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
4649
</Reference>
@@ -67,13 +70,11 @@
6770
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6871
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
6972
</Reference>
70-
<Reference Include="Microsoft.Hadoop.Client, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
71-
<SpecificVersion>False</SpecificVersion>
72-
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.Hadoop.Client.dll</HintPath>
73+
<Reference Include="Microsoft.Hadoop.Client">
74+
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.5.5\lib\net45\Microsoft.Hadoop.Client.dll</HintPath>
7375
</Reference>
74-
<Reference Include="Microsoft.HDInsight.Net.Http.Formatting, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
75-
<SpecificVersion>False</SpecificVersion>
76-
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.HDInsight.Net.Http.Formatting.dll</HintPath>
76+
<Reference Include="Microsoft.HDInsight.Net.Http.Formatting">
77+
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.5.5\lib\net45\Microsoft.HDInsight.Net.Http.Formatting.dll</HintPath>
7778
</Reference>
7879
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
7980
<SpecificVersion>False</SpecificVersion>
@@ -93,27 +94,24 @@
9394
</Reference>
9495
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
9596
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
97+
<SpecificVersion>False</SpecificVersion>
9698
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll</HintPath>
9799
</Reference>
98100
<Reference Include="Microsoft.WindowsAzure.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
99101
<SpecificVersion>False</SpecificVersion>
100102
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
101103
</Reference>
102-
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
103-
<SpecificVersion>False</SpecificVersion>
104-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.dll</HintPath>
104+
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight">
105+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.5.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.dll</HintPath>
105106
</Reference>
106-
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Contracts, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
107-
<SpecificVersion>False</SpecificVersion>
108-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Contracts.dll</HintPath>
107+
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Contracts">
108+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.5.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Contracts.dll</HintPath>
109109
</Reference>
110-
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
111-
<SpecificVersion>False</SpecificVersion>
112-
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll</HintPath>
110+
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework">
111+
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.5.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll</HintPath>
113112
</Reference>
114-
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework.Core, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
115-
<SpecificVersion>False</SpecificVersion>
116-
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll</HintPath>
113+
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework.Core">
114+
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.5.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll</HintPath>
117115
</Reference>
118116
<Reference Include="Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
119117
<HintPath>..\..\..\packages\WindowsAzure.Storage.3.0.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightClusterManagementClientSimulator.cs

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,16 @@ public async Task DisableHttpAsync(string dnsName, string location)
279279
Clusters.Add(new SimulatorClusterContainer { Cluster = cluster });
280280
}
281281

282+
public void DisableRdp(string dnsName, string location)
283+
{
284+
this.DisableRdpAsync(dnsName, location).Wait();
285+
}
286+
287+
public async Task DisableRdpAsync(string dnsName, string location)
288+
{
289+
throw new NotImplementedException();
290+
}
291+
282292
public void EnableHttp(string dnsName, string location, string httpUserName, string httpPassword)
283293
{
284294
this.EnableHttpAsync(dnsName, location, httpUserName, httpPassword).Wait();
@@ -293,6 +303,16 @@ public async Task EnableHttpAsync(string dnsName, string location, string httpUs
293303
Clusters.Add(new SimulatorClusterContainer { Cluster = cluster });
294304
}
295305

306+
public void EnableRdp(string dnsName, string location, string rdpUserName, string rdpPassword, DateTime expiryDate)
307+
{
308+
this.EnableRdpAsync(dnsName, location, rdpUserName, rdpPassword, expiryDate).Wait();
309+
}
310+
311+
public async Task EnableRdpAsync(string dnsName, string location, string rdpUserName, string rdpPassword, DateTime expiryDate)
312+
{
313+
throw new NotImplementedException();
314+
}
315+
296316
public ClusterDetails GetCluster(string dnsName)
297317
{
298318
Task<ClusterDetails> getTask = this.GetClusterAsync(dnsName);
@@ -340,12 +360,22 @@ public async Task<ClusterDetails> ChangeClusterSizeAsync(string dnsName, string
340360

341361
public Collection<string> ListAvailableLocations()
342362
{
343-
Task<Collection<string>> listTask = this.ListAvailableLocationsAsync();
363+
return ListAvailableLocations(OSType.Windows);
364+
}
365+
366+
public Task<Collection<string>> ListAvailableLocationsAsync()
367+
{
368+
return ListAvailableLocationsAsync(OSType.Windows);
369+
}
370+
371+
public Collection<string> ListAvailableLocations(OSType osType)
372+
{
373+
Task<Collection<string>> listTask = this.ListAvailableLocationsAsync(osType);
344374
listTask.Wait();
345375
return listTask.Result;
346376
}
347377

348-
public Task<Collection<string>> ListAvailableLocationsAsync()
378+
public Task<Collection<string>> ListAvailableLocationsAsync(OSType osType)
349379
{
350380
return TaskEx2.FromResult(new Collection<string> { "East US", "East US 2", "West US", "North Europe" });
351381
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
34
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
45
<package id="Microsoft.Azure.Common" version="2.0.4" targetFramework="net45" />
56
<package id="Microsoft.Azure.Common.Authentication" version="1.0.15-preview" targetFramework="net45" />
@@ -11,12 +12,12 @@
1112
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
1213
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
1314
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
14-
<package id="Microsoft.Hadoop.Client" version="1.4.5" targetFramework="net45" />
15+
<package id="Microsoft.Hadoop.Client" version="1.5.5" targetFramework="net45" />
1516
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.12.111071459" targetFramework="net45" />
1617
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1718
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net45" />
1819
<package id="Microsoft.WindowsAzure.Management" version="4.0.1" targetFramework="net45" />
19-
<package id="Microsoft.WindowsAzure.Management.HDInsight" version="1.4.5" targetFramework="net45" />
20+
<package id="Microsoft.WindowsAzure.Management.HDInsight" version="1.5.5" targetFramework="net45" />
2021
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
2122
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
2223
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />

src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/NewAzureHDInsightClusterCmdlet.cs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,49 @@ public NewAzureHDInsightClusterCmdlet()
4747
this.command = ServiceLocator.Instance.Locate<IAzureHDInsightCommandFactory>().CreateCreate();
4848
}
4949

50+
/*
51+
* Parameter Sets:
52+
*
53+
* ParameterSetClusterByConfigWithSpecificSubscriptionCredentials
54+
* Position 00: Name
55+
* Position 01: Config
56+
* Position 02: Subscription
57+
* Position 03: Certificate
58+
* Position 04: Location
59+
* Position 05: Credential
60+
* Position 06: ??? (Missed. To be fixed.)
61+
* Position 07: Endpoint
62+
* Position 08: HostedService
63+
* Position 09: Version
64+
* Position 10: OSType
65+
* Position 11: SshCredential
66+
* Position 11: SshPublicKey
67+
*
68+
* ParameterSetClusterByNameWithSpecificSubscriptionCredentials
69+
* Position 00: Name
70+
* Position 01: Subscription
71+
* Position 02: Certificate
72+
* Position 03: Location
73+
* Position 04: DefaultStorageAccountName
74+
* Position 05: DefaultStorageAccountKey
75+
* Position 06: DefaultStorageContainerName
76+
* Position 07: Credential
77+
* Position 08: ??? (Missed. To be fixed.)
78+
* Position 09: ClusterSizeInNodes
79+
* Position 10: Endpoint
80+
* Position 11: HostedService
81+
* Position 12: Version
82+
* Position 13: HeadNodeVMSize
83+
* Position 14: ClusterType
84+
* Position 15: VirtualNetworkId
85+
* Position 16: SubnetName
86+
* Position 17: DataNodeVMSize
87+
* Position 18: ZookeeperNodeVMSize
88+
* Position 19: OSType
89+
* Position 20: SshCredential
90+
* Position 21: SshPublicKey
91+
*/
92+
5093
/// <inheritdoc />
5194
[Parameter(Position = 2, Mandatory = false, HelpMessage = "The management certificate used to manage the Azure subscription.",
5295
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByNameWithSpecificSubscriptionCredentials)]
@@ -117,6 +160,7 @@ public AzureHDInsightConfig Config
117160
result.SparkConfiguration.AddRange(this.command.SparkConfiguration);
118161
result.HBaseConfiguration.AdditionalLibraries = this.command.HBaseConfiguration.AdditionalLibraries;
119162
result.HBaseConfiguration.ConfigurationCollection.AddRange(this.command.HBaseConfiguration.ConfigurationCollection);
163+
120164
return result;
121165
}
122166

@@ -314,6 +358,39 @@ public string ZookeeperNodeVMSize
314358
set { this.command.ZookeeperNodeSize = value; }
315359
}
316360

361+
/// <inheritdoc />
362+
[Parameter(Position = 10, Mandatory = false, HelpMessage = "The type of operating system to install on cluster nodes.",
363+
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByConfigWithSpecificSubscriptionCredentials)]
364+
[Parameter(Position = 19, Mandatory = false, HelpMessage = "The type of operating system to install on cluster nodes.",
365+
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByNameWithSpecificSubscriptionCredentials)]
366+
public OSType OSType
367+
{
368+
get { return this.command.OSType; }
369+
set { this.command.OSType = value; }
370+
}
371+
372+
/// <inheritdoc />
373+
[Parameter(Position = 11, Mandatory = false, HelpMessage = "The credentials for SSH access to the cluster.",
374+
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByConfigWithSpecificSubscriptionCredentials)]
375+
[Parameter(Position = 20, Mandatory = false, HelpMessage = "The credentials for SSH access to the cluster.",
376+
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByNameWithSpecificSubscriptionCredentials)]
377+
public PSCredential SshCredential
378+
{
379+
get { return this.command.SshCredential; }
380+
set { this.command.SshCredential = value; }
381+
}
382+
383+
/// <inheritdoc />
384+
[Parameter(Position = 12, Mandatory = false, HelpMessage = "The public key to use to configure SSH access to the cluster.",
385+
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByConfigWithSpecificSubscriptionCredentials)]
386+
[Parameter(Position = 21, Mandatory = false, HelpMessage = "The public key to use to configure SSH access to the cluster.",
387+
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByNameWithSpecificSubscriptionCredentials)]
388+
public string SshPublicKey
389+
{
390+
get { return this.command.SshPublicKey; }
391+
set { this.command.SshPublicKey = value; }
392+
}
393+
317394
/// <inheritdoc />
318395
protected override void BeginProcessing()
319396
{

0 commit comments

Comments
 (0)