diff --git a/specification/applicationinsights/data-plane/microsoft.insights/preview/2018-04-20/examples/query-get.json b/specification/applicationinsights/data-plane/microsoft.insights/preview/2018-04-20/examples/query-get.json new file mode 100644 index 000000000000..56d040875300 --- /dev/null +++ b/specification/applicationinsights/data-plane/microsoft.insights/preview/2018-04-20/examples/query-get.json @@ -0,0 +1,257 @@ +{ + "title": "Get Query", + "description": "A simple query that returns query results.", + "parameters": { + "subscriptionId": "c512b59c-4005-40e2-b13d-ac29cfb46af4", + "resourceGroupName": "test-rg", + "applicationName": "azure-insights", + "apiVersion": "2018-04-20", + "query": "requests | take 10", + "timespan": "PT12H" + }, + "responses": { + "200": { + "headers": { + "x-ms-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5", + "x-ms-correlation-request-id": "58a37988-2c05-427a-891f-5e0e1266fcc5" + }, + "body": { + "tables": [ + { + "name": "PrimaryResult", + "columns": [ + { + "name": "timestamp", + "type": "datetime" + }, + { + "name": "id", + "type": "string" + }, + { + "name": "source", + "type": "string" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "url", + "type": "string" + }, + { + "name": "success", + "type": "string" + }, + { + "name": "resultCode", + "type": "string" + }, + { + "name": "duration", + "type": "real" + }, + { + "name": "performanceBucket", + "type": "string" + }, + { + "name": "customDimensions", + "type": "dynamic" + }, + { + "name": "customMeasurements", + "type": "dynamic" + }, + { + "name": "operation_Name", + "type": "string" + }, + { + "name": "operation_Id", + "type": "string" + }, + { + "name": "operation_ParentId", + "type": "string" + }, + { + "name": "operation_SyntheticSource", + "type": "string" + }, + { + "name": "session_Id", + "type": "string" + }, + { + "name": "user_Id", + "type": "string" + }, + { + "name": "user_AuthenticatedId", + "type": "string" + }, + { + "name": "user_AccountId", + "type": "string" + }, + { + "name": "application_Version", + "type": "string" + }, + { + "name": "client_Type", + "type": "string" + }, + { + "name": "client_Model", + "type": "string" + }, + { + "name": "client_OS", + "type": "string" + }, + { + "name": "client_IP", + "type": "string" + }, + { + "name": "client_City", + "type": "string" + }, + { + "name": "client_StateOrProvince", + "type": "string" + }, + { + "name": "client_CountryOrRegion", + "type": "string" + }, + { + "name": "client_Browser", + "type": "string" + }, + { + "name": "cloud_RoleName", + "type": "string" + }, + { + "name": "cloud_RoleInstance", + "type": "string" + }, + { + "name": "appId", + "type": "string" + }, + { + "name": "appName", + "type": "string" + }, + { + "name": "iKey", + "type": "string" + }, + { + "name": "sdkVersion", + "type": "string" + }, + { + "name": "itemId", + "type": "string" + }, + { + "name": "itemType", + "type": "string" + }, + { + "name": "itemCount", + "type": "int" + } + ], + "rows": [ + [ + "2018-02-01T17:33:09.788Z", + "|0qRud6jz3k0=.c32c2659_", + null, + "GET Reports/Index", + "http://fabrikamfiberapp.azurewebsites.net/Reports", + "True", + "200", + "3.3833", + "<250ms", + "{\"_MS.ProcessedByMetricExtractors\":\"(Name:'Requests', Ver:'1.0')\"}", + null, + "GET Reports/Index", + "0qRud6jz3k0=", + "0qRud6jz3k0=", + "Application Insights Availability Monitoring", + "9fc6738d-7e26-44f0-b88e-6fae8ccb6b26", + "us-va-ash-azr_9fc6738d-7e26-44f0-b88e-6fae8ccb6b26", + null, + null, + "AutoGen_49c3aea0-4641-4675-93b5-55f7a62d22d3", + "PC", + null, + null, + "52.168.8.0", + "Boydton", + "Virginia", + "United States", + null, + "fabrikamfiberapp", + "RD00155D5053D1", + "cf58dcfd-0683-487c-bc84-048789bca8e5", + "fabrikamprod", + "5a2e4e0c-e136-4a15-9824-90ba859b0a89", + "web:2.5.0-33031", + "051ad4ef-0776-11e8-ac6e-e30599af6943", + "request", + "1" + ], + [ + "2018-02-01T17:33:15.786Z", + "|x/Ysh+M1TfU=.c32c265a_", + null, + "GET Home/Index", + "http://fabrikamfiberapp.azurewebsites.net/", + "True", + "200", + "716.2912", + "500ms-1sec", + "{\"_MS.ProcessedByMetricExtractors\":\"(Name:'Requests', Ver:'1.0')\"}", + null, + "GET Home/Index", + "x/Ysh+M1TfU=", + "x/Ysh+M1TfU=", + "Application Insights Availability Monitoring", + "58b15be6-d1e6-4d89-9919-52f63b840913", + "emea-se-sto-edge_58b15be6-d1e6-4d89-9919-52f63b840913", + null, + null, + "AutoGen_49c3aea0-4641-4675-93b5-55f7a62d22d3", + "PC", + null, + null, + "51.141.32.0", + "Cardiff", + "Cardiff", + "United Kingdom", + null, + "fabrikamfiberapp", + "RD00155D5053D1", + "cf58dcfd-0683-487c-bc84-048789bca8e5", + "fabrikamprod", + "5a2e4e0c-e136-4a15-9824-90ba859b0a89", + "web:2.5.0-33031", + "051ad4f0-0776-11e8-ac6e-e30599af6943", + "request", + "1" + ] + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/applicationinsights/data-plane/microsoft.insights/preview/2018-04-20/swagger.json b/specification/applicationinsights/data-plane/microsoft.insights/preview/2018-04-20/swagger.json index 724e5e9f8dec..408621d1bed9 100644 --- a/specification/applicationinsights/data-plane/microsoft.insights/preview/2018-04-20/swagger.json +++ b/specification/applicationinsights/data-plane/microsoft.insights/preview/2018-04-20/swagger.json @@ -85,6 +85,50 @@ } } } + }, + "get": { + "operationId": "Query_Get", + "summary": "Execute an Analytics query", + "description": "Executes an Analytics query for data", + "x-ms-examples": { + "queryGet": { + "$ref": "examples/query-get.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "$ref": "#/parameters/applicationName" + }, + { + "$ref": "#/parameters/queryParam" + }, + { + "$ref": "#/parameters/queryTimespan" + }, + { + "$ref": "#/parameters/apiVersion" + } + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "$ref": "#/definitions/queryResults" + } + }, + "default": { + "description": "An error response object.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + } } }, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/components/{applicationName}/metrics/{metricId}": { diff --git a/specification/applicationinsights/data-plane/microsoft.insights/preview/v1/AppInsights.json b/specification/applicationinsights/data-plane/microsoft.insights/preview/v1/AppInsights.json index caa9e3846e63..3b2110057914 100644 --- a/specification/applicationinsights/data-plane/microsoft.insights/preview/v1/AppInsights.json +++ b/specification/applicationinsights/data-plane/microsoft.insights/preview/v1/AppInsights.json @@ -338,6 +338,41 @@ } } } + }, + "get": { + "operationId": "Query_Get", + "summary": "Execute an Analytics query", + "description": "Executes an Analytics query for data", + "x-ms-examples": { + "queryGet": { + "$ref": "examples/query-get.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/appId" + }, + { + "$ref": "#/parameters/queryParam" + }, + { + "$ref": "#/parameters/queryTimespan" + } + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "$ref": "#/definitions/queryResults" + } + }, + "default": { + "description": "An error response object.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + } } } }, diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2017-10-01/swagger.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2017-10-01/swagger.json index 3732c773ad67..5fabe7c69f1b 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2017-10-01/swagger.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/preview/2017-10-01/swagger.json @@ -45,6 +45,53 @@ ], "paths": { "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/query": { + "get": { + "operationId": "Query_Get", + "summary": "Execute an Analytics query", + "description": "Executes an Analytics query for data", + "x-ms-examples": { + "simple-query": { + "$ref": "examples/oms-get-example.json" + }, + "cross-workspace": { + "$ref": "examples/oms-get-cross-workspace-example.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/resourceGroupName" + }, + { + "$ref": "#/parameters/workspaceName" + }, + { + "$ref": "#/parameters/queryParam" + }, + { + "$ref": "#/parameters/timespanParam" + }, + { + "$ref": "#/parameters/apiVersion" + } + ], + "responses": { + "200": { + "description": "OK. The API call succeeded and the Analytics query result is in the response payload", + "schema": { + "$ref": "#/definitions/queryResults" + } + }, + "default": { + "description": "An error response object.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + } + }, "post": { "operationId": "Query_Execute", "summary": "Execute an Analytics query", @@ -110,6 +157,15 @@ }, "x-ms-parameter-location": "method" }, + "timespanParam": { + "name": "timespan", + "in": "query", + "required": false, + "format": "duration", + "x-ms-parameter-location": "method", + "description": "Optional. The timespan over which to query data. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the query expression.", + "type": "string" + }, "apiVersion": { "name": "apiVersion", "description": "Client API version.", diff --git a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json index a78b272c061d..70f61cdd1be8 100644 --- a/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json +++ b/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/v1/OperationalInsights.json @@ -67,9 +67,6 @@ }, { "$ref": "#/parameters/timespanParam" - }, - { - "$ref": "#/parameters/workspacesParam" } ], "responses": { @@ -88,7 +85,7 @@ } }, "post": { - "operationId": "Query", + "operationId": "Query_Execute", "summary": "Execute an Analytics query", "description": "Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query.", "x-ms-examples": {