diff --git a/src/Cdn/Cdn.Test/ScenarioTests/ChinaCdnProfileTests.cs b/src/Cdn/Cdn.Test/ScenarioTests/ChinaCdnProfileTests.cs new file mode 100644 index 000000000000..d02becaed063 --- /dev/null +++ b/src/Cdn/Cdn.Test/ScenarioTests/ChinaCdnProfileTests.cs @@ -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"); + } + } +} diff --git a/src/Cdn/Cdn.Test/ScenarioTests/ChinaCdnProfileTests.ps1 b/src/Cdn/Cdn.Test/ScenarioTests/ChinaCdnProfileTests.ps1 new file mode 100644 index 000000000000..0a9fb0ac1c81 --- /dev/null +++ b/src/Cdn/Cdn.Test/ScenarioTests/ChinaCdnProfileTests.ps1 @@ -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 +} \ No newline at end of file diff --git a/src/Cdn/Cdn.Test/SessionRecords/Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest.ChinaCdnProfileTests/TestProfileList.json b/src/Cdn/Cdn.Test/SessionRecords/Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest.ChinaCdnProfileTests/TestProfileList.json new file mode 100644 index 000000000000..06239301db4f --- /dev/null +++ b/src/Cdn/Cdn.Test/SessionRecords/Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.ScenarioTest.ChinaCdnProfileTests/TestProfileList.json @@ -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" + } +} \ No newline at end of file diff --git a/src/Cdn/Cdn/ChangeLog.md b/src/Cdn/Cdn/ChangeLog.md index e69e5e60b38c..3f1e353a2ab9 100644 --- a/src/Cdn/Cdn/ChangeLog.md +++ b/src/Cdn/Cdn/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release +* Fix ChinaCDN related pricing SKU display ## Version 1.4.2 * Display error response detail in New-AzCdnEndpoint cmdlet diff --git a/src/Cdn/Cdn/Models/Profile/PSSkuName.cs b/src/Cdn/Cdn/Models/Profile/PSSkuName.cs index 563dcc30ffd7..2ddd7c27b1f0 100644 --- a/src/Cdn/Cdn/Models/Profile/PSSkuName.cs +++ b/src/Cdn/Cdn/Models/Profile/PSSkuName.cs @@ -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, } -} +} \ No newline at end of file