openapi: 3.2.0 info: title: Microsoft Azure Azure Resource Graph Query API description: Azure Resource Graph Query API Reference version: 2020-04-01-preview servers: - url: https://management.azure.com security: - azure_auth: - user_impersonation tags: - name: Graph Query paths: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries: get: tags: - Graph Query description: Get all graph queries defined within a specified subscription and resource group. operationId: microsoftAzureGraphqueryList parameters: - $ref: '#/components/parameters/SubscriptionIdParameter' - $ref: '#/components/parameters/ResourceGroupNameParameter' - $ref: '#/components/parameters/ApiVersionParameter' responses: '200': description: A list containing 0 or more graph queries. content: application/json: schema: $ref: '#/components/schemas/GraphQueryListResult' default: description: Error response describing why the operation failed. content: application/json: schema: $ref: '#/components/schemas/GraphQueryError' x-ms-pageable: nextLinkName: nextLink x-ms-examples: Get a list of Graph Queries: $ref: ./examples/GraphQueryList.json summary: Microsoft Azure Get Subscriptions Subscriptionid Resourcegroups… ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceGraph/queries/{resourceName} : get: tags: - Graph Query description: Get a single graph query by its resourceName. operationId: microsoftAzureGraphqueryGet parameters: - $ref: '#/components/parameters/SubscriptionIdParameter' - $ref: '#/components/parameters/ResourceGroupNameParameter' - $ref: '#/components/parameters/GraphQueryResourceNameParameter' - $ref: '#/components/parameters/ApiVersionParameter' responses: '200': description: A graph query definition. content: application/json: schema: $ref: '#/components/schemas/GraphQueryResource' default: description: Error response describing why the operation failed. content: application/json: schema: $ref: '#/components/schemas/GraphQueryError' x-ms-examples: Get Graph Query: $ref: ./examples/GraphQueryGet.json summary: Microsoft Azure Get Subscriptions Subscriptionid Resourcegroups… delete: tags: - Graph Query description: Delete a graph query. operationId: microsoftAzureGraphqueryDelete parameters: - $ref: '#/components/parameters/SubscriptionIdParameter' - $ref: '#/components/parameters/ResourceGroupNameParameter' - $ref: '#/components/parameters/GraphQueryResourceNameParameter' - $ref: '#/components/parameters/ApiVersionParameter' responses: '200': description: The graph query has been successfully deleted. '204': description: The resource doesn't exist. default: description: Error response describing why the operation failed. content: application/json: schema: $ref: '#/components/schemas/GraphQueryError' x-ms-examples: Delete Graph Query: $ref: ./examples/GraphQueryDelete.json summary: Microsoft Azure Delete Subscriptions Subscriptionid Resourcegroups… put: tags: - Graph Query description: Create a new graph query. operationId: microsoftAzureGraphqueryCreateorupdate parameters: - $ref: '#/components/parameters/SubscriptionIdParameter' - $ref: '#/components/parameters/ResourceGroupNameParameter' - $ref: '#/components/parameters/GraphQueryResourceNameParameter' - $ref: '#/components/parameters/ApiVersionParameter' responses: '200': description: The newly created graph query. content: application/json: schema: $ref: '#/components/schemas/GraphQueryResource' default: description: Error response describing why the operation failed. content: application/json: schema: $ref: '#/components/schemas/GraphQueryError' x-ms-examples: Create Graph Query: $ref: ./examples/GraphQueryAdd.json summary: Microsoft Azure Put Subscriptions Subscriptionid Resourcegroups… requestBody: content: application/json: schema: $ref: '#/components/schemas/GraphQueryResource' description: Properties that need to be specified to create a new graph query. required: true components: parameters: ApiVersionParameter: name: api-version in: query required: true description: Client Api Version. schema: type: string ResourceGroupNameParameter: name: resourceGroupName in: path required: true description: The name of the resource group. x-ms-parameter-location: method schema: type: string GraphQueryResourceNameParameter: name: resourceName in: path required: true description: The name of the Graph Query resource. x-ms-parameter-location: method schema: type: string SubscriptionIdParameter: name: subscriptionId in: path required: true description: The Azure subscription Id. schema: type: string schemas: GraphQueryProperties: description: Properties that contain a graph query. required: - query properties: timeModified: type: string description: Date and time in UTC of the last modification that was made to this graph query definition. format: date-time readOnly: true description: type: string description: The description of a graph query. query: type: string description: KQL query that will be graph. resultKind: description: Enum indicating a type of graph query. readOnly: true type: string enum: - basic x-ms-enum: name: ResultKind modelAsString: true Resource: properties: id: type: string readOnly: true description: Azure resource Id name: type: string readOnly: true description: Azure resource name. This is GUID value. The display name should be assigned within properties field. location: type: string readOnly: true description: The location of the resource type: type: string readOnly: true description: Azure resource type x-ms-azure-resource: true description: An azure resource object GraphQueryResource: description: Graph Query entity definition. allOf: - $ref: '#/components/schemas/Resource' properties: properties: x-ms-client-flatten: true description: Metadata describing a graph query for an Azure resource. $ref: '#/components/schemas/GraphQueryProperties' tags: type: object additionalProperties: type: string description: Resource tags systemData: readOnly: true $ref: ../../../../../common-types/resource-management/v1/types.json#/definitions/systemData etag: type: string description: This will be used to handle Optimistic Concurrency. GraphQueryListResult: properties: nextLink: description: URL to fetch the next set of queries. type: string value: type: array readOnly: true items: $ref: '#/components/schemas/GraphQueryResource' description: An array of graph queries. description: Graph query list result. GraphQueryError: properties: code: type: string description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. message: type: string description: Human-readable representation of the error. details: type: array items: $ref: '#/components/schemas/ErrorFieldContract' description: The list of invalid fields send in request, in case of validation error. description: Error message body that will indicate why the operation failed. ErrorFieldContract: properties: code: type: string description: Property level error code. message: type: string description: Human-readable representation of property-level error. target: type: string description: Property name. description: Error Field contract. securitySchemes: azure_auth: type: oauth2 flows: implicit: scopes: user_impersonation: impersonate your user account authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize description: Azure Active Directory OAuth2 Flow.