{ "swagger": "2.0", "info": { "title": "Azure Log Analytics Query Packs", "description": "Azure Log Analytics API reference for management of saved Queries within Query Packs.", "version": "2025-02-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries": { "get": { "description": "Gets a list of Queries defined within a Log Analytics QueryPack.", "operationId": "Queries_List", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/QueryPackNameParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/MaxItemCountParameter" }, { "$ref": "#/parameters/IncludeBodyParameter" }, { "$ref": "#/parameters/ContinuationTokenParameter" } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, "responses": { "200": { "description": "A list containing 0 or more queries contained within the Log Analytics QueryPack.", "schema": { "$ref": "#/definitions/LogAnalyticsQueryPackQueryListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "QueryList": { "$ref": "./examples/QueryPackQueriesList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/search": { "post": { "description": "Search a list of Queries defined within a Log Analytics QueryPack according to given search properties.", "operationId": "Queries_Search", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/QueryPackNameParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/MaxItemCountParameter" }, { "$ref": "#/parameters/IncludeBodyParameter" }, { "$ref": "#/parameters/ContinuationTokenParameter" }, { "name": "QuerySearchProperties", "description": "Properties by which to search queries in the given Log Analytics QueryPack.", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LogAnalyticsQueryPackQuerySearchProperties" } } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, "responses": { "200": { "description": "A list containing 0 or more queries contained within the Log Analytics QueryPack.", "schema": { "$ref": "#/definitions/LogAnalyticsQueryPackQueryListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "QuerySearch": { "$ref": "./examples/QueryPackQueriesSearch.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}": { "get": { "description": "Gets a specific Log Analytics Query defined within a Log Analytics QueryPack.", "operationId": "Queries_Get", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/QueryPackNameParameter" }, { "$ref": "#/parameters/QueryIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "A single query contained within the Log Analytics QueryPack.", "schema": { "$ref": "#/definitions/LogAnalyticsQueryPackQuery" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "QueryGet": { "$ref": "./examples/QueryPackQueriesGet.json" } } }, "put": { "description": "Adds or Updates a specific Query within a Log Analytics QueryPack.", "operationId": "Queries_Put", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/QueryPackNameParameter" }, { "$ref": "#/parameters/QueryIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "QueryPayload", "description": "Properties that need to be specified to create a new query and add it to a Log Analytics QueryPack.", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LogAnalyticsQueryPackQuery" } } ], "responses": { "200": { "description": "The new or updated query contained within the Log Analytics QueryPack.", "schema": { "$ref": "#/definitions/LogAnalyticsQueryPackQuery" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "QueryPut": { "$ref": "./examples/QueryPackQueriesPut.json" } } }, "patch": { "description": "Adds or Updates a specific Query within a Log Analytics QueryPack.", "operationId": "Queries_Update", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/QueryPackNameParameter" }, { "$ref": "#/parameters/QueryIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "QueryPayload", "description": "Properties that need to be specified to create a new query and add it to a Log Analytics QueryPack.", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LogAnalyticsQueryPackQuery" } } ], "responses": { "200": { "description": "The new or updated query contained within the Log Analytics QueryPack.", "schema": { "$ref": "#/definitions/LogAnalyticsQueryPackQuery" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "QueryPatch": { "$ref": "./examples/QueryPackQueriesUpdate.json" } } }, "delete": { "description": "Deletes a specific Query defined within an Log Analytics QueryPack.", "operationId": "Queries_Delete", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "#/parameters/QueryPackNameParameter" }, { "$ref": "#/parameters/QueryIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "The query has been successfully removed from the Log Analytics QueryPack" }, "204": { "description": "The specified query or associated QueryPack does not exist." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "../../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "QueryDelete": { "$ref": "./examples/QueryPackQueriesDelete.json" } } } } }, "definitions": { "LogAnalyticsQueryPackQuery": { "type": "object", "properties": { "properties": { "x-ms-client-flatten": true, "description": "Properties that define an Log Analytics QueryPack-Query resource.", "$ref": "#/definitions/LogAnalyticsQueryPackQueryProperties" } }, "allOf": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ], "description": "A Log Analytics QueryPack-Query definition.", "x-ms-azure-resource": true }, "LogAnalyticsQueryPackQueryProperties": { "type": "object", "description": "Properties that define an Log Analytics QueryPack-Query resource.", "x-ms-azure-resource": true, "properties": { "id": { "type": "string", "description": "The unique ID of your application. This field cannot be changed.", "readOnly": true }, "displayName": { "type": "string", "readOnly": false, "description": "Unique display name for your query within the Query Pack." }, "timeCreated": { "type": "string", "readOnly": true, "description": "Creation Date for the Log Analytics Query, in ISO 8601 format.", "format": "date-time" }, "timeModified": { "type": "string", "readOnly": true, "description": "Last modified date of the Log Analytics Query, in ISO 8601 format.", "format": "date-time" }, "author": { "type": "string", "readOnly": true, "description": "Object Id of user creating the query." }, "description": { "type": "string", "readOnly": false, "description": "Description of the query." }, "body": { "type": "string", "readOnly": false, "description": "Body of the query." }, "related": { "description": "The related metadata items for the function.", "type": "object", "properties": { "categories": { "description": "The related categories for the function.", "type": "array", "items": { "type": "string" } }, "resourceTypes": { "description": "The related resource types for the function.", "type": "array", "items": { "type": "string" } }, "solutions": { "description": "The related Log Analytics solutions for the function.", "type": "array", "items": { "type": "string" } } } }, "tags": { "description": "Tags associated with the query.", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "properties": { "type": "object", "description": "Additional properties that can be set for the query." } }, "required": [ "body", "displayName" ] }, "LogAnalyticsQueryPackQuerySearchProperties": { "type": "object", "description": "Properties that define an Log Analytics QueryPack-Query search properties.", "properties": { "related": { "type": "object", "description": "The related metadata items for the function.", "properties": { "categories": { "description": "The related categories for the function.", "type": "array", "items": { "type": "string" } }, "resourceTypes": { "description": "The related resource types for the function.", "type": "array", "items": { "type": "string" } }, "solutions": { "description": "The related Log Analytics solutions for the function.", "type": "array", "items": { "type": "string" } } } }, "tags": { "description": "Tags associated with the query.", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } }, "LogAnalyticsQueryPackQueryListResult": { "type": "object", "description": "Describes the list of Log Analytics QueryPack-Query resources.", "required": [ "value" ], "properties": { "value": { "type": "array", "description": "List of Log Analytics QueryPack Query definitions.", "items": { "$ref": "#/definitions/LogAnalyticsQueryPackQuery" } }, "nextLink": { "type": "string", "description": "The URI to get the next set of Log Analytics QueryPack definitions if too many QueryPack-Queries where returned in the result set." } } } }, "parameters": { "QueryPackNameParameter": { "name": "queryPackName", "in": "path", "required": true, "type": "string", "description": "The name of the Log Analytics QueryPack resource.", "x-ms-parameter-location": "method" }, "QueryIdParameter": { "name": "id", "in": "path", "required": true, "type": "string", "description": "The id of a specific query defined in the Log Analytics QueryPack", "x-ms-parameter-location": "method" }, "IncludeBodyParameter": { "name": "includeBody", "in": "query", "required": false, "type": "boolean", "description": "Flag indicating whether or not to return the body of each applicable query. If false, only return the query information.", "x-ms-parameter-location": "method" }, "MaxItemCountParameter": { "name": "$top", "in": "query", "required": false, "type": "integer", "format": "int64", "description": "Maximum items returned in page.", "x-ms-parameter-location": "method" }, "ContinuationTokenParameter": { "name": "$skipToken", "in": "query", "required": false, "type": "string", "description": "Base64 encoded token used to fetch the next page of items. Default is null.", "x-ms-parameter-location": "method" } } }