@@ -14,18 +14,19 @@ function Test-KustoClusterLifecycle
14
14
$updatedSku = Get-Updated - Sku
15
15
$resourceType = Get-Cluster - Resource- Type
16
16
$expectedException = Get-Cluster - Not- Exist- Message - ResourceGroupName $resourceGroupName - ClusterName $clusterName
17
+ $capacity = Get-Cluster - Default- Capacity
17
18
18
19
New-AzResourceGroup - Name $resourceGroupName - Location $RGlocation
19
20
20
- $clusterCreated = New-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName - Location $location - Sku $sku
21
- Validate_Cluster $clusterCreated $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $sku ;
21
+ $clusterCreated = New-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName - Location $location - Sku $sku
22
+ Validate_Cluster $clusterCreated $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $sku $capacity
22
23
23
24
[array ]$clusterGet = Get-AzKustoCluster - ResourceGroupName $resourceGroupName
24
25
$clusterGetItem = $clusterGet [0 ]
25
- Validate_Cluster $clusterGetItem $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $sku ;
26
+ Validate_Cluster $clusterGetItem $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $sku $capacity
26
27
27
28
$updatedCluster = Update-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName - SkuName $updatedSku - Tier " standard"
28
- Validate_Cluster $updatedCluster $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $updatedSku ;
29
+ Validate_Cluster $updatedCluster $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $updatedSku $capacity
29
30
30
31
Remove-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName
31
32
Ensure_Cluster_Not_Exist $resourceGroupName $clusterName $expectedException
@@ -107,7 +108,6 @@ function Test-KustoClusterName
107
108
}
108
109
109
110
function Test-KustoClusterUpdate {
110
-
111
111
try
112
112
{
113
113
$RGlocation = Get-RG - Location
@@ -117,21 +117,25 @@ function Test-KustoClusterUpdate{
117
117
$sku = Get-Sku
118
118
$updatedSku = Get-Updated - Sku
119
119
$resourceType = Get-Cluster - Resource- Type
120
+ $capacity = Get-Cluster - Capacity
121
+ $updatedCapacity = Get-Cluster - Updated- Capacity
122
+
123
+ New-AzureRmResourceGroup - Name $resourceGroupName - Location $RGlocation
124
+ $clusterCreated = New-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName - Location $location - Sku $sku - Capacity $capacity
125
+ Validate_Cluster $clusterCreated $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $sku $capacity
120
126
121
- New-AzResourceGroup - Name $resourceGroupName - Location $RGlocation
122
- $clusterCreated = New-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName - Location $location - Sku $sku
123
127
124
128
# Test update with parameters
125
129
$updatedClusterWithParameters = Update-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName - SkuName $updatedSku - Tier " standard"
126
- Validate_Cluster $updatedClusterWithParameters $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $updatedSku ;
130
+ Validate_Cluster $updatedClusterWithParameters $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $updatedSku $capacity
127
131
128
132
# Test update with ResourceId
129
- $updatedWithResourceId = Update-AzKustoCluster - ResourceId $updatedClusterWithParameters.Id - SkuName $sku - Tier " standard"
130
- Validate_Cluster $updatedWithResourceId $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $sku ;
133
+ $updatedWithResourceId = Update-AzKustoCluster - ResourceId $updatedClusterWithParameters.Id - SkuName $sku - Tier " standard" - Capacity $updatedCapacity
134
+ Validate_Cluster $updatedWithResourceId $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $sku $updatedCapacity
131
135
132
136
# Test update with InputObject
133
- $updatedClusterWithInputObject = Update-AzKustoCluster - InputObject $updatedWithResourceId - SkuName $updatedSku - Tier " standard"
134
- Validate_Cluster $updatedClusterWithInputObject $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $updatedSku ;
137
+ $updatedClusterWithInputObject = Update-AzKustoCluster - InputObject $updatedWithResourceId - SkuName $updatedSku - Tier " standard" - Capacity $capacity
138
+ Validate_Cluster $updatedClusterWithInputObject $clusterName $resourceGroupName $location " Running" " Succeeded" $resourceType $updatedSku $capacity
135
139
}
136
140
finally
137
141
{
@@ -150,36 +154,37 @@ function Test-KustoClusterSuspendResume{
150
154
$resourceGroupName = Get-RG - Name
151
155
$clusterName = Get-Cluster - Name
152
156
$sku = Get-Sku
157
+ $capacity = Get-Cluster - Default- Capacity
153
158
154
159
New-AzResourceGroup - Name $resourceGroupName - Location $RGlocation
155
160
$clusterCreated = New-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName - Location $location - Sku $sku
156
161
157
162
# Suspend and resume cluster using parameters
158
163
Suspend-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName
159
164
$suspendedClusterWithParameters = Get-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName
160
- Validate_Cluster $suspendedClusterWithParameters $clusterName $resourceGroupName $suspendedClusterWithParameters.Location " Stopped" " Succeeded" $suspendedClusterWithParameters.Type $suspendedClusterWithParameters.Sku ;
165
+ Validate_Cluster $suspendedClusterWithParameters $clusterName $resourceGroupName $suspendedClusterWithParameters.Location " Stopped" " Succeeded" $suspendedClusterWithParameters.Type $suspendedClusterWithParameters.Sku $suspendedClusterWithParameters .Capacity
161
166
162
167
Resume-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName
163
168
$runningClusterWithParameters = Get-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName
164
- Validate_Cluster $runningClusterWithParameters $clusterName $resourceGroupName $runningClusterWithParameters.Location " Running" " Succeeded" $runningClusterWithParameters.Type $runningClusterWithParameters.Sku ;
169
+ Validate_Cluster $runningClusterWithParameters $clusterName $resourceGroupName $runningClusterWithParameters.Location " Running" " Succeeded" $runningClusterWithParameters.Type $runningClusterWithParameters.Sku $runningClusterWithParameters .Capacity
165
170
166
171
# Suspend and resume cluster using ResourceId
167
172
Suspend-AzKustoCluster - ResourceId $runningClusterWithParameters.Id
168
173
$suspendedClusterWithResourceId = Get-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName
169
- Validate_Cluster $suspendedClusterWithResourceId $clusterName $resourceGroupName $suspendedClusterWithResourceId.Location " Stopped" " Succeeded" $suspendedClusterWithResourceId.Type $suspendedClusterWithResourceId.Sku ;
174
+ Validate_Cluster $suspendedClusterWithResourceId $clusterName $resourceGroupName $suspendedClusterWithResourceId.Location " Stopped" " Succeeded" $suspendedClusterWithResourceId.Type $suspendedClusterWithResourceId.Sku $suspendedClusterWithResourceId .Capacity
170
175
171
176
Resume-AzKustoCluster - ResourceId $suspendedClusterWithResourceId.Id
172
177
$runningClusterWithResourceId = Get-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName
173
- Validate_Cluster $runningClusterWithResourceId $clusterName $resourceGroupName $runningClusterWithResourceId.Location " Running" " Succeeded" $suspendedClusterWithResourceId.Type $runningClusterWithResourceId.Sku ;
178
+ Validate_Cluster $runningClusterWithResourceId $clusterName $resourceGroupName $runningClusterWithResourceId.Location " Running" " Succeeded" $suspendedClusterWithResourceId.Type $runningClusterWithResourceId.Sku $runningClusterWithResourceId .Capacity
174
179
175
180
# Suspend and resume cluster using InputObject
176
181
Suspend-AzKustoCluster - InputObject $runningClusterWithResourceId
177
182
$suspendedClusterWithInputObject = Get-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName
178
- Validate_Cluster $suspendedClusterWithInputObject $clusterName $resourceGroupName $suspendedClusterWithInputObject.Location " Stopped" " Succeeded" $suspendedClusterWithInputObject.Type $suspendedClusterWithInputObject.Sku ;
183
+ Validate_Cluster $suspendedClusterWithInputObject $clusterName $resourceGroupName $suspendedClusterWithInputObject.Location " Stopped" " Succeeded" $suspendedClusterWithInputObject.Type $suspendedClusterWithInputObject.Sku $suspendedClusterWithInputObject .Capacity
179
184
180
185
Resume-AzKustoCluster - InputObject $runningClusterWithResourceId
181
186
$runningClusterWithInputObject = Get-AzKustoCluster - ResourceGroupName $resourceGroupName - Name $clusterName
182
- Validate_Cluster $runningClusterWithInputObject $clusterName $resourceGroupName $runningClusterWithInputObject.Location " Running" " Succeeded" $runningClusterWithInputObject.Type $runningClusterWithInputObject.Sku ;
187
+ Validate_Cluster $runningClusterWithInputObject $clusterName $resourceGroupName $runningClusterWithInputObject.Location " Running" " Succeeded" $runningClusterWithInputObject.Type $runningClusterWithInputObject.Sku $runningClusterWithInputObject .Capacity
183
188
}
184
189
finally
185
190
{
@@ -197,21 +202,23 @@ function Validate_Cluster{
197
202
[string ]$State ,
198
203
[string ]$ProvisioningState ,
199
204
[string ]$ResourceType ,
200
- [string ]$Sku )
205
+ [string ]$Sku ,
206
+ [int ]$Capacity )
201
207
Assert-AreEqual $ClusterName $Cluster.Name
202
208
Assert-AreEqual $ResourceGroup $Cluster.ResourceGroup
203
209
Assert-AreEqual $Location $Cluster.Location
204
210
Assert-AreEqual $State $Cluster.State
205
211
Assert-AreEqual $ProvisioningState $Cluster.ProvisioningState
206
212
Assert-AreEqual $ResourceType $Cluster.Type
207
213
Assert-AreEqual $Sku $Cluster.Sku
214
+ Assert-AreEqual $Capacity $Cluster.Capacity
208
215
}
209
216
210
217
function Ensure_Cluster_Not_Exist {
211
218
Param ([String ]$ResourceGroupName ,
212
219
[String ]$ClusterName ,
213
220
[string ]$ExpectedErrorMessage )
214
- $expectedException = $false ;
221
+ $expectedException = $false
215
222
try
216
223
{
217
224
$databaseGetItemDeleted = Get-AzKustoCluster - ResourceGroupName $ResourceGroupName - Name $ClusterName
@@ -220,11 +227,11 @@ function Ensure_Cluster_Not_Exist {
220
227
{
221
228
if ($_ -Match $ExpectedErrorMessage )
222
229
{
223
- $expectedException = $true ;
230
+ $expectedException = $true
224
231
}
225
232
}
226
233
if (-not $expectedException )
227
234
{
228
- throw " Expected exception from calling Get-AzKustoCluster was not caught: '$expectedErrorMessage '." ;
235
+ throw " Expected exception from calling Get-AzKustoCluster was not caught: '$expectedErrorMessage '."
229
236
}
230
237
}
0 commit comments