forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure Monitor Query: Migrate to test proxy (Azure#34542)
* Azure Monitor Query: Migrate to test proxy * add comment * fix recording * remove unused imports
- Loading branch information
Showing
46 changed files
with
56,466 additions
and
1,229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
202 changes: 175 additions & 27 deletions
202
...test/resources/session-records/LogsQueryAsyncClientTest.testBatchQueryPartialSuccess.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,176 @@ | ||
{ | ||
"networkCallRecords" : [ { | ||
"Method" : "POST", | ||
"Uri" : "https://REDACTED.loganalytics.io/v1/$batch", | ||
"Headers" : { | ||
"User-Agent" : "azsdk-java-azure-monitor-query/1.2.0-beta.1 (17.0.2; Windows 11; 10.0)", | ||
"x-ms-client-request-id" : "3d7f76cb-71e9-4837-930e-176eebc57741", | ||
"Content-Type" : "application/json" | ||
}, | ||
"Response" : { | ||
"Transfer-Encoding" : "chunked", | ||
"Access-Control-Allow-Origin" : "*", | ||
"X-Content-Type-Options" : "nosniff", | ||
"Connection" : "keep-alive", | ||
"retry-after" : "0", | ||
"StatusCode" : "200", | ||
"Date" : "Tue, 14 Mar 2023 07:50:11 GMT", | ||
"via" : "1.1 draft-oms-5979b88dcd-kx47g", | ||
"Strict-Transport-Security" : "max-age=15724800; includeSubDomains", | ||
"Access-Control-Expose-Headers" : "Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location", | ||
"Vary" : "Accept-Encoding", | ||
"Body" : "{\"responses\":[{\"id\":\"2\",\"status\":400,\"body\":{\"error\":{\"message\":\"The request had some invalid properties\",\"code\":\"BadArgumentError\",\"correlationId\":\"31269348-b3c4-4147-b79e-f1143ee64c0c\",\"innererror\":{\"code\":\"SyntaxError\",\"message\":\"A recognition error occurred in the query.\",\"innererror\":{\"code\":\"SYN0002\",\"message\":\"Query could not be parsed at '<EOF>' on line [2,299]\",\"line\":2,\"pos\":299,\"token\":\"<EOF>\"}}}}},{\"id\":\"1\",\"status\":200,\"body\":{\"tables\":[{\"name\":\"PrimaryResult\",\"columns\":[{\"name\":\"x\",\"type\":\"long\"},{\"name\":\"y\",\"type\":\"long\"},{\"name\":\"DateTime\",\"type\":\"datetime\"},{\"name\":\"Bool\",\"type\":\"bool\"},{\"name\":\"Guid\",\"type\":\"guid\"},{\"name\":\"Int\",\"type\":\"int\"},{\"name\":\"Long\",\"type\":\"long\"},{\"name\":\"Double\",\"type\":\"real\"},{\"name\":\"String\",\"type\":\"string\"},{\"name\":\"Timespan\",\"type\":\"timespan\"},{\"name\":\"Decimal\",\"type\":\"decimal\"},{\"name\":\"Dynamic\",\"type\":\"dynamic\"}],\"rows\":[[100,1,\"2015-12-31T23:59:59.9Z\",false,\"74be27de-1e4e-49d9-b579-fe0b331d3642\",12345,1,12345.6789,\"string value\",\"00:00:10\",\"0.10101\",\"{\\\"a\\\":123,\\\"b\\\":\\\"hello\\\",\\\"c\\\":[1,2,3],\\\"d\\\":{}}\"],[99,1,\"2015-12-31T23:59:59.9Z\",false,\"74be27de-1e4e-49d9-b579-fe0b331d3642\",12345,1,12345.6789,\"string value\",\"00:00:10\",\"0.10101\",\"{\\\"a\\\":123,\\\"b\\\":\\\"hello\\\",\\\"c\\\":[1,2,3],\\\"d\\\":{}}\"]]}]}}]}", | ||
"Content-Type" : "application/json; charset=utf-8" | ||
}, | ||
"Exception" : null | ||
} ], | ||
"variables" : [ ] | ||
} | ||
"Entries": [ | ||
{ | ||
"RequestUri": "https://REDACTED/v1/$batch", | ||
"RequestMethod": "POST", | ||
"RequestHeaders": { | ||
"Accept": "application/json", | ||
"Authorization": "Sanitized", | ||
"Content-Length": "1234", | ||
"Content-Type": "application/json", | ||
"Date": "Tue, 18 Apr 2023 18:00:51 GMT", | ||
"User-Agent": "azsdk-java-azure-monitor-query/1.2.0-beta.1 (17.0.2; Windows 11; 10.0)", | ||
"x-ms-client-request-id": "e9551643-9abe-483b-af21-fb294d449a61" | ||
}, | ||
"RequestBody": { | ||
"requests": [ | ||
{ | ||
"id": "1", | ||
"body": { | ||
"query": "let dt = datatable (DateTime: datetime, Bool:bool, Guid: guid, Int: int, Long:long, Double: double, String: string, Timespan: timespan, Decimal: decimal, Dynamic: dynamic)\n[datetime(2015-12-31 23:59:59.9), false, guid(74be27de-1e4e-49d9-b579-fe0b331d3642), 12345, 1, 12345.6789, \u0027string value\u0027, 10s, decimal(0.10101), dynamic({\u0022a\u0022:123, \u0022b\u0022:\u0022hello\u0022, \u0022c\u0022:[1,2,3], \u0022d\u0022:{}})];range x from 1 to 100 step 1 | extend y=1 | join kind=fullouter dt on $left.y == $right.Long | take 2" | ||
}, | ||
"workspace": "d2d0e126-fa1e-4b0a-b647-250cdd471e68", | ||
"headers": {}, | ||
"path": "/query", | ||
"method": "POST" | ||
}, | ||
{ | ||
"id": "2", | ||
"body": { | ||
"query": "let dt = datatable (DateTime: datetime, Bool:bool, Guid: guid, Int: int, Long:long, Double: double, String: string, Timespan: timespan, Decimal: decimal, Dynamic: dynamic)\n[datetime(2015-12-31 23:59:59.9), false, guid(74be27de-1e4e-49d9-b579-fe0b331d3642), 12345, 1, 12345.6789, \u0027string value\u0027, 10s, decimal(0.10101), dynamic({\u0022a\u0022:123, \u0022b\u0022:\u0022hello\u0022, \u0022c\u0022:[1,2,3], \u0022d\u0022:{}})];range x from 1 to 100 step 1 | extend y=1 | join kind=fullouter dt on $left.y == $right.Long | take" | ||
}, | ||
"workspace": "d2d0e126-fa1e-4b0a-b647-250cdd471e68", | ||
"headers": {}, | ||
"path": "/query", | ||
"method": "POST" | ||
} | ||
] | ||
}, | ||
"StatusCode": 200, | ||
"ResponseHeaders": { | ||
"Access-Control-Allow-Origin": "*", | ||
"Access-Control-Expose-Headers": "Retry-After,Age,WWW-Authenticate,x-resource-identities,x-ms-status-location", | ||
"Connection": "keep-alive", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Date": "Tue, 18 Apr 2023 18:00:52 GMT", | ||
"Strict-Transport-Security": "max-age=15724800; includeSubDomains", | ||
"Transfer-Encoding": "chunked", | ||
"Vary": "Accept-Encoding", | ||
"Via": "1.1 draft-oms-666995cb46-22qw8", | ||
"X-Content-Type-Options": "nosniff" | ||
}, | ||
"ResponseBody": { | ||
"responses": [ | ||
{ | ||
"id": "1", | ||
"status": 200, | ||
"headers": { | ||
"Age": "91", | ||
"request-context": "appId=cid-v1:70941e4f-7e8f-40b7-b730-183893db0297" | ||
}, | ||
"body": { | ||
"tables": [ | ||
{ | ||
"name": "PrimaryResult", | ||
"columns": [ | ||
{ | ||
"name": "x", | ||
"type": "long" | ||
}, | ||
{ | ||
"name": "y", | ||
"type": "long" | ||
}, | ||
{ | ||
"name": "DateTime", | ||
"type": "datetime" | ||
}, | ||
{ | ||
"name": "Bool", | ||
"type": "bool" | ||
}, | ||
{ | ||
"name": "Guid", | ||
"type": "guid" | ||
}, | ||
{ | ||
"name": "Int", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "Long", | ||
"type": "long" | ||
}, | ||
{ | ||
"name": "Double", | ||
"type": "real" | ||
}, | ||
{ | ||
"name": "String", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "Timespan", | ||
"type": "timespan" | ||
}, | ||
{ | ||
"name": "Decimal", | ||
"type": "decimal" | ||
}, | ||
{ | ||
"name": "Dynamic", | ||
"type": "dynamic" | ||
} | ||
], | ||
"rows": [ | ||
[ | ||
100, | ||
1, | ||
"2015-12-31T23:59:59.9Z", | ||
false, | ||
"74be27de-1e4e-49d9-b579-fe0b331d3642", | ||
12345, | ||
1, | ||
12345.6789, | ||
"string value", | ||
"00:00:10", | ||
"0.10101", | ||
"{\u0022a\u0022:123,\u0022b\u0022:\u0022hello\u0022,\u0022c\u0022:[1,2,3],\u0022d\u0022:{}}" | ||
], | ||
[ | ||
99, | ||
1, | ||
"2015-12-31T23:59:59.9Z", | ||
false, | ||
"74be27de-1e4e-49d9-b579-fe0b331d3642", | ||
12345, | ||
1, | ||
12345.6789, | ||
"string value", | ||
"00:00:10", | ||
"0.10101", | ||
"{\u0022a\u0022:123,\u0022b\u0022:\u0022hello\u0022,\u0022c\u0022:[1,2,3],\u0022d\u0022:{}}" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "2", | ||
"status": 400, | ||
"body": { | ||
"error": { | ||
"message": "The request had some invalid properties", | ||
"code": "BadArgumentError", | ||
"correlationId": "c6c594e9-2703-4738-80c2-3b6ba90316e3", | ||
"innererror": { | ||
"code": "SyntaxError", | ||
"message": "A recognition error occurred in the query.", | ||
"innererror": { | ||
"code": "SYN0002", | ||
"message": "Query could not be parsed at \u0027\u003CEOF\u003E\u0027 on line [2,299]", | ||
"line": 2, | ||
"pos": 299, | ||
"token": "\u003CEOF\u003E" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"Variables": {} | ||
} |
Oops, something went wrong.