Skip to content

Commit 626036a

Browse files
authored
Merge pull request Azure#3119 from amolr/dev
Azure powershell SDK changes for Notification Hubs. Added a skuTier parameter for create/update namespace.
2 parents 79d7377 + 80cd89a commit 626036a

File tree

19 files changed

+31564
-16117
lines changed

19 files changed

+31564
-16117
lines changed

setup/azurecmdfiles.wxi

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,8 @@
13461346
<Component Id="cmpFC33C3BBB9DE3FDA41AAC3F0C1652F45" Guid="*">
13471347
<File Id="fil0BC58752DC9792178625EA842D496953" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll" />
13481348
</Component>
1349-
<Component Id="cmpDE07060F7C404EB0947D0711C6A05ABA" Guid="*">
1350-
<File Id="fil7F437FF8C0784CA7B8438C683AE09BC4" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Rest.ClientRuntime.Azure.dll" />
1349+
<Component Id="cmpE389288C5CA88334DBFAA1A298DFDC57" Guid="*">
1350+
<File Id="fil3D9EA2F20E6C186138C8614E1378739F" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Rest.ClientRuntime.Azure.dll" />
13511351
</Component>
13521352
<Component Id="cmpE0A4360ECC0B00A74E3D29F280B2FD2E" Guid="*">
13531353
<File Id="fil1FB9B7667782F24EAC7BB0B862A44410" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Insights\Microsoft.Rest.ClientRuntime.dll" />
@@ -1949,6 +1949,9 @@
19491949
<Component Id="cmp02101C8205A10465A009DD2D2D0F1390" Guid="*">
19501950
<File Id="fil4CA8F0CA63F798A22950895A16A78B18" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.NotificationHubs\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll" />
19511951
</Component>
1952+
<Component Id="cmp0D0D795C52AF8527E2B92C491C447906" Guid="*">
1953+
<File Id="filD8614F896FBB93824122EB840C9A88F0" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.NotificationHubs\Microsoft.Rest.ClientRuntime.Azure.dll" />
1954+
</Component>
19521955
<Component Id="cmp70EF4B668BAC168FD29981CF127B86C5" Guid="*">
19531956
<File Id="fil624F3BFD8FC0BFE924EF19BDF7C3C26B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.NotificationHubs\Microsoft.Rest.ClientRuntime.dll" />
19541957
</Component>
@@ -1978,9 +1981,6 @@
19781981
<Component Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" Guid="*">
19791982
<File Id="filF30732FD3174ABEC7D2103467F25E8E5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\AzureRM.OperationalInsights.psd1" />
19801983
</Component>
1981-
<Component Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" Guid="*">
1982-
<File Id="filD2FB04719F134FB9BF2BC1EE41908381" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\OperationalInsightsStartup.ps1" />
1983-
</Component>
19841984
<Component Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" Guid="*">
19851985
<File Id="filD490745C6F4007A53448F93D7655F3D4" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\Hyak.Common.dll" />
19861986
</Component>
@@ -2044,6 +2044,9 @@
20442044
<Component Id="cmpFD405A18E2A1C755986CD15E7976CCD9" Guid="*">
20452045
<File Id="filD7B6812AB9810AD6C0DE6904B4262D96" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\Newtonsoft.Json.dll" />
20462046
</Component>
2047+
<Component Id="cmpD40FCB9017580E2042019CEA18C95507" Guid="*">
2048+
<File Id="fil2725AD41AD388A79C41F93ADF90AADE3" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\OperationalInsightsStartup.ps1" />
2049+
</Component>
20472050
<Component Id="cmpD895804B1147D0DB74C81C5C228D8CFA" Guid="*">
20482051
<File Id="filA2326E206A682358A6CBA550FA21A25E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.OperationalInsights\System.Net.Http.Extensions.dll" />
20492052
</Component>
@@ -5953,7 +5956,7 @@
59535956
<ComponentRef Id="cmp95FB8932F45A41F4AF974FB6F565B75C" />
59545957
<ComponentRef Id="cmpC9466F4B506234EBA66C4F1204C0CD5D" />
59555958
<ComponentRef Id="cmpFC33C3BBB9DE3FDA41AAC3F0C1652F45" />
5956-
<ComponentRef Id="cmpDE07060F7C404EB0947D0711C6A05ABA" />
5959+
<ComponentRef Id="cmpE389288C5CA88334DBFAA1A298DFDC57" />
59575960
<ComponentRef Id="cmpE0A4360ECC0B00A74E3D29F280B2FD2E" />
59585961
<ComponentRef Id="cmpE2B4EA9CCA75508B10345C79226A99BF" />
59595962
<ComponentRef Id="cmp545597FAE11FE5F91F4BDCD56D1DFE83" />
@@ -6150,6 +6153,7 @@
61506153
<ComponentRef Id="cmp00A626BF687C0B839638474C372F830C" />
61516154
<ComponentRef Id="cmp775CB6B7D1F3AD4D55497F602D74AECF" />
61526155
<ComponentRef Id="cmp02101C8205A10465A009DD2D2D0F1390" />
6156+
<ComponentRef Id="cmp0D0D795C52AF8527E2B92C491C447906" />
61536157
<ComponentRef Id="cmp70EF4B668BAC168FD29981CF127B86C5" />
61546158
<ComponentRef Id="cmpB094102F26151D0A1F6097A8CEE8CF40" />
61556159
<ComponentRef Id="cmpE727598EA987F9F9AC37355BE178AE99" />
@@ -6159,7 +6163,6 @@
61596163
<ComponentRef Id="cmp275E5D23204FF3DB5A484691FFA2C6F5" />
61606164
<ComponentRef Id="cmp5E9A44B7330C75772463CB17D6D24AA6" />
61616165
<ComponentRef Id="cmp17459EC3296F82D03FEF8C426C8DA7EA" />
6162-
<ComponentRef Id="cmpC77B4F6D332144EDAE5C8E2997F313F1" />
61636166
<ComponentRef Id="cmp7CE9821E11931CE1140ACA06CF2D38B4" />
61646167
<ComponentRef Id="cmp6D68CAF3787D43356F3C2CB592699D2D" />
61656168
<ComponentRef Id="cmp20FBC1203D91D529F69E519C9C2F78B8" />
@@ -6181,6 +6184,7 @@
61816184
<ComponentRef Id="cmp6B49CE5195722BC055BE51FA1070592A" />
61826185
<ComponentRef Id="cmpF98A2CCD736EDBCB2C21E170C3EB8FC9" />
61836186
<ComponentRef Id="cmpFD405A18E2A1C755986CD15E7976CCD9" />
6187+
<ComponentRef Id="cmpD40FCB9017580E2042019CEA18C95507" />
61846188
<ComponentRef Id="cmpD895804B1147D0DB74C81C5C228D8CFA" />
61856189
<ComponentRef Id="cmpBBEEE168902DFD205E35F47468881929" />
61866190
<ComponentRef Id="cmp07ACD4A07ADD8A358045C237522DA4C4" />

src/ResourceManager/NotificationHubs/ChangeLog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Added the skuTier parameter to set the sky for namespace
22+
- New-AzureRmNotificationHubsNamespace
23+
- Set-AzureRmNotificationHubsNamespace
2124

2225
## Version 2.3.0
2326
* New cmdlets
2427
- New-AzureRmNotificationHubKey
25-
- New-AzureRmNotificationHubsNamespaceKey
28+
- New-AzureRmNotificationHubsNamespaceKey
29+

src/ResourceManager/NotificationHubs/Commands.NotificationHubs.Test/Commands.NotificationHubs.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
7272
</Reference>
7373
<Reference Include="Microsoft.Azure.Management.NotificationHubs, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
74-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.NotificationHubs.2.0.0-preview\lib\net45\Microsoft.Azure.Management.NotificationHubs.dll</HintPath>
74+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.NotificationHubs.2.1.0-preview\lib\net45\Microsoft.Azure.Management.NotificationHubs.dll</HintPath>
7575
<Private>True</Private>
7676
</Reference>
7777
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/ResourceManager/NotificationHubs/Commands.NotificationHubs.Test/ScenarioTests/NHServiceTests.ps1

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ function Test-CRUDNamespace
7373
{
7474
# Setup
7575
$location = "South Central US"
76-
76+
$skuTier = "Basic"
7777
Write-Debug "Create resource group"
7878
$resourceGroupName = Get-ResourceGroupName
7979
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location -Force
8080
Write-Debug "ResourceGroup name : $resourceGroupName"
81-
81+
8282
$namespaceName = Get-NamespaceName
8383

8484
Write-Debug " Create new notificationHub namespace"
8585
Write-Debug "NamespaceName : $namespaceName"
86-
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location
87-
86+
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -skuTier $skuTier
87+
8888
if($env:AZURE_TEST_MODE -ne "Playback")
8989
{
9090
Is-NamespaceActive $resourceGroupName $namespaceName
@@ -102,12 +102,13 @@ function Test-CRUDNamespace
102102
$found = 1
103103
Assert-AreEqual $location $createdNamespace[$i].Location
104104
Assert-AreEqual "NotificationHub" $createdNamespace[$i].NamespaceType
105+
Assert-AreEqual "Basic" $createdNamespace[$i].SkuName
105106
break
106107
}
107108
}
108109

109110
Assert-True {$found -eq 1} "Namespace created earlier is not found."
110-
111+
111112
Write-Debug "Create one more resource group"
112113
$secondResourceGroup = Get-ResourceGroupName
113114
Write-Debug "ResourceGroup name : $secondResourceGroup"
@@ -135,6 +136,7 @@ function Test-CRUDNamespace
135136
Assert-AreEqual $location $allCreatedNamespace[$i].Location
136137
Assert-AreEqual $secondResourceGroup $allCreatedNamespace[$i].ResourceGroupName
137138
Assert-AreEqual "NotificationHub" $allCreatedNamespace[$i].NamespaceType
139+
Assert-AreEqual "Free" $allCreatedNamespace[$i].SkuName
138140
break
139141
}
140142
}
@@ -169,11 +171,12 @@ function Test-CRUDNamespace
169171
Write-Debug " Update an existing namespace"
170172
$tags = @{"tag1" = "value1" ; "tag2" = "value2"}
171173
Write-Debug "Tags List : $tags"
174+
$skuTier = "Standard"
172175

173-
$updatedNamespace = Set-AzureRmNotificationHubsNamespace -ResourceGroup $secondResourceGroup -Namespace $namespaceName2 -Location $location -Tags $tags -Force
176+
$updatedNamespace = Set-AzureRmNotificationHubsNamespace -ResourceGroup $secondResourceGroup -Namespace $namespaceName2 -Location $location -Tags $tags -skuTier $skuTier -Force
174177
Assert-AreEqual 2 $updatedNamespace.Tags.Count
175-
176-
if($env:AZURE_TEST_MODE -ne "Playback")
178+
179+
if($env:AZURE_TEST_MODE -ne "Playback")
177180
{
178181
Wait-Seconds 15
179182
}
@@ -182,6 +185,7 @@ function Test-CRUDNamespace
182185
$getUpdatedNamespace = Get-AzureRmNotificationHubsNamespace -ResourceGroup $secondResourceGroup -Namespace $namespaceName2
183186
#uncomment once the playback mode doesnt fail on this
184187
#Assert-AreEqual $updatedNamespace.Tags.Count $getUpdatedNamespace.Tags.Count
188+
Assert-AreEqual "Standard" $updatedNamespace.SkuName
185189

186190
Write-Debug " Delete namespaces"
187191
Remove-AzureRmNotificationHubsNamespace -ResourceGroup $secondResourceGroup -Namespace $namespaceName2 -Force
@@ -200,6 +204,7 @@ function Test-CRUDNamespaceAuth
200204
{
201205
# Setup
202206
$location = "South Central US"
207+
$skuTier = "Basic"
203208

204209
Write-Debug " Create resource group"
205210
$resourceGroupName = Get-ResourceGroupName
@@ -211,7 +216,7 @@ function Test-CRUDNamespaceAuth
211216
Write-Debug " Create new notificationHub namespace"
212217
Write-Debug "Namespace name : $namespaceName"
213218

214-
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location
219+
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -skuTier $skuTier
215220
if($env:AZURE_TEST_MODE -ne "Playback")
216221
{
217222
Is-NamespaceActive $resourceGroupName $namespaceName
@@ -378,7 +383,7 @@ function Test-CRUDNotificationHub
378383
{
379384
# Setup
380385
$location = "South Central US"
381-
386+
$skuTier = "Basic"
382387
Write-Debug " Create resource group"
383388
$resourceGroupName = Get-ResourceGroupName
384389
Write-Debug " Resource Group Name : $resourceGroupName"
@@ -388,7 +393,7 @@ function Test-CRUDNotificationHub
388393

389394
Write-Debug " Create new notificationHub namespace"
390395
Write-Debug " Namespace name : $namespaceName"
391-
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location
396+
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -skuTier $skuTier
392397
if($env:AZURE_TEST_MODE -ne "Playback")
393398
{
394399
Is-NamespaceActive $resourceGroupName $namespaceName
@@ -495,7 +500,7 @@ function Test-CRUDNHAuth
495500
{
496501
# Setup
497502
$location = "South Central US"
498-
503+
$skuTier = "Basic"
499504
Write-Debug " Create resource group"
500505
$resourceGroupName = Get-ResourceGroupName
501506
Write-Debug "Resource group name : $resourceGroupName"
@@ -505,7 +510,7 @@ function Test-CRUDNHAuth
505510

506511
Write-Debug " Create new notificationHub namespace"
507512
Write-Debug "Namespace name : $namespaceName"
508-
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location
513+
$result = New-AzureRmNotificationHubsNamespace -ResourceGroup $resourceGroupName -Namespace $namespaceName -Location $location -skuTier $skuTier
509514
if($env:AZURE_TEST_MODE -ne "Playback")
510515
{
511516
Is-NamespaceActive $resourceGroupName $namespaceName

src/ResourceManager/NotificationHubs/Commands.NotificationHubs.Test/ScenarioTests/TestBaseClass.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ protected TestBaseClass()
4242

4343
protected void SetupManagementClients(MockContext context)
4444
{
45-
var nhManagementClient = GetNotificationHubsManagementClient(context);
4645
var resourceManagementClient = GetResourceManagementClient();
4746
var gallaryClient = GetGalleryClient();
4847
var authorizationManagementClient = GetAuthorizationManagementClient();
49-
var managementClient = GetManagementClient();
48+
var nhManagementClient = GetNotificationHubsManagementClient(context);
5049

5150
helper.SetupManagementClients(nhManagementClient, resourceManagementClient, gallaryClient,
52-
authorizationManagementClient, managementClient);
51+
authorizationManagementClient);
5352
}
5453

5554
protected void RunPowerShellTest(params string[] scripts)

0 commit comments

Comments
 (0)