Skip to content
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 @@ -76,7 +76,8 @@ internal ClustersOperations (HDInsightManagementClient client)
/// The resource tags.
/// </param>
/// <param name='identity'>
/// The identity of the cluster, if configured.
/// The identity of the cluster, if configured. Setting this property will
/// override the existing identity configuration of the cluster.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public partial interface IClustersOperations
/// The resource tags.
/// </param>
/// <param name='identity'>
/// The identity of the cluster, if configured.
/// The identity of the cluster, if configured. Setting this property will
/// override the existing identity configuration of the cluster.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public ClusterPatchParameters()
/// <param name="tags">The resource tags.
/// </param>

/// <param name="identity">The identity of the cluster, if configured.
/// <param name="identity">The identity of the cluster, if configured. Setting this property will
/// override the existing identity configuration of the cluster.
/// </param>
public ClusterPatchParameters(System.Collections.Generic.IDictionary<string, string> tags = default(System.Collections.Generic.IDictionary<string, string>), ClusterIdentity identity = default(ClusterIdentity))

Expand All @@ -50,7 +51,8 @@ public ClusterPatchParameters()
public System.Collections.Generic.IDictionary<string, string> Tags {get; set; }

/// <summary>
/// Gets or sets the identity of the cluster, if configured.
/// Gets or sets the identity of the cluster, if configured. Setting this
/// property will override the existing identity configuration of the cluster.
/// </summary>
[Newtonsoft.Json.JsonProperty(PropertyName = "identity")]
public ClusterIdentity Identity {get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/HDInsight/HDInsight.Management.Sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ skip-csproj: true

###
``` yaml
commit: f22b814a1a30517cb6612c8fe071cfbcc64e3a2c
commit: 339220060c53b1f6c04cdfa10dc577a9a961572f
input-file:
- https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/applications.json
- https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2024-08-01-preview/cluster.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,23 @@ public void TestCreateClusterWithPrivateLinkConfiguration()

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestUpdateCluster()
public void TestUpdateClusterTags()
{
TestRunner.RunTestScript("Test-UpdateClusterTagsAndIdentity");
TestRunner.RunTestScript("Test-UpdateClusterTags");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestUpdateClusterSystemAssigned()
{
TestRunner.RunTestScript("Test-UpdateClusterSystemAssigned");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestUpdateClusterUserAssigned()
{
TestRunner.RunTestScript("Test-UpdateClusterUserAssigned");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -534,32 +534,79 @@ function Test-CreateClusterWithPrivateLinkConfiguration{

<#
.SYNOPSIS
Test Update clusterIdentity
Test Update cluster tags
#>

function Test-UpdateClusterTagsAndIdentity{

function Test-UpdateClusterTags{
# Create some resources that will be used throughout test
try
{
$location = "East US"
# prepare parameter for creating parameter
#$params= Prepare-ClusterCreateParameter

# create cluster that will be used throughout test
$cluster = Get-AzHDInsightCluster -ResourceGroupName yuchen-ps-test -ClusterName spark51
Assert-NotNull $cluster
$rg="yuchen-devrp"
$clusterName="yuchen-hadoop-002"

# Update cluster tags
#$tags = @{"tag1"="value1";"tag2"="value2"}
#Update-AzHDInsightCluster -ResourceGroupName yuchen-ps-test -ClusterName spark51 -Tag @{"Tag1"="Value1"; "Tag2"="Value2"}
$tags = New-Object 'System.Collections.Generic.Dictionary[System.String,System.String]'
$tags.Add('Tag3', 'Value3')

$cluster = Update-AzHDInsightCluster -ResourceGroupName $rg -ClusterName $clusterName -Tag $tags
}
finally
{
# Delete cluster and resource group
# Remove-AzResourceGroup -ResourceGroupName $params.resourceGroupName
}
}

# Update cluster identity
# Update-AzHDInsightCluster -ResourceGroupName yuchen-ps-test -ClusterName spark51 -IdentityType SystemAssigned
<#
.SYNOPSIS
Test Update cluster System Assigned Identity
#>
function Test-UpdateClusterSystemAssigned{
try
{
$rg="yuchen-ps-test"
$clusterName="h1-spark"

# Update cluster identity
Update-AzHDInsightCluster -ResourceGroupName yuchen-ps-test -ClusterName spark51 -IdentityType UserAssigned -IdentityId "/subscriptions/964c10bb-8a6c-43bc-83d3-6b318c6c7305/resourceGroups/yuchen-ps-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdi-msi"
$cluster = Update-AzHDInsightCluster -ResourceGroupName $rg -ClusterName $clusterName -IdentityType SystemAssigned

Assert-NotNull $cluster
Assert-AreEqual $cluster.AssignedIdentity.Type SystemAssigned
}
finally
{
# Delete cluster and resource group
# Remove-AzResourceGroup -ResourceGroupName $params.resourceGroupName
}
}

<#
.SYNOPSIS
Test Update cluster User Assigned Identity
#>
function Test-UpdateClusterUserAssigned{
try
{
$rg="yuchen-ps-test"
$clusterName="h1-spark"

# Define the list of Identity IDs
$identityIds = @(
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/yuchen-ps-test/providers/microsoft.managedidentity/userassignedidentities/hdi-msi",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yuchen-devrp/providers/Microsoft.ManagedIdentity/userAssignedIdentities/hdiwasbmsi"
)

$cluster = Update-AzHDInsightCluster -ResourceGroupName $rg -ClusterName $clusterName -IdentityType UserAssigned -IdentityId $identityIds

Assert-NotNull $cluster
Assert-AreEqual $cluster.AssignedIdentity.Type UserAssigned

}
finally
{
# Delete cluster and resource group
# Remove-AzResourceGroup -ResourceGroupName $params.resourceGroupName
}
}
}
Loading