Skip to content

Fix ChinaCDN related pricing SKU display #11517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2020
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
38 changes: 38 additions & 0 deletions src/Cdn/Cdn.Test/ScenarioTests/ChinaCdnProfileTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;

namespace Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest
{
public class ChinaCdnProfileTests
{
private ServiceManagement.Common.Models.XunitTracingInterceptor _logger;

public ChinaCdnProfileTests(Xunit.Abstractions.ITestOutputHelper output)
{
_logger = new ServiceManagement.Common.Models.XunitTracingInterceptor(output);
ServiceManagement.Common.Models.XunitTracingInterceptor.AddToContext(_logger);
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestProfileList()
{
TestController.NewInstance.RunPowerShellTest(_logger, "Test-ProfileList");
}
}
}
25 changes: 25 additions & 0 deletions src/Cdn/Cdn.Test/ScenarioTests/ChinaCdnProfileTests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

<#
.SYNOPSIS
Create Profile with different Sku
#>
function Test-ProfileList
{
$retrievedProfile = Get-AzCdnProfile -ProfileName "cdn-billing-standard-bandwidth-avg" -ResourceGroupName "cdnbillingskus"

Assert-NotNull $retrievedProfile
Assert-AreEqual "Standard_AvgBandWidth_ChinaCdn" $retrievedProfile.Sku.Name
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"Entries": [
{
"RequestUri": "/subscriptions/b7f584b1-4c44-4a5c-a3c9-9f85d925d727/resourceGroups/cdnbillingskus/providers/Microsoft.Cdn/profiles/cdn-billing-standard-bandwidth-avg?api-version=2019-04-15",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYjdmNTg0YjEtNGM0NC00YTVjLWEzYzktOWY4NWQ5MjVkNzI3L3Jlc291cmNlR3JvdXBzL2NkbmJpbGxpbmdza3VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ2RuL3Byb2ZpbGVzL2Nkbi1iaWxsaW5nLXN0YW5kYXJkLWJhbmR3aWR0aC1hdmc/YXBpLXZlcnNpb249MjAxOS0wNC0xNQ==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"d68775c5-2b20-4c60-ac0d-05e92da230f5"
],
"Accept-Language": [
"en-US"
],
"User-Agent": [
"FxVersion/4.6.28207.03",
"OSName/Windows",
"OSVersion/Microsoft.Windows.10.0.18363.",
"Microsoft.Azure.Management.Cdn.CdnManagementClient/4.2.4.0"
]
},
"ResponseHeaders": {
"Cache-Control": [
"no-cache"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14999"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"x-ms-request-id": [
"367b9dc8-a107-48f9-b70e-210c0e7fac25"
],
"x-ms-client-request-id": [
"d68775c5-2b20-4c60-ac0d-05e92da230f5"
],
"OData-Version": [
"4.0"
],
"Server": [
"Kestrel"
],
"x-ms-correlation-request-id": [
"a6b5b77b-ff2a-4329-afe9-f630b11199df"
],
"x-ms-routing-request-id": [
"CHINAEAST:20200407T085414Z:a6b5b77b-ff2a-4329-afe9-f630b11199df"
],
"X-Content-Type-Options": [
"nosniff"
],
"Date": [
"Tue, 07 Apr 2020 08:54:13 GMT"
],
"Content-Length": [
"388"
],
"Content-Type": [
"application/json; odata.metadata=minimal; odata.streaming=true"
],
"Expires": [
"-1"
]
},
"ResponseBody": "{\r\n \"name\": \"cdn-billing-standard-bandwidth-avg\",\r\n \"id\": \"/subscriptions/b7f584b1-4c44-4a5c-a3c9-9f85d925d727/resourcegroups/cdnbillingskus/providers/Microsoft.Cdn/profiles/cdn-billing-standard-bandwidth-avg\",\r\n \"type\": \"Microsoft.Cdn/profiles\",\r\n \"location\": \"ChinaNorth\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Standard_AvgBandWidth_ChinaCdn\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceState\": \"Active\"\r\n }\r\n}",
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "b7f584b1-4c44-4a5c-a3c9-9f85d925d727"
}
}
1 change: 1 addition & 0 deletions src/Cdn/Cdn/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-->

## Upcoming Release
* Fix ChinaCDN related pricing SKU display

## Version 1.4.2
* Display error response detail in New-AzCdnEndpoint cmdlet
Expand Down
10 changes: 8 additions & 2 deletions src/Cdn/Cdn/Models/Profile/PSSkuName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ public enum PSSkuName
Premium_Verizon,
Custom_Verizon,
Standard_Akamai,
Standard_Microsoft,
Standard_ChinaCdn,
Standard_Microsoft
Premium_ChinaCdn,
Standard_955BandWidth_ChinaCdn,
Standard_AvgBandWidth_ChinaCdn,
StandardPlus_ChinaCdn,
StandardPlus_955BandWidth_ChinaCdn,
StandardPlus_AvgBandWidth_ChinaCdn,
}
}
}