Skip to content

HDInsight: Powershell changes for creating/deleting IaaS clusters #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\..\..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Hyak.Common">
<HintPath>..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
</Reference>
Expand All @@ -67,13 +70,11 @@
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Hadoop.Client, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.Hadoop.Client.dll</HintPath>
<Reference Include="Microsoft.Hadoop.Client">
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.5.5\lib\net45\Microsoft.Hadoop.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.HDInsight.Net.Http.Formatting, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.HDInsight.Net.Http.Formatting.dll</HintPath>
<Reference Include="Microsoft.HDInsight.Net.Http.Formatting">
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.5.5\lib\net45\Microsoft.HDInsight.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<SpecificVersion>False</SpecificVersion>
Expand All @@ -93,27 +94,24 @@
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.dll</HintPath>
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight">
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.5.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Contracts, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Contracts.dll</HintPath>
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Contracts">
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.5.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Contracts.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll</HintPath>
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework">
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.5.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework.Core, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll</HintPath>
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework.Core">
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.5.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\WindowsAzure.Storage.3.0.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,16 @@ public async Task DisableHttpAsync(string dnsName, string location)
Clusters.Add(new SimulatorClusterContainer { Cluster = cluster });
}

public void DisableRdp(string dnsName, string location)
{
this.DisableRdpAsync(dnsName, location).Wait();
}

public async Task DisableRdpAsync(string dnsName, string location)
{
throw new NotImplementedException();
}

public void EnableHttp(string dnsName, string location, string httpUserName, string httpPassword)
{
this.EnableHttpAsync(dnsName, location, httpUserName, httpPassword).Wait();
Expand All @@ -293,6 +303,16 @@ public async Task EnableHttpAsync(string dnsName, string location, string httpUs
Clusters.Add(new SimulatorClusterContainer { Cluster = cluster });
}

public void EnableRdp(string dnsName, string location, string rdpUserName, string rdpPassword, DateTime expiryDate)
{
this.EnableRdpAsync(dnsName, location, rdpUserName, rdpPassword, expiryDate).Wait();
}

public async Task EnableRdpAsync(string dnsName, string location, string rdpUserName, string rdpPassword, DateTime expiryDate)
{
throw new NotImplementedException();
}

public ClusterDetails GetCluster(string dnsName)
{
Task<ClusterDetails> getTask = this.GetClusterAsync(dnsName);
Expand Down Expand Up @@ -340,12 +360,22 @@ public async Task<ClusterDetails> ChangeClusterSizeAsync(string dnsName, string

public Collection<string> ListAvailableLocations()
{
Task<Collection<string>> listTask = this.ListAvailableLocationsAsync();
return ListAvailableLocations(OSType.Windows);
}

public Task<Collection<string>> ListAvailableLocationsAsync()
{
return ListAvailableLocationsAsync(OSType.Windows);
}

public Collection<string> ListAvailableLocations(OSType osType)
{
Task<Collection<string>> listTask = this.ListAvailableLocationsAsync(osType);
listTask.Wait();
return listTask.Result;
}

public Task<Collection<string>> ListAvailableLocationsAsync()
public Task<Collection<string>> ListAvailableLocationsAsync(OSType osType)
{
return TaskEx2.FromResult(new Collection<string> { "East US", "East US 2", "West US", "North Europe" });
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.0.4" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.15-preview" targetFramework="net45" />
Expand All @@ -11,12 +12,12 @@
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.Hadoop.Client" version="1.4.5" targetFramework="net45" />
<package id="Microsoft.Hadoop.Client" version="1.5.5" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.12.111071459" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="4.0.1" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.HDInsight" version="1.4.5" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management.HDInsight" version="1.5.5" targetFramework="net45" />
<package id="Moq" version="4.2.1402.2112" 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 @@ -47,6 +47,49 @@ public NewAzureHDInsightClusterCmdlet()
this.command = ServiceLocator.Instance.Locate<IAzureHDInsightCommandFactory>().CreateCreate();
}

/*
* Parameter Sets:
*
* ParameterSetClusterByConfigWithSpecificSubscriptionCredentials
* Position 00: Name
* Position 01: Config
* Position 02: Subscription
* Position 03: Certificate
* Position 04: Location
* Position 05: Credential
* Position 06: ??? (Missed. To be fixed.)
* Position 07: Endpoint
* Position 08: HostedService
* Position 09: Version
* Position 10: OSType
* Position 11: SshCredential
* Position 11: SshPublicKey
*
* ParameterSetClusterByNameWithSpecificSubscriptionCredentials
* Position 00: Name
* Position 01: Subscription
* Position 02: Certificate
* Position 03: Location
* Position 04: DefaultStorageAccountName
* Position 05: DefaultStorageAccountKey
* Position 06: DefaultStorageContainerName
* Position 07: Credential
* Position 08: ??? (Missed. To be fixed.)
* Position 09: ClusterSizeInNodes
* Position 10: Endpoint
* Position 11: HostedService
* Position 12: Version
* Position 13: HeadNodeVMSize
* Position 14: ClusterType
* Position 15: VirtualNetworkId
* Position 16: SubnetName
* Position 17: DataNodeVMSize
* Position 18: ZookeeperNodeVMSize
* Position 19: OSType
* Position 20: SshCredential
* Position 21: SshPublicKey
*/

/// <inheritdoc />
[Parameter(Position = 2, Mandatory = false, HelpMessage = "The management certificate used to manage the Azure subscription.",
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByNameWithSpecificSubscriptionCredentials)]
Expand Down Expand Up @@ -117,6 +160,7 @@ public AzureHDInsightConfig Config
result.SparkConfiguration.AddRange(this.command.SparkConfiguration);
result.HBaseConfiguration.AdditionalLibraries = this.command.HBaseConfiguration.AdditionalLibraries;
result.HBaseConfiguration.ConfigurationCollection.AddRange(this.command.HBaseConfiguration.ConfigurationCollection);

return result;
}

Expand Down Expand Up @@ -314,6 +358,39 @@ public string ZookeeperNodeVMSize
set { this.command.ZookeeperNodeSize = value; }
}

/// <inheritdoc />
[Parameter(Position = 10, Mandatory = false, HelpMessage = "The type of operating system to install on cluster nodes.",
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByConfigWithSpecificSubscriptionCredentials)]
[Parameter(Position = 19, Mandatory = false, HelpMessage = "The type of operating system to install on cluster nodes.",
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByNameWithSpecificSubscriptionCredentials)]
public OSType OSType
{
get { return this.command.OSType; }
set { this.command.OSType = value; }
}

/// <inheritdoc />
[Parameter(Position = 11, Mandatory = false, HelpMessage = "The credentials for SSH access to the cluster.",
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByConfigWithSpecificSubscriptionCredentials)]
[Parameter(Position = 20, Mandatory = false, HelpMessage = "The credentials for SSH access to the cluster.",
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByNameWithSpecificSubscriptionCredentials)]
public PSCredential SshCredential
{
get { return this.command.SshCredential; }
set { this.command.SshCredential = value; }
}

/// <inheritdoc />
[Parameter(Position = 12, Mandatory = false, HelpMessage = "The public key to use to configure SSH access to the cluster.",
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByConfigWithSpecificSubscriptionCredentials)]
[Parameter(Position = 21, Mandatory = false, HelpMessage = "The public key to use to configure SSH access to the cluster.",
ParameterSetName = AzureHdInsightPowerShellConstants.ParameterSetClusterByNameWithSpecificSubscriptionCredentials)]
public string SshPublicKey
{
get { return this.command.SshPublicKey; }
set { this.command.SshPublicKey = value; }
}

/// <inheritdoc />
protected override void BeginProcessing()
{
Expand Down
Loading