Skip to content

Commit 7c7ae6a

Browse files
authored
Merge pull request Azure#3406 from shihying/as-state
Add property State in additional to ProvisioningState
2 parents bcef6aa + 06a370a commit 7c7ae6a

File tree

10 files changed

+1221
-576
lines changed

10 files changed

+1221
-576
lines changed

src/ResourceManager/AnalysisServices/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Added State property in additional to ProvisioningState
22+
- All the cmdlet returning AnalysisService would have a new property 'State' used outside of provisioing.
23+
- The 'State' is intended to check status outside of provisioning, while 'ProvisioningState' is intended to check status related to Provisioning.
24+
- ProvisioningState and State are same in service side at this moment, the service side would differenciate ProvisioningState and State in future
2125

2226
## Version 0.0.3
2327
* Added two new dataplane APIs in a separate module Azure.AnalysisServices.psd1

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<package id="Hyak.Common" version="1.0.3" targetFramework="net45" />
44
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
55
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
6-
<package id="Microsoft.Azure.Management.Analysis" version="1.0.1-preview" targetFramework="net45" />
6+
<package id="Microsoft.Azure.Management.Analysis" version="1.0.2-preview" targetFramework="net45" />
77
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
88
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
99
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Test/Commands.AnalysisServices.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
<HintPath>..\..\..\packages\Microsoft.Azure.Gallery.2.6.2-preview\lib\net40\Microsoft.Azure.Gallery.dll</HintPath>
5959
<Private>True</Private>
6060
</Reference>
61-
<Reference Include="Microsoft.Azure.Management.Analysis, Version=1.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
62-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Analysis.1.0.1-preview\lib\net45\Microsoft.Azure.Management.Analysis.dll</HintPath>
61+
<Reference Include="Microsoft.Azure.Management.Analysis, Version=1.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
62+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Analysis.1.0.2-preview\lib\net45\Microsoft.Azure.Management.Analysis.dll</HintPath>
6363
<Private>True</Private>
6464
</Reference>
6565
<Reference Include="Microsoft.Azure.Management.Authorization">

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Test/ScenarioTests/AsTests.ps1

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function Test-AnalysisServicesServer
1010
)
1111

1212
try
13-
{
13+
{
1414
# Creating server
1515
$resourceGroupName = Get-ResourceGroupName
1616
$serverName = Get-AnalysisServicesServerName
@@ -22,11 +22,14 @@ function Test-AnalysisServicesServer
2222
Assert-AreEqual $location $serverCreated.Location
2323
Assert-AreEqual "Microsoft.AnalysisServices/servers" $serverCreated.Type
2424
Assert-True {$serverCreated.Id -like "*$resourceGroupName*"}
25-
Assert-True {$serverCreated.ServerFullName -ne $null -and $serverCreated.ServerFullName.Contains("*$serverName*")}
25+
Assert-True {$serverCreated.ServerFullName -ne $null -and $serverCreated.ServerFullName.Contains("$serverName")}
2626

2727
[array]$serverGet = Get-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName
2828
$serverGetItem = $serverGet[0]
29+
2930
Assert-True {$serverGetItem.ProvisioningState -like "Succeeded"}
31+
Assert-True {$serverGetItem.State -like "Succeeded"}
32+
3033
Assert-AreEqual $serverName $serverGetItem.Name
3134
Assert-AreEqual $location $serverGetItem.Location
3235
Assert-AreEqual "Microsoft.AnalysisServices/servers" $serverGetItem.Type
@@ -36,7 +39,7 @@ function Test-AnalysisServicesServer
3639
Assert-True {Test-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName}
3740
# Test it without specifying a resource group
3841
Assert-True {Test-AzureRmAnalysisServicesServer -Name $serverName}
39-
42+
4043
# Updating server
4144
$tagsToUpdate = @{"TestTag" = "TestUpdate"}
4245
$serverUpdated = Set-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName -Tag $tagsToUpdate -PassThru
@@ -55,7 +58,7 @@ function Test-AnalysisServicesServer
5558
# List all servers in resource group
5659
[array]$serversInResourceGroup = Get-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName
5760
Assert-True {$serversInResourceGroup.Count -ge 1}
58-
61+
5962
$found = 0
6063
for ($i = 0; $i -lt $serversInResourceGroup.Count; $i++)
6164
{
@@ -95,13 +98,16 @@ function Test-AnalysisServicesServer
9598
Suspend-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName
9699
[array]$serverGet = Get-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName
97100
$serverGetItem = $serverGet[0]
101+
# this is to ensure backward compatibility compatibility. The servie side would make change to differenciate state and provisioningState in future
102+
Assert-True {$serverGetItem.State -like "Paused"}
98103
Assert-True {$serverGetItem.ProvisioningState -like "Paused"}
99104

100105
# Resume Analysis Servicesserver
101106
Resume-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName
102107
[array]$serverGet = Get-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName
103108
$serverGetItem = $serverGet[0]
104109
Assert-True {$serverGetItem.ProvisioningState -like "Succeeded"}
110+
Assert-True {$serverGetItem.State -like "Succeeded"}
105111

106112
# Delete Analysis Servicesserver
107113
Remove-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName -PassThru
@@ -124,6 +130,7 @@ Tests Analysis Services server lifecycle Failure scenarios (Create, Update, Get
124130
#>
125131
function Test-NegativeAnalysisServicesServer
126132
{
133+
127134
param
128135
(
129136
$location = "West US",
@@ -193,6 +200,7 @@ function Test-AnalysisServicesServerRestart
193200

194201
$serverCreated = New-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName -Location $location -Sku 'S1' -Administrators '[email protected],[email protected]'
195202
Assert-True {$serverCreated.ProvisioningState -like "Succeeded"}
203+
Assert-True {$serverCreated.State -like "Succeeded"}
196204

197205
$asAzureProfile = Login-AzureAsAccount -RolloutEnvironment $rolloutEnvironment
198206
Assert-NotNull $asAzureProfile "Login-AzureAsAccount $rolloutEnvironment must not return null"

0 commit comments

Comments
 (0)