Skip to content

Commit 9488b6f

Browse files
author
Zhenyu Zhou
committed
1. Merge az.hdinsight-preview and master branch for ignite release
2. Remove some breaking change notice and related alias 3. modify the release notes in changelog and psd1 file
1 parent 50bba17 commit 9488b6f

28 files changed

+6880
-2061
lines changed

src/HDInsight/HDInsight.Test/ScenarioTests/Common.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Create cluster
3535
function Create-Cluster{
3636
param(
3737
[string] $clusterName="hdi-ps-test",
38-
[string] $location="North Central US",
38+
[string] $location="West US",
3939
[string] $resourceGroupName="group-ps-test",
4040
[string] $clusterType="Spark",
4141
[string] $storageAccountName="storagepstest"

src/HDInsight/HDInsight.Test/ScenarioTests/HDInsightClusterTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414

1515
using Microsoft.Azure.ServiceManagement.Common.Models;
1616
using Microsoft.WindowsAzure.Commands.ScenarioTest;
17-
using System;
18-
using System.Collections.Generic;
19-
using System.Text;
2017
using Xunit;
2118
using Xunit.Abstractions;
2219

src/HDInsight/HDInsight.Test/SessionRecords/Commands.HDInsight.Test.ScenarioTests.HDInsightClusterTests/TestClusterRelatedCommands.json

Lines changed: 1922 additions & 583 deletions
Large diffs are not rendered by default.

src/HDInsight/HDInsight.Test/SessionRecords/Commands.HDInsight.Test.ScenarioTests.HDInsightMonitoringTests/TestMonitoringRelatedCommands.json

Lines changed: 1870 additions & 539 deletions
Large diffs are not rendered by default.

src/HDInsight/HDInsight.Test/SessionRecords/Commands.HDInsight.Test.ScenarioTests.HDInsightScriptActionTests/TestScriptActionRelatedCommands.json

Lines changed: 1715 additions & 508 deletions
Large diffs are not rendered by default.

src/HDInsight/HDInsight.Test/SessionRecords/Commands.HDInsight.Test.ScenarioTests.HDInsightSetGatewayCredentialTest/TestSetGatewayCredential.json

Lines changed: 1244 additions & 333 deletions
Large diffs are not rendered by default.

src/HDInsight/HDInsight.Test/UnitTests/GetPropertiesTests.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Commands.HDInsight.Models.Management;
1516
using Microsoft.Azure.Management.HDInsight.Models;
1617
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1718
using Moq;
@@ -42,18 +43,21 @@ public GetPropertiesTests(Xunit.Abstractions.ITestOutputHelper output)
4243
public void CanGetProperties()
4344
{
4445
var features = new string[] { "feature1", "feature2" };
45-
var versions = new Dictionary<string, AzHDInsightVersionsCapability> { { "key", new VersionsCapability() } };
46+
var versions = new Dictionary<string, VersionsCapability> { { "key", new VersionsCapability() } };
4647
var vm = new Dictionary<string, VmSizesCapability> { { "key1", new VmSizesCapability() } };
4748
var regions = new Dictionary<string, RegionsCapability> { { "eastus", new RegionsCapability() } };
48-
var propertiesResponse = new CapabilitiesResponse
49+
var capabilitiesResult = new CapabilitiesResult
4950
{
5051
Features = features,
5152
Versions = versions,
5253
VmSizes = vm,
5354
Regions = regions
5455
};
55-
hdinsightManagementMock.Setup(c => c.GetCapabilities(Location))
56-
.Returns(propertiesResponse)
56+
57+
var propertiesResponse = new AzureHDInsightCapabilities(capabilitiesResult);
58+
59+
hdinsightManagementMock.Setup(c => c.GetProperties(Location))
60+
.Returns(capabilitiesResult)
5761
.Verifiable();
5862

5963
cmdlet.ExecuteCmdlet();
@@ -62,10 +66,12 @@ public void CanGetProperties()
6266
commandRuntimeMock.Verify(
6367
f =>
6468
f.WriteObject(
65-
It.Is<CapabilitiesResponse>(
69+
It.Is<AzureHDInsightCapabilities>(
6670
resp =>
67-
resp.Features == features && resp.Regions == regions &&
68-
resp.Versions == versions && resp.VmSizes == vm)),
71+
resp.Features == propertiesResponse.Features
72+
&& resp.Regions["eastus"].Available == propertiesResponse.Regions["eastus"].Available
73+
&& resp.Versions.Count == propertiesResponse.Versions.Count
74+
&& resp.VmSizes["key1"].Available == propertiesResponse.VmSizes["key1"].Available), true),
6975
Times.Once);
7076
}
7177
}

src/HDInsight/HDInsight.Test/UnitTests/HttpTests.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Commands.HDInsight.Models.Management;
1516
using Microsoft.Azure.Management.HDInsight.Models;
1617
using Microsoft.WindowsAzure.Commands.Common;
1718
using Microsoft.WindowsAzure.Commands.ScenarioTest;
@@ -69,7 +70,14 @@ public void CanSetGatewayCredentialSupportsShouldProcess()
6970
setcmdlet.ExecuteCmdlet();
7071

7172
commandRuntimeMock.VerifyAll();
72-
commandRuntimeMock.Verify(f => f.WriteObject(gatewaySettings), Times.Once);
73+
commandRuntimeMock.Verify(
74+
f => f.WriteObject(
75+
It.Is<AzureHDInsightGatewaySettings>(
76+
rsp =>
77+
rsp.IsCredentialEnabled == gatewaySettings.IsCredentialEnabled
78+
&& rsp.UserName == gatewaySettings.UserName
79+
&& rsp.Password == gatewaySettings.Password)),
80+
Times.Once);
7381
}
7482
}
7583
}

src/HDInsight/HDInsight/Az.HDInsight.psd1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '3.0.0'
15+
ModuleVersion = '2.0.2'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -133,7 +133,9 @@ PrivateData = @{
133133
# IconUri = ''
134134

135135
# ReleaseNotes of this module
136-
ReleaseNotes = '* Changed Microsoft.Azure.Management.HDInsight from 2.1.0 to 5.1.0
136+
ReleaseNotes = '* Fixed the bug that customer will get "Not a valid Base-64 string" error when using Get-AzHDInsightCluster to get the cluster with ADLSGen1 storage.
137+
* Add a parameter named "ApplicationId" to three cmdlets Add-AzHDInsightClusterIdentity, New-AzHDInsightClusterConfig and New-AzHDInsightCluster so that customer can provide the service principal application id for accessing Azure Data Lake.
138+
* Changed Microsoft.Azure.Management.HDInsight from 2.1.0 to 5.1.0
137139
* Removed five cmdlets:
138140
- Get-AzHDInsightOMS
139141
- Enable-AzHDInsightOMS
@@ -151,8 +153,8 @@ PrivateData = @{
151153
* - Changed the output type of Get-AzHDInsightProperties from CapabilitiesResponse to AzureHDInsightCapabilities.
152154
* - Changed the output type of Remove-AzHDInsightCluster from ClusterGetResponse to bool.
153155
* - Changed the output type of Set-AzHDInsightGatewaySettings HttpConnectivitySettings to GatewaySettings.
154-
* Added Scenario Test Framework and added some scenario test cases.'
155-
* Removed alias 'Add-AzHDInsightConfigValues' and 'Get-AzHDInsightProperties'.
156+
* Added Scenario Test Framework and added some scenario test cases.
157+
* Removed alias "Add-AzHDInsightConfigValues" and "Get-AzHDInsightProperties".'
156158

157159
# Prerelease string of this module
158160
# Prerelease = ''

src/HDInsight/HDInsight/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fixed the bug that customer will get "Not a valid Base-64 string" error when using Get-AzHDInsightCluster to get the cluster with ADLSGen1 storage.
22+
* Add a parameter named "ApplicationId" to three cmdlets Add-AzHDInsightClusterIdentity, New-AzHDInsightClusterConfig and New-AzHDInsightCluster so that customer can provide the service principal application id for accessing Azure Data Lake.
2123
* Changed Microsoft.Azure.Management.HDInsight from 2.1.0 to 5.1.0
2224
* Removed five cmdlets:
2325
- Get-AzHDInsightOMS

src/HDInsight/HDInsight/JobCommands/GetAzureHDInsightJobOutputCommand.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,16 @@
1717
using Microsoft.Azure.Commands.HDInsight.Models;
1818
using Microsoft.Azure.Commands.HDInsight.Models.Job;
1919
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
20-
using Microsoft.Azure.Management.HDInsight;
2120
using Microsoft.Azure.Management.HDInsight.Job.Models;
2221
using Microsoft.Azure.Management.HDInsight.Models;
2322
using Microsoft.WindowsAzure.Commands.Common;
24-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2523
using System;
2624
using System.Collections.Generic;
2725
using System.IO;
28-
using System.Linq;
2926
using System.Management.Automation;
3027

3128
namespace Microsoft.Azure.Commands.HDInsight
3229
{
33-
[GenericBreakingChange("Users with reader role need to specify `DefaultStorageAccountKey` parameter explicitly, otherwise error occurs.", "2.0.0", "05/06/2019")]
3430
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HDInsightJobOutput"), OutputType(typeof(string))]
3531
public class GetAzureHDInsightJobOutputCommand : HDInsightCmdletBase
3632
{

src/HDInsight/HDInsight/ManagementCommands/DisableAzureHDInsightMonitoringCommand.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
using Microsoft.Azure.Commands.HDInsight.Commands;
1616
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
17-
using Microsoft.Azure.Management.HDInsight.Models;
18-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1917
using System.Management.Automation;
2018

2119
namespace Microsoft.Azure.Commands.HDInsight

src/HDInsight/HDInsight/ManagementCommands/EnableAzureHDInsightMonitoringCommand.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
using Microsoft.Azure.Commands.HDInsight.Commands;
1717
using Microsoft.Azure.Management.HDInsight.Models;
1818
using System.Management.Automation;
19-
using System.IO;
20-
using System.Reflection;
21-
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
2219
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
23-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2420

2521
namespace Microsoft.Azure.Commands.HDInsight
2622
{

src/HDInsight/HDInsight/ManagementCommands/GetAzureHDInsightClusterCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
using Microsoft.Azure.Commands.HDInsight.Commands;
1616
using Microsoft.Azure.Commands.HDInsight.Models;
1717
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
18-
using System.Collections.Generic;
1918
using System.Linq;
2019
using System.Management.Automation;
2120

src/HDInsight/HDInsight/ManagementCommands/GetAzureHDInsightMonitoringCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
using Microsoft.Azure.Commands.HDInsight.Commands;
1616
using Microsoft.Azure.Commands.HDInsight.Models.Management;
1717
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
18-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1918
using System.Management.Automation;
2019

2120
namespace Microsoft.Azure.Commands.HDInsight

src/HDInsight/HDInsight/ManagementCommands/GetAzureHDInsightPropertiesCommand.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
using Microsoft.Azure.Commands.HDInsight.Commands;
1616
using Microsoft.Azure.Commands.HDInsight.Models.Management;
1717
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
18-
using Microsoft.Azure.Management.HDInsight.Models;
19-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2018
using System.Management.Automation;
2119

2220
namespace Microsoft.Azure.Commands.HDInsight

src/HDInsight/HDInsight/ManagementCommands/RemoveAzureHDInsightClusterCommand.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
using Microsoft.Azure.Commands.HDInsight.Commands;
1616
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
17-
using Microsoft.Azure.Management.HDInsight.Models;
18-
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1917
using System.Management.Automation;
2018

2119
namespace Microsoft.Azure.Commands.HDInsight
@@ -35,6 +33,9 @@ public class RemoveAzureHDInsightCommand : HDInsightCmdletBase
3533
[ResourceGroupCompleter]
3634
public string ResourceGroupName { get; set; }
3735

36+
[Parameter(Mandatory = false)]
37+
public SwitchParameter PassThru { get; set; }
38+
3839
#endregion
3940

4041
public override void ExecuteCmdlet()
@@ -46,7 +47,10 @@ public override void ExecuteCmdlet()
4647

4748
HDInsightManagementClient.DeleteCluster(ResourceGroupName, ClusterName);
4849

49-
WriteObject(true);
50+
if (this.PassThru.IsPresent)
51+
{
52+
WriteObject(true);
53+
}
5054
}
5155
}
5256
}

src/HDInsight/HDInsight/ManagementCommands/SetAzureHDInsightGatewayCredentialCommand.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Hyak.Common;
1616
using Microsoft.Azure.Commands.HDInsight.Commands;
1717
using Microsoft.Azure.Commands.HDInsight.Models;
18+
using Microsoft.Azure.Commands.HDInsight.Models.Management;
1819
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1920
using Microsoft.Azure.Management.HDInsight.Models;
2021
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
@@ -24,7 +25,7 @@
2425

2526
namespace Microsoft.Azure.Commands.HDInsight
2627
{
27-
[Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HDInsightGatewayCredential", DefaultParameterSetName = SetByNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(GatewaySettings))]
28+
[Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "HDInsightGatewayCredential", DefaultParameterSetName = SetByNameParameterSet, SupportsShouldProcess = true), OutputType(typeof(AzureHDInsightGatewaySettings))]
2829
public class SetAzureHDInsightGatewayCredentialCommand : HDInsightCmdletBase
2930
{
3031
private const string SetByNameParameterSet = "SetByNameParameterSet";
@@ -126,7 +127,7 @@ public override void ExecuteCmdlet()
126127
if (ShouldProcess(Name, "set gateway http credential"))
127128
{
128129
HDInsightManagementClient.UpdateGatewayCredential(ResourceGroupName, Name, updateGatewaySettingsParameters);
129-
WriteObject(HDInsightManagementClient.GetGatewaySettings(ResourceGroupName, Name));
130+
WriteObject(new AzureHDInsightGatewaySettings(HDInsightManagementClient.GetGatewaySettings(ResourceGroupName, Name)));
130131
}
131132
}
132133
}

src/HDInsight/HDInsight/Models/Management/AzureHDInsightCapabilities.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Management.HDInsight.Models;
16-
using System;
1716
using System.Collections.Generic;
1817
using System.Linq;
19-
using System.Text;
2018

2119
namespace Microsoft.Azure.Commands.HDInsight.Models.Management
2220
{
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Management.HDInsight.Models;
16+
17+
namespace Microsoft.Azure.Commands.HDInsight.Models.Management
18+
{
19+
public class AzureHDInsightGatewaySettings
20+
{
21+
public AzureHDInsightGatewaySettings(GatewaySettings gatewaySettings)
22+
{
23+
this.IsCredentialEnabled = gatewaySettings.IsCredentialEnabled;
24+
this.UserName = gatewaySettings.UserName;
25+
this.Password = gatewaySettings.Password;
26+
}
27+
28+
/// <summary>
29+
/// indicates whether or not the gateway settings based authorization is enabled.
30+
/// </summary>
31+
public string IsCredentialEnabled { get; set; }
32+
33+
/// <summary>
34+
/// the gateway settings user name.
35+
/// </summary>
36+
public string UserName { get; set; }
37+
38+
/// <summary>
39+
/// the gateway settings user password.
40+
/// </summary>
41+
public string Password { get; set; }
42+
}
43+
}

src/HDInsight/HDInsight/Models/Management/AzureHDInsightRegionsCapability.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using Microsoft.Azure.Management.HDInsight.Models;
2-
using System;
3-
// ----------------------------------------------------------------------------------
1+
// ----------------------------------------------------------------------------------
42
//
53
// Copyright Microsoft Corporation
64
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,8 +12,8 @@
1412
// limitations under the License.
1513
// ----------------------------------------------------------------------------------
1614

15+
using Microsoft.Azure.Management.HDInsight.Models;
1716
using System.Collections.Generic;
18-
using System.Text;
1917

2018
namespace Microsoft.Azure.Commands.HDInsight.Models.Management
2119
{
@@ -26,6 +24,9 @@ public AzureHDInsightRegionsCapability(RegionsCapability regionsCapability)
2624
this.Available = regionsCapability?.Available;
2725
}
2826

27+
/// <summary>
28+
/// Available region capability.
29+
/// </summary>
2930
public IList<string> Available { get; set; }
3031
}
3132
}

src/HDInsight/HDInsight/help/Disable-AzHDInsightMonitoring.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,7 @@ The **Disable-AzHDInsightMonitoring** cmdlet disables monitoring in a Azure HDIn
2626
```
2727
PS C:\> Disable-AzHDInsightMonitoring -Name testcluster
2828
29-
ErrorInfo :
30-
31-
State : Succeeded
32-
33-
RequestId : 1417ad86-d055-48cd-9d68-a5c19a212a3a
34-
35-
StatusCode : OK
29+
True
3630
```
3731

3832
Monitoring will be disabled on the HDInsight cluster and relevant logs will stop flowing to the monitoring workspace.
@@ -41,13 +35,7 @@ Monitoring will be disabled on the HDInsight cluster and relevant logs will stop
4135
```
4236
PS C:\> Disable-AzHDInsightMonitoring -Name testcluster -ResourceGroupName testrg
4337
44-
ErrorInfo :
45-
46-
State : Succeeded
47-
48-
RequestId : 1417ad86-d055-48cd-9d68-a5c19a212a3a
49-
50-
StatusCode : OK
38+
True
5139
```
5240

5341
Monitoring will be disabled on the HDInsight cluster and relevant logs will stop flowing to the monitoring workspace.
@@ -138,7 +126,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
138126
139127
## OUTPUTS
140128
141-
### Microsoft.Azure.Management.HDInsight.Models.OperationResource
129+
### System.Boolean
142130
143131
## NOTES
144132

0 commit comments

Comments
 (0)