From 3e6d515d5a1013a1dc584df5ac8614e8cbd370d2 Mon Sep 17 00:00:00 2001 From: AllyWang Date: Tue, 22 Aug 2023 14:48:25 +0800 Subject: [PATCH 1/2] fixed scheduled query condition operator mapping --- .../ScheduleQueryConditionValidator.py | 4 +- ...st_scheduled_query_condition_operator.yaml | 2227 +++++++++++++++++ .../latest/test_scheduled_query_scenario.py | 57 + 3 files changed, 2286 insertions(+), 2 deletions(-) create mode 100644 src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml diff --git a/src/scheduled-query/azext_scheduled_query/grammar/scheduled_query/ScheduleQueryConditionValidator.py b/src/scheduled-query/azext_scheduled_query/grammar/scheduled_query/ScheduleQueryConditionValidator.py index 96a33eff2df..ff833ba6eeb 100644 --- a/src/scheduled-query/azext_scheduled_query/grammar/scheduled_query/ScheduleQueryConditionValidator.py +++ b/src/scheduled-query/azext_scheduled_query/grammar/scheduled_query/ScheduleQueryConditionValidator.py @@ -8,8 +8,8 @@ op_conversion = { - '=': 'Equals', - '!=': 'NotEquals', + '=': 'Equal', + '!=': 'NotEqual', '>': 'GreaterThan', '>=': 'GreaterThanOrEqual', '<': 'LessThan', diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml new file mode 100644 index 00000000000..406b62ce611 --- /dev/null +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/recordings/test_scheduled_query_condition_operator.yaml @@ -0,0 +1,2227 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001","name":"cli_test_scheduled_query_operator000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_scheduled_query_condition_operator","date":"2023-08-22T06:37:48Z","module":"scheduled-query"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '432' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:37:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ + ,\n \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\"\ + : {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"\ + type\": \"object\",\n \"value\": {\n \"Linux\": {\n \"\ + CentOS\": {\n \"publisher\": \"OpenLogic\",\n \"offer\"\ + : \"CentOS\",\n \"sku\": \"7.5\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"CentOS85Gen2\": {\n \"publisher\": \"OpenLogic\",\n \ + \ \"offer\": \"CentOS\",\n \"sku\": \"8_5-gen2\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n\ + \ },\n \"Debian\": {\n \"publisher\": \"Debian\"\ + ,\n \"offer\": \"debian-10\",\n \"sku\": \"10\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\ + \n },\n \"Debian11\": {\n \"publisher\": \"\ + Debian\",\n \"offer\": \"debian-11\",\n \"sku\": \"\ + 11-backports-gen2\",\n \"version\": \"latest\",\n \"\ + architecture\": \"x64\"\n },\n \"Flatcar\": {\n \ + \ \"publisher\": \"kinvolk\",\n \"offer\": \"flatcar-container-linux-free\"\ + ,\n \"sku\": \"stable\",\n \"version\": \"latest\",\n\ + \ \"architecture\": \"x64\"\n },\n \"FlatcarLinuxFreeGen2\"\ + : {\n \"publisher\": \"kinvolk\",\n \"offer\": \"\ + flatcar-container-linux-free\",\n \"sku\": \"stable-gen2\",\n\ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\ + \n },\n \"openSUSE-Leap\": {\n \"publisher\"\ + : \"SUSE\",\n \"offer\": \"opensuse-leap-15-3\",\n \"\ + sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\"\ + : \"x64\"\n },\n \"OpenSuseLeap154Gen2\": {\n \ + \ \"publisher\": \"SUSE\",\n \"offer\": \"openSUSE-leap-15-4\"\ + ,\n \"sku\": \"gen2\",\n \"version\": \"latest\",\n\ + \ \"architecture\": \"x64\"\n },\n \"RHEL\":\ + \ {\n \"publisher\": \"RedHat\",\n \"offer\": \"RHEL\"\ + ,\n \"sku\": \"7-LVM\",\n \"version\": \"latest\",\n\ + \ \"architecture\": \"x64\"\n },\n \"RHELRaw8LVMGen2\"\ + : {\n \"publisher\": \"RedHat\",\n \"offer\": \"\ + RHEL\",\n \"sku\": \"8-lvm-gen2\",\n \"version\": \ + \ \"latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"SLES\": {\n \"publisher\": \"SUSE\",\n \"offer\"\ + : \"sles-15-sp3\",\n \"sku\": \"gen2\",\n \"version\"\ + : \"latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"SuseSles15SP3\": {\n \"publisher\": \"SUSE\",\n \ + \ \"offer\": \"sles-15-sp3\",\n \"sku\": \"gen2\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n \ + \ },\n \"UbuntuLTS\": {\n \"publisher\": \"Canonical\"\ + ,\n \"offer\": \"UbuntuServer\",\n \"sku\": \"18.04-LTS\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Ubuntu2204\": {\n \"publisher\"\ + : \"Canonical\",\n \"offer\": \"0001-com-ubuntu-server-jammy\"\ + ,\n \"sku\": \"22_04-lts-gen2\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n }\n },\n\ + \ \"Windows\": {\n \"Win2022Datacenter\": {\n \"\ + publisher\": \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\"\ + ,\n \"sku\": \"2022-Datacenter\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Win2022AzureEditionCore\": {\n \"publisher\": \"MicrosoftWindowsServer\"\ + ,\n \"offer\": \"WindowsServer\",\n \"sku\": \"2022-datacenter-azure-edition-core\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Win2019Datacenter\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2019-Datacenter\",\n \"version\": \"latest\"\ + ,\n \"architecture\": \"x64\"\n },\n \"Win2016Datacenter\"\ + : {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"\ + offer\": \"WindowsServer\",\n \"sku\": \"2016-Datacenter\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\ + \n },\n \"Win2012R2Datacenter\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2012-R2-Datacenter\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Win2012Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\"\ + ,\n \"offer\": \"WindowsServer\",\n \"sku\": \"2012-Datacenter\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Win2008R2SP1\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2008-R2-SP1\",\n \"version\": \"latest\"\ + ,\n \"architecture\": \"x64\"\n }\n }\n }\n\ + \ }\n }\n}\n" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '5018' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + cross-origin-resource-policy: + - cross-origin + date: + - Tue, 22 Aug 2023 06:37:54 GMT + etag: + - W/"0a553f088c358b909a2940b5a97fcb731c1d443cb7a332ca4933eb2b7df38468" + expires: + - Tue, 22 Aug 2023 06:42:54 GMT + source-age: + - '0' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding,Origin + via: + - 1.1 varnish + x-cache: + - HIT + x-cache-hits: + - '1' + x-content-type-options: + - nosniff + x-fastly-request-id: + - 2d92396b776637cf73b09d243b3a7d89cbe5e017 + x-frame-options: + - deny + x-github-request-id: + - C216:052D:131F2D:161398:64E142E1 + x-served-by: + - cache-qpg1234-QPG + x-timer: + - S1692686274.231290,VS0,VE308 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions?$top=1&$orderby=name%20desc&api-version=2022-11-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"18.04.202306070\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202306070\"\ + \r\n }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '286' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:37:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15999,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43994 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions/18.04.202306070?api-version=2022-11-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \ + \ \"architecture\": \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n\ + \ \"disallowed\": {\r\n \"vmDiskType\": \"None\"\r\n },\r\n \ + \ \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\"\ + : true\r\n },\r\n \"imageDeprecationStatus\": {\r\n \"imageState\"\ + : \"Active\"\r\n },\r\n \"features\": [\r\n {\r\n \"name\"\ + : \"IsAcceleratedNetworkSupported\",\r\n \"value\": \"True\"\r\n \ + \ },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n \ + \ \"value\": \"SCSI, NVMe\"\r\n },\r\n {\r\n \"name\":\ + \ \"IsHibernateSupported\",\r\n \"value\": \"True\"\r\n }\r\n\ + \ ],\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\"\ + ,\r\n \"sizeInGb\": 31,\r\n \"sizeInBytes\": 32213303808\r\n \ + \ },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"eastus\",\r\ + \n \"name\": \"18.04.202306070\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202306070\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1048' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:37:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12999,Microsoft.Compute/GetVMImageFromLocation30Min;73995 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/virtualNetworks?api-version=2022-01-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:37:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ + ,\n \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\"\ + : {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"\ + type\": \"object\",\n \"value\": {\n \"Linux\": {\n \"\ + CentOS\": {\n \"publisher\": \"OpenLogic\",\n \"offer\"\ + : \"CentOS\",\n \"sku\": \"7.5\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"CentOS85Gen2\": {\n \"publisher\": \"OpenLogic\",\n \ + \ \"offer\": \"CentOS\",\n \"sku\": \"8_5-gen2\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n\ + \ },\n \"Debian\": {\n \"publisher\": \"Debian\"\ + ,\n \"offer\": \"debian-10\",\n \"sku\": \"10\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\ + \n },\n \"Debian11\": {\n \"publisher\": \"\ + Debian\",\n \"offer\": \"debian-11\",\n \"sku\": \"\ + 11-backports-gen2\",\n \"version\": \"latest\",\n \"\ + architecture\": \"x64\"\n },\n \"Flatcar\": {\n \ + \ \"publisher\": \"kinvolk\",\n \"offer\": \"flatcar-container-linux-free\"\ + ,\n \"sku\": \"stable\",\n \"version\": \"latest\",\n\ + \ \"architecture\": \"x64\"\n },\n \"FlatcarLinuxFreeGen2\"\ + : {\n \"publisher\": \"kinvolk\",\n \"offer\": \"\ + flatcar-container-linux-free\",\n \"sku\": \"stable-gen2\",\n\ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\ + \n },\n \"openSUSE-Leap\": {\n \"publisher\"\ + : \"SUSE\",\n \"offer\": \"opensuse-leap-15-3\",\n \"\ + sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\"\ + : \"x64\"\n },\n \"OpenSuseLeap154Gen2\": {\n \ + \ \"publisher\": \"SUSE\",\n \"offer\": \"openSUSE-leap-15-4\"\ + ,\n \"sku\": \"gen2\",\n \"version\": \"latest\",\n\ + \ \"architecture\": \"x64\"\n },\n \"RHEL\":\ + \ {\n \"publisher\": \"RedHat\",\n \"offer\": \"RHEL\"\ + ,\n \"sku\": \"7-LVM\",\n \"version\": \"latest\",\n\ + \ \"architecture\": \"x64\"\n },\n \"RHELRaw8LVMGen2\"\ + : {\n \"publisher\": \"RedHat\",\n \"offer\": \"\ + RHEL\",\n \"sku\": \"8-lvm-gen2\",\n \"version\": \ + \ \"latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"SLES\": {\n \"publisher\": \"SUSE\",\n \"offer\"\ + : \"sles-15-sp3\",\n \"sku\": \"gen2\",\n \"version\"\ + : \"latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"SuseSles15SP3\": {\n \"publisher\": \"SUSE\",\n \ + \ \"offer\": \"sles-15-sp3\",\n \"sku\": \"gen2\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n \ + \ },\n \"UbuntuLTS\": {\n \"publisher\": \"Canonical\"\ + ,\n \"offer\": \"UbuntuServer\",\n \"sku\": \"18.04-LTS\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Ubuntu2204\": {\n \"publisher\"\ + : \"Canonical\",\n \"offer\": \"0001-com-ubuntu-server-jammy\"\ + ,\n \"sku\": \"22_04-lts-gen2\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n }\n },\n\ + \ \"Windows\": {\n \"Win2022Datacenter\": {\n \"\ + publisher\": \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\"\ + ,\n \"sku\": \"2022-Datacenter\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Win2022AzureEditionCore\": {\n \"publisher\": \"MicrosoftWindowsServer\"\ + ,\n \"offer\": \"WindowsServer\",\n \"sku\": \"2022-datacenter-azure-edition-core\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Win2019Datacenter\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2019-Datacenter\",\n \"version\": \"latest\"\ + ,\n \"architecture\": \"x64\"\n },\n \"Win2016Datacenter\"\ + : {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"\ + offer\": \"WindowsServer\",\n \"sku\": \"2016-Datacenter\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\ + \n },\n \"Win2012R2Datacenter\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2012-R2-Datacenter\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Win2012Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\"\ + ,\n \"offer\": \"WindowsServer\",\n \"sku\": \"2012-Datacenter\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Win2008R2SP1\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2008-R2-SP1\",\n \"version\": \"latest\"\ + ,\n \"architecture\": \"x64\"\n }\n }\n }\n\ + \ }\n }\n}\n" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '5018' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + cross-origin-resource-policy: + - cross-origin + date: + - Tue, 22 Aug 2023 06:37:57 GMT + etag: + - W/"0a553f088c358b909a2940b5a97fcb731c1d443cb7a332ca4933eb2b7df38468" + expires: + - Tue, 22 Aug 2023 06:42:57 GMT + source-age: + - '3' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding,Origin + via: + - 1.1 varnish + x-cache: + - HIT + x-cache-hits: + - '1' + x-content-type-options: + - nosniff + x-fastly-request-id: + - bca78b0baeca00604b9eaf80571daff091f74cdf + x-frame-options: + - deny + x-github-request-id: + - C216:052D:131F2D:161398:64E142E1 + x-served-by: + - cache-qpg1271-QPG + x-timer: + - S1692686277.125973,VS0,VE2 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions?$top=1&$orderby=name%20desc&api-version=2022-11-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"18.04.202306070\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202306070\"\ + \r\n }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '286' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:37:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15998,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43993 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions/18.04.202306070?api-version=2022-11-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \ + \ \"architecture\": \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n\ + \ \"disallowed\": {\r\n \"vmDiskType\": \"None\"\r\n },\r\n \ + \ \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\"\ + : true\r\n },\r\n \"imageDeprecationStatus\": {\r\n \"imageState\"\ + : \"Active\"\r\n },\r\n \"features\": [\r\n {\r\n \"name\"\ + : \"IsAcceleratedNetworkSupported\",\r\n \"value\": \"True\"\r\n \ + \ },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n \ + \ \"value\": \"SCSI, NVMe\"\r\n },\r\n {\r\n \"name\":\ + \ \"IsHibernateSupported\",\r\n \"value\": \"True\"\r\n }\r\n\ + \ ],\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\"\ + ,\r\n \"sizeInGb\": 31,\r\n \"sizeInBytes\": 32213303808\r\n \ + \ },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"eastus\",\r\ + \n \"name\": \"18.04.202306070\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202306070\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1048' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:37:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12998,Microsoft.Compute/GetVMImageFromLocation30Min;73994 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions?$top=1&$orderby=name%20desc&api-version=2022-11-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"eastus\",\r\n \"name\": \"18.04.202306070\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202306070\"\ + \r\n }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '286' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:37:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15997,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43992 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions/18.04.202306070?api-version=2022-11-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \ + \ \"architecture\": \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n\ + \ \"disallowed\": {\r\n \"vmDiskType\": \"None\"\r\n },\r\n \ + \ \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\"\ + : true\r\n },\r\n \"imageDeprecationStatus\": {\r\n \"imageState\"\ + : \"Active\"\r\n },\r\n \"features\": [\r\n {\r\n \"name\"\ + : \"IsAcceleratedNetworkSupported\",\r\n \"value\": \"True\"\r\n \ + \ },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n \ + \ \"value\": \"SCSI, NVMe\"\r\n },\r\n {\r\n \"name\":\ + \ \"IsHibernateSupported\",\r\n \"value\": \"True\"\r\n }\r\n\ + \ ],\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\"\ + ,\r\n \"sizeInGb\": 31,\r\n \"sizeInBytes\": 32213303808\r\n \ + \ },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"eastus\",\r\ + \n \"name\": \"18.04.202306070\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202306070\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1048' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:37:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12997,Microsoft.Compute/GetVMImageFromLocation30Min;73993 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2021-12-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.OperationalInsights/workspaces/clitest000002'' + under resource group ''cli_test_scheduled_query_operator000001'' was not found. + For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '265' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:38:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001","name":"cli_test_scheduled_query_operator000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_scheduled_query_condition_operator","date":"2023-08-22T06:37:48Z","module":"scheduled-query"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '432' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:38:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"sku": {"name": "PerGB2018"}, "retentionInDays": + 30, "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": + "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '179' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2021-12-01-preview + response: + body: + string: '{"properties":{"customerId":"1209443a-4c65-41fe-80e5-69cc811b2cab","provisioningState":"Creating","sku":{"name":"PerGB2018","lastSkuUpdate":"2023-08-22T06:38:06.2306521Z"},"retentionInDays":30,"features":{"legacy":0,"searchVersion":1,"enableLogAccessUsingOnlyResourcePermissions":true},"workspaceCapping":{"dailyQuotaGb":-1.0,"quotaNextResetTime":"2023-08-22T09:00:00Z","dataIngestionStatus":"RespectQuota"},"publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled","createdDate":"2023-08-22T06:38:06.2306521Z","modifiedDate":"2023-08-22T06:38:06.2306521Z"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002","name":"clitest000002","type":"Microsoft.OperationalInsights/workspaces"}' + headers: + access-control-allow-origin: + - '*' + api-supported-versions: + - 2021-12-01-preview + cache-control: + - no-cache + content-length: + - '856' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:38:07 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2021-12-01-preview + pragma: + - no-cache + request-context: + - appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2021-12-01-preview + response: + body: + string: '{"properties":{"customerId":"1209443a-4c65-41fe-80e5-69cc811b2cab","provisioningState":"Succeeded","sku":{"name":"PerGB2018","lastSkuUpdate":"2023-08-22T06:38:06.2306521Z"},"retentionInDays":30,"features":{"legacy":0,"searchVersion":1,"enableLogAccessUsingOnlyResourcePermissions":true},"workspaceCapping":{"dailyQuotaGb":-1.0,"quotaNextResetTime":"2023-08-22T09:00:00Z","dataIngestionStatus":"RespectQuota"},"publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled","createdDate":"2023-08-22T06:38:06.2306521Z","modifiedDate":"2023-08-22T06:38:07.3612085Z"},"location":"eastus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002","name":"clitest000002","type":"Microsoft.OperationalInsights/workspaces"}' + headers: + access-control-allow-origin: + - '*' + api-supported-versions: + - 2021-12-01-preview + cache-control: + - no-cache + content-length: + - '857' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:38:07 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"workspaceId": {"type": "securestring", + "metadata": {"description": "Secure workspaceId"}}}, "variables": {}, "resources": + [{"name": "myvm1VNET", "type": "Microsoft.Network/virtualNetworks", "location": + "eastus", "apiVersion": "2015-06-15", "dependsOn": [], "tags": {}, "properties": + {"addressSpace": {"addressPrefixes": ["10.0.0.0/16"]}, "subnets": [{"name": + "myvm1Subnet", "properties": {"addressPrefix": "10.0.0.0/24"}}]}}, {"type": + "Microsoft.Network/networkSecurityGroups", "name": "myvm1NSG", "apiVersion": + "2015-06-15", "location": "eastus", "tags": {}, "dependsOn": []}, {"apiVersion": + "2022-01-01", "type": "Microsoft.Network/publicIPAddresses", "name": "myvm1PublicIP", + "location": "eastus", "tags": {}, "dependsOn": [], "properties": {"publicIPAllocationMethod": + null}}, {"apiVersion": "2015-06-15", "type": "Microsoft.Network/networkInterfaces", + "name": "myvm1VMNic", "location": "eastus", "tags": {}, "dependsOn": ["Microsoft.Network/virtualNetworks/myvm1VNET", + "Microsoft.Network/networkSecurityGroups/myvm1NSG", "Microsoft.Network/publicIpAddresses/myvm1PublicIP"], + "properties": {"ipConfigurations": [{"name": "ipconfigmyvm1", "properties": + {"privateIPAllocationMethod": "Dynamic", "subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET/subnets/myvm1Subnet"}, + "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP"}}}], + "networkSecurityGroup": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG"}}}, + {"type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2018-10-01", + "properties": {"publisher": "Microsoft.EnterpriseCloud.Monitoring", "type": + "OmsAgentForLinux", "typeHandlerVersion": "1.0", "autoUpgradeMinorVersion": + "true", "settings": {"workspaceId": "[reference(parameters(''workspaceId''), + ''2015-11-01-preview'').customerId]", "stopOnMultipleConnections": "true"}, + "protectedSettings": {"workspaceKey": "[listKeys(parameters(''workspaceId''), + ''2015-11-01-preview'').primarySharedKey]"}}, "name": "myvm1/OmsAgentForLinux", + "location": "eastus", "dependsOn": ["Microsoft.Compute/virtualMachines/myvm1"]}, + {"apiVersion": "2022-11-01", "type": "Microsoft.Compute/virtualMachines", "name": + "myvm1", "location": "eastus", "tags": {}, "dependsOn": ["Microsoft.Network/networkInterfaces/myvm1VMNic"], + "properties": {"hardwareProfile": {"vmSize": "Standard_DS1_v2"}, "networkProfile": + {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic", + "properties": {"deleteOption": null}}]}, "storageProfile": {"osDisk": {"createOption": + "fromImage", "name": null, "caching": "ReadWrite", "managedDisk": {"storageAccountType": + null}}, "imageReference": {"publisher": "Canonical", "offer": "UbuntuServer", + "sku": "18.04-LTS", "version": "latest"}}, "osProfile": {"computerName": "myvm1", + "adminUsername": "allywang", "linuxConfiguration": {"disablePasswordAuthentication": + true, "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFSknCfonnWcpgV7oFG3p19Kc/FITqfH8/U80YU75CMyr4oJQR07eUQHET8U+cCeFsYPIZoSIYwMGaykwMolralf5do9NPDCqcDqnlKQ4vQoCdZwbD0lGDwlkkxQBXUaBxbur0XL3KAqh7uDaytp4+G8jRtDL5EVZJfMJiGSTnKmouYSL1nZpNqTYcZKLasbCLiCoJ6zUQYWXgiPaZFCItIFE+YWqmMTGRMSYzAJzEdRf5Gkgh0gqf2lbDWu97Br9IePxW0UyvWxP5MUfKGjie9bO2Hx41W5qMkvmN3JUhqEZwVqR66J+sXoOkctmRNSAvDGRC4n2O0wMq9CoHRMY1 + allywang@lalala\n", "path": "/home/allywang/.ssh/authorized_keys"}]}}}}}], "outputs": + {}}, "parameters": {"workspaceId": {"value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002"}}, + "mode": "incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '4236' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/vm_deploy_RjMbrbsQePVl2aEz9TfGv5qDAeoo4RIL","name":"vm_deploy_RjMbrbsQePVl2aEz9TfGv5qDAeoo4RIL","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17711336129887255666","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-08-22T06:38:15.8748099Z","duration":"PT0.0003101S","correlationId":"5d8fe954-7174-4caa-a169-c70ed6d34c72","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002","resourceType":"Microsoft.OperationalInsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002","resourceType":"Microsoft.OperationalInsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/vm_deploy_RjMbrbsQePVl2aEz9TfGv5qDAeoo4RIL/operationStatuses/08585089205928796308?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '3803' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:38:16 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585089205928796308?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:38:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585089205928796308?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:38:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585089205928796308?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:39:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585089205928796308?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:39:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585089205928796308?api-version=2022-09-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Resources/deployments/vm_deploy_RjMbrbsQePVl2aEz9TfGv5qDAeoo4RIL","name":"vm_deploy_RjMbrbsQePVl2aEz9TfGv5qDAeoo4RIL","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17711336129887255666","parameters":{"workspaceId":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-08-22T06:40:08.2933581Z","duration":"PT1M52.4188583S","correlationId":"5d8fe954-7174-4caa-a169-c70ed6d34c72","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus"]},{"resourceType":"networkSecurityGroups","locations":["eastus"]},{"resourceType":"publicIPAddresses","locations":["eastus"]},{"resourceType":"networkInterfaces","locations":["eastus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines/extensions","locations":["eastus"]},{"resourceType":"virtualMachines","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"myvm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"myvm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002","resourceType":"Microsoft.OperationalInsights/workspaces","resourceName":"clitest000002","apiVersion":"2015-11-01-preview"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002","resourceType":"Microsoft.OperationalInsights/workspaces","resourceName":"clitest000002","actionName":"listKeys","apiVersion":"2015-11-01-preview"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux","resourceType":"Microsoft.Compute/virtualMachines/extensions","resourceName":"myvm1/OmsAgentForLinux"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"myvm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"myvm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '4894' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1?$expand=instanceView&api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"myvm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ + : \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"\ + 3ca78ec0-255d-49d7-9125-b3e28ea7bd1a\",\r\n \"hardwareProfile\": {\r\n\ + \ \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n \"storageProfile\"\ + : {\r\n \"imageReference\": {\r\n \"publisher\": \"Canonical\"\ + ,\r\n \"offer\": \"UbuntuServer\",\r\n \"sku\": \"18.04-LTS\"\ + ,\r\n \"version\": \"latest\",\r\n \"exactVersion\": \"18.04.202306070\"\ + \r\n },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n\ + \ \"name\": \"myvm1_disk1_d2dac20178ca4fd9b61b783296efef38\",\r\n \ + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\"\ + ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/disks/myvm1_disk1_d2dac20178ca4fd9b61b783296efef38\"\ + \r\n },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\"\ + : 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\"\ + : {\r\n \"computerName\": \"myvm1\",\r\n \"adminUsername\": \"allywang\"\ + ,\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\"\ + : true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n \ + \ {\r\n \"path\": \"/home/allywang/.ssh/authorized_keys\",\r\ + \n \"keyData\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFSknCfonnWcpgV7oFG3p19Kc/FITqfH8/U80YU75CMyr4oJQR07eUQHET8U+cCeFsYPIZoSIYwMGaykwMolralf5do9NPDCqcDqnlKQ4vQoCdZwbD0lGDwlkkxQBXUaBxbur0XL3KAqh7uDaytp4+G8jRtDL5EVZJfMJiGSTnKmouYSL1nZpNqTYcZKLasbCLiCoJ6zUQYWXgiPaZFCItIFE+YWqmMTGRMSYzAJzEdRf5Gkgh0gqf2lbDWu97Br9IePxW0UyvWxP5MUfKGjie9bO2Hx41W5qMkvmN3JUhqEZwVqR66J+sXoOkctmRNSAvDGRC4n2O0wMq9CoHRMY1\ + \ allywang@lalala\\n\"\r\n }\r\n ]\r\n },\r\n \ + \ \"provisionVMAgent\": true,\r\n \"patchSettings\": {\r\n \ + \ \"patchMode\": \"ImageDefault\",\r\n \"assessmentMode\"\ + : \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\"\ + : false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\"\ + : true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"\ + networkProfile\": {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic\"\ + }]},\r\n \"provisioningState\": \"Succeeded\",\r\n \"instanceView\"\ + : {\r\n \"computerName\": \"myvm1\",\r\n \"osName\": \"ubuntu\"\ + ,\r\n \"osVersion\": \"18.04\",\r\n \"vmAgent\": {\r\n \"\ + vmAgentVersion\": \"2.9.1.1\",\r\n \"statuses\": [\r\n {\r\ + \n \"code\": \"ProvisioningState/succeeded\",\r\n \"\ + level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n \ + \ \"message\": \"Guest Agent is running\",\r\n \"time\": \"\ + 2023-08-22T06:39:53+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\"\ + : [\r\n {\r\n \"type\": \"Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux\"\ + ,\r\n \"typeHandlerVersion\": \"1.16.0\",\r\n \"status\"\ + : {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n \ + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\ + ,\r\n \"message\": \"Plugin enabled\"\r\n }\r\n \ + \ }\r\n ]\r\n },\r\n \"disks\": [\r\n {\r\n\ + \ \"name\": \"myvm1_disk1_d2dac20178ca4fd9b61b783296efef38\",\r\n\ + \ \"statuses\": [\r\n {\r\n \"code\": \"\ + ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \ + \ \"displayStatus\": \"Provisioning succeeded\",\r\n \ + \ \"time\": \"2023-08-22T06:38:40.5932012+00:00\"\r\n }\r\n\ + \ ]\r\n }\r\n ],\r\n \"extensions\": [\r\n \ + \ {\r\n \"name\": \"OmsAgentForLinux\",\r\n \"type\":\ + \ \"Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux\",\r\n \ + \ \"typeHandlerVersion\": \"1.16.0\",\r\n \"statuses\": [\r\n \ + \ {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n\ + \ \"level\": \"Info\",\r\n \"displayStatus\": \"\ + Provisioning succeeded\",\r\n \"message\": \"Enable succeeded\"\ + \r\n }\r\n ]\r\n }\r\n ],\r\n \"hyperVGeneration\"\ + : \"V1\",\r\n \"statuses\": [\r\n {\r\n \"code\": \"\ + ProvisioningState/succeeded\",\r\n \"level\": \"Info\",\r\n \ + \ \"displayStatus\": \"Provisioning succeeded\",\r\n \"time\"\ + : \"2023-08-22T06:40:02.8896354+00:00\"\r\n },\r\n {\r\n \ + \ \"code\": \"PowerState/running\",\r\n \"level\": \"Info\"\ + ,\r\n \"displayStatus\": \"VM running\"\r\n }\r\n ]\r\ + \n },\r\n \"timeCreated\": \"2023-08-22T06:38:37.3119676+00:00\"\r\n\ + \ },\r\n \"resources\": [\r\n {\r\n \"name\": \"OmsAgentForLinux\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1/extensions/OmsAgentForLinux\"\ + ,\r\n \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n\ + \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"\ + autoUpgradeMinorVersion\": true,\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"publisher\": \"Microsoft.EnterpriseCloud.Monitoring\",\r\n\ + \ \"type\": \"OmsAgentForLinux\",\r\n \"typeHandlerVersion\"\ + : \"1.0\",\r\n \"settings\": {\"workspaceId\":\"1209443a-4c65-41fe-80e5-69cc811b2cab\"\ + ,\"stopOnMultipleConnections\":\"true\"}\r\n }\r\n }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '5502' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3989,Microsoft.Compute/LowCostGet30Min;31984 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"myvm1VMNic\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic\"\ + ,\r\n \"etag\": \"W/\\\"13362f5c-6e4e-42bd-b69d-7219639f5636\\\"\",\r\n \ + \ \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"resourceGuid\": \"0ff98f1d-4a0c-4e0b-9f8d-57d691d602db\",\r\n \ + \ \"ipConfigurations\": [\r\n {\r\n \"name\": \"ipconfigmyvm1\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic/ipConfigurations/ipconfigmyvm1\"\ + ,\r\n \"etag\": \"W/\\\"13362f5c-6e4e-42bd-b69d-7219639f5636\\\"\"\ + ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ + ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ + ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ + : \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\":\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP\"\ + \r\n },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/virtualNetworks/myvm1VNET/subnets/myvm1Subnet\"\ + \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ + : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ + \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ + internalDomainNameSuffix\": \"uobdex3ntepurocbxcsk0gz5eh.bx.internal.cloudapp.net\"\ + \r\n },\r\n \"macAddress\": \"00-0D-3A-8E-4C-7F\",\r\n \"enableAcceleratedNetworking\"\ + : false,\r\n \"vnetEncryptionSupported\": false,\r\n \"enableIPForwarding\"\ + : false,\r\n \"networkSecurityGroup\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkSecurityGroups/myvm1NSG\"\ + \r\n },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \ + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1\"\ + \r\n },\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\ + \n \"nicType\": \"Standard\",\r\n \"allowPort25Out\": true,\r\n \"\ + auxiliaryMode\": \"None\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\ + ,\r\n \"location\": \"eastus\",\r\n \"kind\": \"Regular\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2578' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:22 GMT + etag: + - W/"13362f5c-6e4e-42bd-b69d-7219639f5636" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 18dbe66b-b231-433d-96ac-c467d12eb63e + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"myvm1PublicIP\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/publicIPAddresses/myvm1PublicIP\"\ + ,\r\n \"etag\": \"W/\\\"2fc5b19d-2d99-4692-919f-2db920380aa9\\\"\",\r\n \ + \ \"location\": \"eastus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n\ + \ \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"631e4a0c-a070-448c-aa51-aba7422bf44a\"\ + ,\r\n \"ipAddress\": \"172.172.219.75\",\r\n \"publicIPAddressVersion\"\ + : \"IPv4\",\r\n \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\"\ + : 4,\r\n \"ipTags\": [],\r\n \"ipConfiguration\": {\r\n \"id\"\ + : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Network/networkInterfaces/myvm1VMNic/ipConfigurations/ipconfigmyvm1\"\ + \r\n }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\ + \n \"sku\": {\r\n \"name\": \"Basic\",\r\n \"tier\": \"Regional\"\r\ + \n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '959' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:23 GMT + etag: + - W/"2fc5b19d-2d99-4692-919f-2db920380aa9" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - c5266e01-e0d8-4aec-90d1-bad577395640 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"state": "Enabled"}, "kind": "LinuxPerformanceCollection"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '74' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001?api-version=2020-08-01 + response: + body: + string: '{"kind":"LinuxPerformanceCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","etag":"W/\"datetime''2023-08-22T06%3A40%3A26.2182550Z''\"","name":"DataSource_LinuxPerformanceCollection_88888888-0000-0000-0000-000000000001","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '540' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:26 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"instanceName": "*", "intervalSeconds": 10, "objectName": + "Memory", "performanceCounters": [{"counterName": "Available MBytes Memory"}, + {"counterName": "% Used Memory"}, {"counterName": "% Used Swap Space"}]}, "kind": + "LinuxPerformanceObject"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '259' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002?api-version=2020-08-01 + response: + body: + string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Memory","performanceCounters":[{"counterName":"Available + MBytes Memory"},{"counterName":"% Used Memory"},{"counterName":"% Used Swap + Space"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","etag":"W/\"datetime''2023-08-22T06%3A40%3A27.8825854Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000002","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '706' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:28 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"instanceName": "*", "intervalSeconds": 10, "objectName": + "Processor", "performanceCounters": [{"counterName": "% Processor Time"}, {"counterName": + "% Privileged Time"}]}, "kind": "LinuxPerformanceObject"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '221' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003?api-version=2020-08-01 + response: + body: + string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Processor","performanceCounters":[{"counterName":"% + Processor Time"},{"counterName":"% Privileged Time"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","etag":"W/\"datetime''2023-08-22T06%3A40%3A29.5514598Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000003","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '670' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:29 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"instanceName": "*", "intervalSeconds": 10, "objectName": + "Logical Disk", "performanceCounters": [{"counterName": "% Used Inodes"}, {"counterName": + "Free Megabytes"}, {"counterName": "% Used Space"}, {"counterName": "Disk Transfers/sec"}, + {"counterName": "Disk Reads/sec"}, {"counterName": "Disk Writes/sec"}]}, "kind": + "LinuxPerformanceObject"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '361' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004?api-version=2020-08-01 + response: + body: + string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Logical + Disk","performanceCounters":[{"counterName":"% Used Inodes"},{"counterName":"Free + Megabytes"},{"counterName":"% Used Space"},{"counterName":"Disk Transfers/sec"},{"counterName":"Disk + Reads/sec"},{"counterName":"Disk Writes/sec"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","etag":"W/\"datetime''2023-08-22T06%3A40%3A31.1277162Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000004","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '802' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:31 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"instanceName": "*", "intervalSeconds": 10, "objectName": + "Network", "performanceCounters": [{"counterName": "Total Bytes Transmitted"}, + {"counterName": "Total Bytes Received"}]}, "kind": "LinuxPerformanceObject"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '229' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005?api-version=2020-08-01 + response: + body: + string: '{"kind":"LinuxPerformanceObject","properties":{"instanceName":"*","intervalSeconds":10,"objectName":"Network","performanceCounters":[{"counterName":"Total + Bytes Transmitted"},{"counterName":"Total Bytes Received"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","etag":"W/\"datetime''2023-08-22T06%3A40%3A33.0491615Z''\"","name":"DataSource_LinuxPerformanceObject_88888888-0000-0000-0000-000000000005","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '678' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:33 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"state": "Enabled"}, "kind": "LinuxSyslogCollection"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '69' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006?api-version=2020-08-01 + response: + body: + string: '{"kind":"LinuxSyslogCollection","properties":{"state":"Enabled"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","etag":"W/\"datetime''2023-08-22T06%3A40%3A34.8157629Z''\"","name":"DataSource_LinuxSyslogCollection_88888888-0000-0000-0000-000000000006","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '525' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:35 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"syslogName": "syslog", "syslogSeverities": [{"severity": + "notice"}, {"severity": "info"}, {"severity": "debug"}]}, "kind": "LinuxSyslog"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '154' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --nsg-rule --workspace --generate-ssh-keys + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-loganalytics/13.0.0b4 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/dataSources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007?api-version=2020-08-01 + response: + body: + string: '{"kind":"LinuxSyslog","properties":{"syslogName":"syslog","syslogSeverities":[{"severity":"notice"},{"severity":"info"},{"severity":"debug"}]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002/datasources/DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","etag":"W/\"datetime''2023-08-22T06%3A40%3A36.7068021Z''\"","name":"DataSource_LinuxSyslog_88888888-0000-0000-0000-000000000007","type":"Microsoft.OperationalInsights/workspaces/datasources"}' + headers: + access-control-allow-origin: + - '*' + cache-control: + - no-cache + content-length: + - '583' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:40:36 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1193' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query create + Connection: + - keep-alive + ParameterSetName: + - -g -n --scopes --condition --condition-query --description + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_scheduled_query_operator000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001","name":"cli_test_scheduled_query_operator000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","test":"test_scheduled_query_condition_operator","date":"2023-08-22T06:37:48Z","module":"scheduled-query"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '432' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:43:42 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"description": "Test rule", "severity": + 2, "enabled": true, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1"], + "evaluationFrequency": "PT5M", "windowSize": "PT5M", "criteria": {"allOf": [{"query": + "union Event, Syslog | where TimeGenerated > ago(1h)", "timeAggregation": "Count", + "dimensions": [], "operator": "Equal", "threshold": 360.0, "failingPeriods": + {"numberOfEvaluationPeriods": 1, "minFailingPeriodsToAlert": 1}}]}, "actions": + {"actionGroups": [], "customProperties": {}}, "checkWorkspaceAlertsStorageConfigured": + false, "skipQueryValidation": false, "autoMitigate": true}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query create + Connection: + - keep-alive + Content-Length: + - '741' + Content-Type: + - application/json + ParameterSetName: + - -g -n --scopes --condition --condition-query --description + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"liwang3@microsoft.com","createdByType":"User","createdAt":"2023-08-22T06:43:46.3783405Z","lastModifiedBy":"liwang3@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-08-22T06:43:46.3783405Z"},"properties":{"createdWithApiVersion":"2021-08-01","description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"Equal","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' + headers: + cache-control: + - no-cache + content-length: + - '1148' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:43:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-rate-limit-limit: + - 1m + x-rate-limit-remaining: + - '14' + x-rate-limit-reset: + - '2023-08-22T06:44:46.4511299Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query update + Connection: + - keep-alive + ParameterSetName: + - -g -n --condition --condition-query --description --severity --disabled --evaluation-frequency + --window-size + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"liwang3@microsoft.com","createdByType":"User","createdAt":"2023-08-22T06:43:46.3783405Z","lastModifiedBy":"liwang3@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-08-22T06:43:46.3783405Z"},"properties":{"createdWithApiVersion":"2021-08-01","description":"Test + rule","severity":2,"enabled":true,"evaluationFrequency":"PT5M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT5M","criteria":{"allOf":[{"query":"union + Event, Syslog | where TimeGenerated > ago(1h)","timeAggregation":"Count","dimensions":[],"operator":"Equal","threshold":360.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' + headers: + cache-control: + - no-cache + content-length: + - '1148' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:43:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-rate-limit-limit: + - 1m + x-rate-limit-remaining: + - '49' + x-rate-limit-reset: + - '2023-08-22T06:44:56.4345746Z' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"description": "Test rule 2", "severity": + 4, "enabled": false, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1"], + "evaluationFrequency": "PT10M", "windowSize": "PT10M", "criteria": {"allOf": + [{"query": "union Event | where TimeGenerated > ago(2h)", "timeAggregation": + "Count", "dimensions": [], "operator": "Equal", "threshold": 260.0, "failingPeriods": + {"numberOfEvaluationPeriods": 1, "minFailingPeriodsToAlert": 1}}]}, "checkWorkspaceAlertsStorageConfigured": + false, "skipQueryValidation": false, "autoMitigate": true}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query update + Connection: + - keep-alive + Content-Length: + - '681' + Content-Type: + - application/json + ParameterSetName: + - -g -n --condition --condition-query --description --severity --disabled --evaluation-frequency + --window-size + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/microsoft.insights/scheduledqueryrules/sq01","name":"sq01","type":"microsoft.insights/scheduledqueryrules","location":"eastus","systemData":{"createdBy":"liwang3@microsoft.com","createdByType":"User","createdAt":"2023-08-22T06:43:46.3783405Z","lastModifiedBy":"liwang3@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-08-22T06:43:57.6399888Z"},"properties":{"createdWithApiVersion":"2021-08-01","description":"Test + rule 2","severity":4,"enabled":false,"evaluationFrequency":"PT10M","scopes":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Compute/virtualMachines/myvm1"],"windowSize":"PT10M","criteria":{"allOf":[{"query":"union + Event | where TimeGenerated > ago(2h)","timeAggregation":"Count","dimensions":[],"operator":"Equal","threshold":260.0,"failingPeriods":{"numberOfEvaluationPeriods":1,"minFailingPeriodsToAlert":1}}]},"autoMitigate":true,"checkWorkspaceAlertsStorageConfigured":false,"skipQueryValidation":false}}' + headers: + cache-control: + - no-cache + content-length: + - '1145' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:44:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-rate-limit-limit: + - 1m + x-rate-limit-remaining: + - '14' + x-rate-limit-reset: + - '2023-08-22T06:44:58.3989647Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n -y + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-08-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 22 Aug 2023 06:44:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor scheduled-query show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.51.0 azsdk-python-mgmt-monitor/1.0.0b1 Python/3.10.6 (macOS-13.5-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_scheduled_query_operator000001/providers/Microsoft.Insights/scheduledQueryRules/sq01?api-version=2021-08-01 + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Insights/scheduledqueryrules/sq01'' + under resource group ''cli_test_scheduled_query_operator000001'' was not found. + For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '254' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Aug 2023 06:44:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +version: 1 diff --git a/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py b/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py index d7d80909405..8b7071080a3 100644 --- a/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py +++ b/src/scheduled-query/azext_scheduled_query/tests/latest/test_scheduled_query_scenario.py @@ -112,6 +112,59 @@ def test_scheduled_query(self, resource_group): self.cmd('monitor scheduled-query show -g {rg} -n {name1}') + @ResourceGroupPreparer(name_prefix='cli_test_scheduled_query_operator', location='eastus') + def test_scheduled_query_condition_operator(self, resource_group): + from azure.mgmt.core.tools import resource_id + import time + from unittest import mock + self.kwargs.update({ + 'name1': 'sq01', + 'rg': resource_group, + 'vm': 'myvm1', + 'ws': self.create_random_name('clitest', 20), + }) + with mock.patch('azure.cli.command_modules.vm.custom._gen_guid', side_effect=self.create_guid): + vm = self.cmd('vm create -n {vm} -g {rg} --image UbuntuLTS --nsg-rule None --workspace {ws} --generate-ssh-keys').get_output_in_json() + self.kwargs.update({ + 'vm_id': vm['id'], + 'rg_id': resource_id(subscription=self.get_subscription_id(), + resource_group=resource_group), + 'sub_id': resource_id(subscription=self.get_subscription_id(), + resource_group=resource_group), + }) + time.sleep(180) + self.cmd('monitor scheduled-query create -g {rg} -n {name1} --scopes {vm_id} --condition "count \'placeholder_1\' = 360" --condition-query placeholder_1="union Event, Syslog | where TimeGenerated > ago(1h)" --description "Test rule"', + checks=[ + self.check('name', '{name1}'), + self.check('scopes[0]', '{vm_id}'), + self.check('severity', 2), + self.check('criteria.allOf[0].query', 'union Event, Syslog | where TimeGenerated > ago(1h)'), + self.check('criteria.allOf[0].threshold', 360), + self.check('criteria.allOf[0].timeAggregation', 'Count'), + self.check('criteria.allOf[0].operator', 'Equal'), + self.check('criteria.allOf[0].failingPeriods.minFailingPeriodsToAlert', 1), + self.check('criteria.allOf[0].failingPeriods.numberOfEvaluationPeriods', 1), + self.check('autoMitigate', True), + self.check('skipQueryValidation', False), + self.check('checkWorkspaceAlertsStorageConfigured', False) + ]) + self.cmd('monitor scheduled-query update -g {rg} -n {name1} --condition "count \'placeholder_1\' = 260" --condition-query placeholder_1="union Event | where TimeGenerated > ago(2h)" --description "Test rule 2" --severity 4 --disabled --evaluation-frequency 10m --window-size 10m', + checks=[ + self.check('name', '{name1}'), + self.check('scopes[0]', '{vm_id}'), + self.check('severity', 4), + self.check('windowSize', '0:10:00'), + self.check('evaluationFrequency', '0:10:00'), + self.check('criteria.allOf[0].query', 'union Event | where TimeGenerated > ago(2h)'), + self.check('criteria.allOf[0].threshold', 260), + self.check('criteria.allOf[0].timeAggregation', 'Count'), + self.check('criteria.allOf[0].operator', 'Equal') + ]) + self.cmd('monitor scheduled-query delete -g {rg} -n {name1} -y') + with self.assertRaisesRegexp(SystemExit, '3'): + self.cmd('monitor scheduled-query show -g {rg} -n {name1}') + + class ScheduledQueryCondtionTest(unittest.TestCase): def _build_namespace(self, name_or_id=None, resource_group=None, provider_namespace=None, parent=None, @@ -176,3 +229,7 @@ def test_monitor_scheduled_query_condition_action(self): self.check_dimension(ns, 0, 'ApiName', 'Include', ['GetBlob', 'PutBlob']) self.check_dimension(ns, 1, 'DpiName', 'Exclude', ['CCC']) self.check_falling_period(ns, 1, 10) + + ns = self._build_namespace() + self.call_condition(ns, 'avg "Perf" = 90') + self.check_condition(ns, 'Average', 'Perf', 'Equal', '90') From 6412b899a20f8b31ae9c3ab71937a5c38d259dbb Mon Sep 17 00:00:00 2001 From: AllyWang Date: Mon, 28 Aug 2023 16:26:04 +0800 Subject: [PATCH 2/2] release update --- src/scheduled-query/HISTORY.rst | 3 +++ src/scheduled-query/setup.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scheduled-query/HISTORY.rst b/src/scheduled-query/HISTORY.rst index 11686b022d7..f4bb2501c25 100644 --- a/src/scheduled-query/HISTORY.rst +++ b/src/scheduled-query/HISTORY.rst @@ -2,6 +2,9 @@ Release History =============== +0.5.2 +++++++ +* Fix scheduled query condition operator mapping 0.5.1 ++++++ diff --git a/src/scheduled-query/setup.py b/src/scheduled-query/setup.py index cff9cee3711..54e0b861ffa 100644 --- a/src/scheduled-query/setup.py +++ b/src/scheduled-query/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.5.1' +VERSION = '0.5.2' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers