diff --git a/src/Compute/Compute.Test/Compute.Test.csproj b/src/Compute/Compute.Test/Compute.Test.csproj index 41174e31135a..ac51426167ac 100644 --- a/src/Compute/Compute.Test/Compute.Test.csproj +++ b/src/Compute/Compute.Test/Compute.Test.csproj @@ -1,4 +1,4 @@ - + Compute diff --git a/src/Compute/Compute.Test/ScenarioTests/LogAnalyticTests.cs b/src/Compute/Compute.Test/ScenarioTests/LogAnalyticTests.cs index e666dce25b87..f3a91f192867 100644 --- a/src/Compute/Compute.Test/ScenarioTests/LogAnalyticTests.cs +++ b/src/Compute/Compute.Test/ScenarioTests/LogAnalyticTests.cs @@ -38,6 +38,13 @@ public void TestExportLogAnalyticRequestRateByIntervalNegative() TestRunner.RunTestScript("Test-ExportLogAnalyticRequestRateByIntervalNegative"); } + [Fact] + [Trait(Category.AcceptanceType, Category.LiveOnly)] + public void TestExportLogAnalyticGroupByParameters() + { + TestRunner.RunTestScript("Test-ExportLogAnalyticGroupByParameters"); + } + [Fact(Skip = "BUG: LogAnalytics does not work.")] [Trait(Category.AcceptanceType, Category.CheckIn)] [Trait("Re-record", "ClientRuntime changes")] diff --git a/src/Compute/Compute.Test/ScenarioTests/LogAnalyticTests.ps1 b/src/Compute/Compute.Test/ScenarioTests/LogAnalyticTests.ps1 index 26f24ddcc628..5961f275ff11 100644 --- a/src/Compute/Compute.Test/ScenarioTests/LogAnalyticTests.ps1 +++ b/src/Compute/Compute.Test/ScenarioTests/LogAnalyticTests.ps1 @@ -43,6 +43,68 @@ function Test-ExportLogAnalyticRequestRateByIntervalNegative "the given SAS URI"; } +<# +.SYNOPSIS +Test Export Log Analytics group by parameters +#> +function Test-ExportLogAnalyticGroupByParameters +{ + + # Setup + $rgname = Get-ComputeTestResourceName; + $loc = "westus2"; + + try + { + New-AzResourceGroup -Name $rgname -Location $loc -Force; + + $stoname = 'sto' + $rgname; + $stotype = 'Standard_GRS'; + $container = "contain"; + New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype; + $key = Get-AzStorageAccountKey -ResourceGroupName $rgname -Name $stoname; + Assert-NotNull $key; + + $from = Get-Date -Year 2021 -Month 1 -Day 4 -Hour 9; + $to = Get-Date -Year 2021 -Month 1 -Day 5 -Hour 9; + + $context = New-AzStorageContext -StorageAccountName $stoname -StorageAccountKey $key.Value[0]; + + if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) + { + New-AzStorageContainer -Name $container -Context $context; + $sastoken = Get-AzStorageContainer -Name $container -Context $context | New-AzStorageContainerSASToken -Permission rwdl -Context $context; + } + + $sasuri = "https://$stoname.blob.core.windows.net/$container$sastoken"; + + $result = Export-AzLogAnalyticThrottledRequest -Location $loc -FromTime $from -ToTime $to -BlobContainerSasUri $sasuri -GroupByUserAgent; + Assert-AreEqual "Succeeded" $result.Status; + + if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) + { + $blobs = Get-AzStorageBlob -Container $container -Context $context; + $throttle_blob = $blobs | where {$_.name.contains("ThrottledRequests")}; + Assert-NotNull $throttle_blob; + } + + $result = Export-AzLogAnalyticThrottledRequest -Location $loc -FromTime $from -ToTime $to -BlobContainerSasUri $sasuri -GroupByApplicationId; + Assert-AreEqual "Succeeded" $result.Status; + + if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) + { + $blobs = Get-AzStorageBlob -Container $container -Context $context; + $throttle_blob = $blobs | where {$_.name.contains("ThrottledRequests")}; + Assert-NotNull $throttle_blob; + } + } + finally + { + # Cleanup + Clean-ResourceGroup $rgname + } +} + <# .SYNOPSIS Test Export Log Analytics positive scenario diff --git a/src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.LogAnalyticTests/TestExportLogAnalyticGroupByParameters.json b/src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.LogAnalyticTests/TestExportLogAnalyticGroupByParameters.json new file mode 100644 index 000000000000..cdec3e91ce0e --- /dev/null +++ b/src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.LogAnalyticTests/TestExportLogAnalyticGroupByParameters.json @@ -0,0 +1,414 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourcegroups/crptestps46?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlZ3JvdXBzL2NycHRlc3RwczQ2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus2\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "929fb2f8-7ded-49e9-9941-80912c05d3ca" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.30" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "29" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "867b16ee-92f3-4d91-9023-49dcece626ce" + ], + "x-ms-correlation-request-id": [ + "867b16ee-92f3-4d91-9023-49dcece626ce" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20210128T195542Z:867b16ee-92f3-4d91-9023-49dcece626ce" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 28 Jan 2021 19:55:42 GMT" + ], + "Content-Length": [ + "176" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps46\",\r\n \"name\": \"crptestps46\",\r\n \"location\": \"westus2\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourcegroups/crptestps46?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlZ3JvdXBzL2NycHRlc3RwczQ2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4055d453-3c0f-4962-92cf-ee6f5054b28a" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.30" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0Ni1XRVNUVVMyIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMyIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "1c454bdf-394c-4e72-a1ea-7d871d08efe1" + ], + "x-ms-correlation-request-id": [ + "1c454bdf-394c-4e72-a1ea-7d871d08efe1" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20210128T195544Z:1c454bdf-394c-4e72-a1ea-7d871d08efe1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 28 Jan 2021 19:55:43 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0Ni1XRVNUVVMyIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMyIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wTmkxWFJWTlVWVk15SWl3aWFtOWlURzlqWVhScGIyNGlPaUozWlhOMGRYTXlJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.30" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0Ni1XRVNUVVMyIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMyIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "71789cf9-a530-4039-ad52-97b7253d7a25" + ], + "x-ms-correlation-request-id": [ + "71789cf9-a530-4039-ad52-97b7253d7a25" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20210128T195559Z:71789cf9-a530-4039-ad52-97b7253d7a25" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 28 Jan 2021 19:55:59 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0Ni1XRVNUVVMyIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMyIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wTmkxWFJWTlVWVk15SWl3aWFtOWlURzlqWVhScGIyNGlPaUozWlhOMGRYTXlJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.30" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0Ni1XRVNUVVMyIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMyIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-request-id": [ + "ee9522c5-946e-4a33-a138-db85d0d8d644" + ], + "x-ms-correlation-request-id": [ + "ee9522c5-946e-4a33-a138-db85d0d8d644" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20210128T195615Z:ee9522c5-946e-4a33-a138-db85d0d8d644" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 28 Jan 2021 19:56:15 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0Ni1XRVNUVVMyIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMyIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wTmkxWFJWTlVWVk15SWl3aWFtOWlURzlqWVhScGIyNGlPaUozWlhOMGRYTXlJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.30" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0Ni1XRVNUVVMyIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMyIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-request-id": [ + "4875d11f-1cd0-4037-ae81-e3fd4d1c0e65" + ], + "x-ms-correlation-request-id": [ + "4875d11f-1cd0-4037-ae81-e3fd4d1c0e65" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20210128T195630Z:4875d11f-1cd0-4037-ae81-e3fd4d1c0e65" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 28 Jan 2021 19:56:30 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0Ni1XRVNUVVMyIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMyIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wTmkxWFJWTlVWVk15SWl3aWFtOWlURzlqWVhScGIyNGlPaUozWlhOMGRYTXlJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.30" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-request-id": [ + "b85396db-ff65-41a3-ac9f-ab5f1b54f1e9" + ], + "x-ms-correlation-request-id": [ + "b85396db-ff65-41a3-ac9f-ab5f1b54f1e9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20210128T195645Z:b85396db-ff65-41a3-ac9f-ab5f1b54f1e9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 28 Jan 2021 19:56:44 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0Ni1XRVNUVVMyIiwiam9iTG9jYXRpb24iOiJ3ZXN0dXMyIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wTmkxWFJWTlVWVk15SWl3aWFtOWlURzlqWVhScGIyNGlPaUozWlhOMGRYTXlJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.29518.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19042.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.30" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-request-id": [ + "3b35eb44-3886-4f61-9489-9b1be26c627f" + ], + "x-ms-correlation-request-id": [ + "3b35eb44-3886-4f61-9489-9b1be26c627f" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20210128T195645Z:3b35eb44-3886-4f61-9489-9b1be26c627f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 28 Jan 2021 19:56:45 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + } + ], + "Names": { + "Test-ExportLogAnalyticGroupByParameters": [ + "crptestps46" + ] + }, + "Variables": { + "SubscriptionId": "e37510d7-33b6-4676-886f-ee75bcc01871" + } +} \ No newline at end of file diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index fa719795331d..5664f8459b41 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -31,6 +31,7 @@ - `Remove-AzContainerServiceAgentPoolProfile` - `Update-AzContainerService` * Added parameter `-BurstingEnabled` to `New-AzDiskConfig` and `New-AzDiskUpdateConfig` +* Added `-GroupByApplicationId` and `-GroupByUserAgent` parameters to the `Export-AzLogAnalyticThrottledRequest` and `Export-AzLogAnalyticRequestRateByInterval` cmdlets. ## Version 4.8.0 * New parameter `VM` in new parameter set `VMParameterSet` added to `Get-AzVMDscExtensionStatus` and `Get-AzVMDscExtension` cmdlets. diff --git a/src/Compute/Compute/Compute.csproj b/src/Compute/Compute/Compute.csproj index 0767590a10b1..6afec2980e57 100644 --- a/src/Compute/Compute/Compute.csproj +++ b/src/Compute/Compute/Compute.csproj @@ -1,4 +1,4 @@ - + Compute diff --git a/src/Compute/Compute/Generated/LogAnalytic/LogAnalyticExportRequestRateByIntervalMethod.cs b/src/Compute/Compute/Generated/LogAnalytic/LogAnalyticExportRequestRateByIntervalMethod.cs index ac5c27df669e..4cc9601c2b69 100644 --- a/src/Compute/Compute/Generated/LogAnalytic/LogAnalyticExportRequestRateByIntervalMethod.cs +++ b/src/Compute/Compute/Generated/LogAnalytic/LogAnalyticExportRequestRateByIntervalMethod.cs @@ -51,6 +51,8 @@ public override void ExecuteCmdlet() parameters.ToTime = this.ToTime; parameters.GroupByResourceName = this.GroupByResourceName; parameters.GroupByThrottlePolicy = this.GroupByThrottlePolicy; + parameters.GroupByClientApplicationId = this.GroupByApplicationId; + parameters.GroupByUserAgent = this.GroupByUserAgent; string location = this.Location.Canonicalize(); if (NoWait.IsPresent) @@ -67,6 +69,7 @@ public override void ExecuteCmdlet() ComputeAutomationAutoMapperProfile.Mapper.Map(result, psObject); WriteObject(psObject); } + WriteWarning("Please go to https://aka.ms/throttledRequest to learn more about this cmdlet."); } }); } @@ -118,6 +121,16 @@ public override void ExecuteCmdlet() Mandatory = false)] public SwitchParameter GroupByThrottlePolicy { get; set; } + [Parameter( + ParameterSetName = "DefaultParameter", + HelpMessage = "Group query result by Application Id.")] + public SwitchParameter GroupByApplicationId { get; set; } + + [Parameter( + ParameterSetName = "DefaultParameter", + HelpMessage = "Group query result by UserAgent.")] + public SwitchParameter GroupByUserAgent { get; set; } + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] public SwitchParameter AsJob { get; set; } diff --git a/src/Compute/Compute/Generated/LogAnalytic/LogAnalyticExportThrottledRequestsMethod.cs b/src/Compute/Compute/Generated/LogAnalytic/LogAnalyticExportThrottledRequestsMethod.cs index 7df01e801f99..61e3c218378c 100644 --- a/src/Compute/Compute/Generated/LogAnalytic/LogAnalyticExportThrottledRequestsMethod.cs +++ b/src/Compute/Compute/Generated/LogAnalytic/LogAnalyticExportThrottledRequestsMethod.cs @@ -50,6 +50,8 @@ public override void ExecuteCmdlet() parameters.ToTime = this.ToTime; parameters.GroupByResourceName = this.GroupByResourceName; parameters.GroupByThrottlePolicy = this.GroupByThrottlePolicy; + parameters.GroupByClientApplicationId = this.GroupByApplicationId; + parameters.GroupByUserAgent = this.GroupByUserAgent; string location = this.Location.Canonicalize(); if (NoWait.IsPresent) @@ -66,6 +68,7 @@ public override void ExecuteCmdlet() ComputeAutomationAutoMapperProfile.Mapper.Map(result, psObject); WriteObject(psObject); } + WriteWarning("Please go to https://aka.ms/requestRateByInterval to learn more about this cmdlet."); } }); } @@ -111,6 +114,16 @@ public override void ExecuteCmdlet() Mandatory = false)] public SwitchParameter GroupByThrottlePolicy { get; set; } + [Parameter( + ParameterSetName = "DefaultParameter", + HelpMessage = "Group query result by Application Id.")] + public SwitchParameter GroupByApplicationId { get; set; } + + [Parameter( + ParameterSetName = "DefaultParameter", + HelpMessage = "Group query result by UserAgent.")] + public SwitchParameter GroupByUserAgent { get; set; } + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] public SwitchParameter AsJob { get; set; } diff --git a/src/Compute/Compute/help/Export-AzLogAnalyticRequestRateByInterval.md b/src/Compute/Compute/help/Export-AzLogAnalyticRequestRateByInterval.md index 77ee033be4b6..13a0eaf172ae 100644 --- a/src/Compute/Compute/help/Export-AzLogAnalyticRequestRateByInterval.md +++ b/src/Compute/Compute/help/Export-AzLogAnalyticRequestRateByInterval.md @@ -15,8 +15,8 @@ Export logs that show Api requests made by this subscription in the given time w ``` Export-AzLogAnalyticRequestRateByInterval [-Location] [-FromTime] [-ToTime] [-BlobContainerSasUri] [-IntervalLength] [-GroupByOperationName] - [-GroupByResourceName] [-GroupByThrottlePolicy] [-AsJob] [-NoWait] [-DefaultProfile ] - [-WhatIf] [-Confirm] [] + [-GroupByResourceName] [-GroupByThrottlePolicy] [-GroupByApplicationId] [-GroupByUserAgent] [-AsJob] [-NoWait] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -27,13 +27,27 @@ For an overview of the Compute Resource Provider's API throttling, see https://d ## EXAMPLES -### Example 1 +### Example 1: Export records aggregated by operation name ``` PS C:\> Export-AzLogAnalyticRequestRateByInterval -Location 'West Central US' -FromTime '2018-02-20T17:54:14.8806951-08:00' -ToTime '2018-02-22T17:54:17.5832413-08:00' -BlobContainerSasUri 'https://wkuotest1.blob.core.windows.net/mylogs?someSasUri' -IntervalLength ThirtyMins -GroupByOperationName ``` This command stores the aggregated numbers of Microsoft.Compute API calls separated by Success, Failure, or Throttled between 2018-02-20T17:54:14 and 2018-02-22T17:54:17 in the given SAS URI, aggregated by operation name. +### Example 2: Export records aggregated by application id +``` +PS C:\> Export-AzLogAnalyticRequestRateByInterval -Location 'West Central US' -FromTime '2018-02-20T17:54:14.8806951-08:00' -ToTime '2018-02-22T17:54:17.5832413-08:00' -BlobContainerSasUri 'https://wkuotest1.blob.core.windows.net/mylogs?someSasUri' -IntervalLength ThirtyMins -GroupByApplicationId +``` + +This command stores the aggregated numbers of Microsoft.Compute API calls separated by Success, Failure, or Throttled between 2018-02-20T17:54:14 and 2018-02-22T17:54:17 in the given SAS URI, aggregated by application id. + +### Example 3: Export records aggregated by user agent +``` +PS C:\> Export-AzLogAnalyticRequestRateByInterval -Location 'West Central US' -FromTime '2018-02-20T17:54:14.8806951-08:00' -ToTime '2018-02-22T17:54:17.5832413-08:00' -BlobContainerSasUri 'https://wkuotest1.blob.core.windows.net/mylogs?someSasUri' -IntervalLength ThirtyMins -GroupByUserAgent +``` + +This command stores the aggregated numbers of Microsoft.Compute API calls separated by Success, Failure, or Throttled between 2018-02-20T17:54:14 and 2018-02-22T17:54:17 in the given SAS URI, aggregated by user agent. + ## PARAMETERS ### -AsJob @@ -96,6 +110,20 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -GroupByApplicationId +Group query result by Application Id. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -GroupByOperationName Group query result by Operation Name. @@ -141,6 +169,20 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -GroupByUserAgent +Group query result by UserAgent. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -IntervalLength Interval value in minutes used to create LogAnalytics call rate logs. diff --git a/src/Compute/Compute/help/Export-AzLogAnalyticThrottledRequest.md b/src/Compute/Compute/help/Export-AzLogAnalyticThrottledRequest.md index 9f126babe5a2..b14e8610e059 100644 --- a/src/Compute/Compute/help/Export-AzLogAnalyticThrottledRequest.md +++ b/src/Compute/Compute/help/Export-AzLogAnalyticThrottledRequest.md @@ -15,7 +15,8 @@ Export logs that show total throttled Api requests for this subscription in the ``` Export-AzLogAnalyticThrottledRequest [-Location] [-FromTime] [-ToTime] [-BlobContainerSasUri] [-GroupByOperationName] [-GroupByResourceName] [-GroupByThrottlePolicy] - [-AsJob] [-NoWait] [-DefaultProfile ] [-WhatIf] [-Confirm] [] + [-GroupByApplicationId] [-GroupByUserAgent] [-AsJob] [-NoWait] [-DefaultProfile ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -27,13 +28,27 @@ For an overview of the Compute Resource Provider's API throttling, see https://d ## EXAMPLES -### Example 1 +### Example 1: Export records aggregated by operation name ``` PS C:\> Export-AzLogAnalyticThrottledRequest -Location 'West Central US' -FromTime '2018-02-20T17:54:14.8806951-08:00' -ToTime '2018-02-22T17:54:17.5832413-08:00' -BlobContainerSasUri 'https://wkuotest1.blob.core.windows.net/mylogs?someSasUri' -GroupByOperationName ``` This command stores the total throttled Microsoft.Compute API calls between 2018-02-20T17:54:14 and 2018-02-22T17:54:17 in the given SAS URI, aggregated by operation name. +### Example 2: Export records aggregated by applicaiton id +``` +PS C:\> Export-AzLogAnalyticThrottledRequest -Location 'West Central US' -FromTime '2018-02-20T17:54:14.8806951-08:00' -ToTime '2018-02-22T17:54:17.5832413-08:00' -BlobContainerSasUri 'https://wkuotest1.blob.core.windows.net/mylogs?someSasUri' -GroupByApplicationId +``` + +This command stores the total throttled Microsoft.Compute API calls between 2018-02-20T17:54:14 and 2018-02-22T17:54:17 in the given SAS URI, aggregated by appliction id. + +### Example 3: Export records aggregated by user agent +``` +PS C:\> Export-AzLogAnalyticThrottledRequest -Location 'West Central US' -FromTime '2018-02-20T17:54:14.8806951-08:00' -ToTime '2018-02-22T17:54:17.5832413-08:00' -BlobContainerSasUri 'https://wkuotest1.blob.core.windows.net/mylogs?someSasUri' -GroupByUserAgent +``` + +This command stores the total throttled Microsoft.Compute API calls between 2018-02-20T17:54:14 and 2018-02-22T17:54:17 in the given SAS URI, aggregated by user agent. + ## PARAMETERS ### -AsJob @@ -96,6 +111,20 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -GroupByApplicationId +Group query result by Application Id. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -GroupByOperationName Group query result by Operation Name. @@ -141,6 +170,20 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -GroupByUserAgent +Group query result by UserAgent. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Location The location upon which log analytic is queried.