Azure Resource Graph icon

Azure Resource Graph

Azure Resource Graph API Reference

COMMUNITYBEARER0 INSTALLS
OpenAPI Specificationv3.0
{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "management.azure.com",
  "info": {
    "description": "Azure Resource Graph API Reference",
    "title": "Azure Resource Graph",
    "version": "2019-04-01",
    "x-apisguru-categories": [
      "cloud"
    ],
    "x-logo": {
      "url": "https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png"
    },
    "x-origin": [
      {
        "format": "swagger",
        "url": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2019-04-01/resourcegraph.json",
        "version": "2.0"
      }
    ],
    "x-preferred": true,
    "x-providerName": "azure.com",
    "x-serviceName": "resourcegraph",
    "x-tags": [
      "Azure",
      "Microsoft"
    ]
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "azure_auth": {
      "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
      "description": "Azure Active Directory OAuth2 Flow",
      "flow": "implicit",
      "scopes": {
        "user_impersonation": "impersonate your user account"
      },
      "type": "oauth2"
    }
  },
  "security": [
    {
      "azure_auth": [
        "user_impersonation"
      ]
    }
  ],
  "parameters": {
    "ApiVersionParameter": {
      "description": "API version.",
      "in": "query",
      "name": "api-version",
      "required": true,
      "type": "string"
    }
  },
  "paths": {
    "/providers/Microsoft.ResourceGraph/operations": {
      "get": {
        "description": "Lists all of the available REST API operations.",
        "operationId": "Operations_List",
        "parameters": [
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "OK. The request has succeeded.",
            "schema": {
              "$ref": "#/definitions/OperationListResult"
            }
          }
        },
        "tags": [
          "Operations"
        ],
        "x-ms-examples": {
          "OperationsList": {
            "parameters": {
              "api-version": "2019-04-01"
            },
            "responses": {
              "200": {
                "body": {
                  "value": [
                    {
                      "display": {
                        "description": "Gets the list of supported operations",
                        "operation": "Get Operations",
                        "provider": "Microsoft Resource Graph",
                        "resource": "Operation"
                      },
                      "name": "Microsoft.ResourceGraph/operations/read"
                    },
                    {
                      "display": {
                        "description": "Submits a query on resources within specified subscriptions",
                        "operation": "Query resources",
                        "provider": "Microsoft Resource Graph",
                        "resource": "Resources"
                      },
                      "name": "Microsoft.ResourceGraph/resources/read"
                    }
                  ]
                }
              }
            }
          }
        },
        "x-ms-pageable": {
          "nextLinkName": null
        }
      }
    },
    "/providers/Microsoft.ResourceGraph/resources": {
      "post": {
        "description": "Queries the resources managed by Azure Resource Manager for all subscriptions specified in the request.",
        "externalDocs": {
          "description": "Learn more about the query syntax here",
          "url": "https://aka.ms/resource-graph/learntoquery"
        },
        "operationId": "Resources",
        "parameters": [
          {
            "$ref": "#/parameters/ApiVersionParameter"
          },
          {
            "description": "Request specifying query and its options.",
            "in": "body",
            "name": "query",
            "required": true,
            "schema": {
              "$ref": "#/definitions/QueryRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Result of the query operation",
            "schema": {
              "$ref": "#/definitions/QueryResponse"
            }
          },
          "default": {
            "description": "An error occurred while processing the request. See the error.code parameter to identify the specific error.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "Resources"
        ],
        "x-ms-examples": {
          "Access a properties field": {
            "description": "A query accessing one of the resource properties.",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "query": "where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by tostring(properties.storageProfile.osDisk.osType)",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "count": 2,
                  "data": {
                    "columns": [
                      {
                        "name": "properties_storageProfile_osDisk_osType",
                        "type": "string"
                      },
                      {
                        "name": "count_",
                        "type": "integer"
                      }
                    ],
                    "rows": [
                      [
                        "Linux",
                        7
                      ],
                      [
                        "Windows",
                        23
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 2
                }
              }
            },
            "title": "Properties Query"
          },
          "Access a properties field through alias": {
            "description": "A query accessing one of the resource properties through [alias](https://docs.microsoft.com/en-us/azure/azure-policy/policy-definition#aliases).",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "query": "where type =~ 'Microsoft.Web/serverFarms' | extend skuName = tostring(aliases['Microsoft.Web/serverfarms/sku.name']) | summarize count() by skuName",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "count": 3,
                  "data": {
                    "columns": [
                      {
                        "name": "skuName",
                        "type": "string"
                      },
                      {
                        "name": "count_",
                        "type": "integer"
                      }
                    ],
                    "rows": [
                      [
                        "S2",
                        1
                      ],
                      [
                        "Y1",
                        3
                      ],
                      [
                        "S1",
                        1
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 3
                }
              }
            },
            "title": "Alias Query"
          },
          "Basic query": {
            "description": "A simple resources query.",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "query": "project id, name, type, location, tags | limit 3",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "count": 3,
                  "data": {
                    "columns": [
                      {
                        "name": "id",
                        "type": "string"
                      },
                      {
                        "name": "name",
                        "type": "string"
                      },
                      {
                        "name": "type",
                        "type": "string"
                      },
                      {
                        "name": "location",
                        "type": "string"
                      },
                      {
                        "name": "tags",
                        "type": "object"
                      }
                    ],
                    "rows": [
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Network/networkInterfaces/myNetworkInterface",
                        "myNetworkInterface",
                        "microsoft.network/networkinterfaces",
                        "centralus",
                        {
                          "tag1": "Value1"
                        }
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Network/virtualNetworks/myVnet",
                        "myVnet",
                        "microsoft.network/virtualnetworks",
                        "westus",
                        {}
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Network/publicIPAddresses/myPublicIp",
                        "myPublicIp",
                        "microsoft.network/publicipaddresses",
                        "westus",
                        {}
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 3
                }
              }
            },
            "title": "Basic Query"
          },
          "Complex query": {
            "description": "A complex query on resources featuring multiple operations.",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "query": "project id, name, type, location | where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by location | top 3 by count_",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "count": 3,
                  "data": {
                    "columns": [
                      {
                        "name": "location",
                        "type": "string"
                      },
                      {
                        "name": "count_",
                        "type": "integer"
                      }
                    ],
                    "rows": [
                      [
                        "centralus",
                        11
                      ],
                      [
                        "eastus",
                        11
                      ],
                      [
                        "southcentralus",
                        3
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 3
                }
              }
            },
            "title": "Complex Query"
          },
          "Filter resources": {
            "description": "A filtering query on resources.",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "query": "project id, name, type, location | where type =~ 'Microsoft.Compute/virtualMachines' | limit 3",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "count": 3,
                  "data": {
                    "columns": [
                      {
                        "name": "id",
                        "type": "string"
                      },
                      {
                        "name": "name",
                        "type": "string"
                      },
                      {
                        "name": "type",
                        "type": "string"
                      },
                      {
                        "name": "location",
                        "type": "string"
                      }
                    ],
                    "rows": [
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/virtualMachines/myVm1",
                        "myVm1",
                        "microsoft.compute/virtualmachines",
                        "centralus"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Compute/virtualMachines/myVirtualMachine",
                        "myVirtualMachine",
                        "microsoft.compute/virtualmachines",
                        "eastus"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG3/providers/Microsoft.Compute/virtualMachines/testVm",
                        "testVm",
                        "microsoft.compute/virtualmachines",
                        "eastus"
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 3
                }
              }
            },
            "title": "Filter query"
          },
          "First page query": {
            "description": "A query requesting a first page with of results. Please note id field is required in the response to return the pages in stable sorted fashion.",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "options": {
                  "$skip": 0,
                  "$top": 3
                },
                "query": "where name contains 'test' | project id, name, type, location",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "$skipToken": "eyAibm8iOiAibHVjayIsICJidXQiOiAibmljZSIsICJ0cnkiOiAiISIgfQ==",
                  "count": 3,
                  "data": {
                    "columns": [
                      {
                        "name": "id",
                        "type": "string"
                      },
                      {
                        "name": "name",
                        "type": "string"
                      },
                      {
                        "name": "type",
                        "type": "string"
                      },
                      {
                        "name": "location",
                        "type": "string"
                      }
                    ],
                    "rows": [
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/disks/yetanothertest_OsDisk_1_f396cbcb625a457bb69fe2abf5975820",
                        "yetanothertest_OsDisk_1_f396cbcb625a457bb69fe2abf5975820",
                        "microsoft.compute/disks",
                        "eastus"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/TestAA",
                        "TestAA",
                        "microsoft.automation/automationaccounts",
                        "westcentralus"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/TestAA/runbooks/TestRB",
                        "TestRB",
                        "microsoft.automation/automationaccounts/runbooks",
                        "westcentralus"
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 386
                }
              }
            },
            "title": "First page query"
          },
          "Next page query": {
            "description": "A query on resources requesting the next page using skip token. Please note id field is required in the response to return the pages in stable sorted fashion.",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "options": {
                  "$skipToken": "eyAibm8iOiAibHVjayIsICJidXQiOiAibmljZSIsICJ0cnkiOiAiISIgfQ=="
                },
                "query": "where name contains 'test' | project id, name, type, location",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "$skipToken": "eyAibm8yIjogImx1Y2syIiwgImJ1dDIiOiAibmljZTIiLCAidHJ5MiI6ICIhIiB9",
                  "count": 3,
                  "data": {
                    "columns": [
                      {
                        "name": "id",
                        "type": "string"
                      },
                      {
                        "name": "name",
                        "type": "string"
                      },
                      {
                        "name": "type",
                        "type": "string"
                      },
                      {
                        "name": "location",
                        "type": "string"
                      }
                    ],
                    "rows": [
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/disks/second_OsDisk_dddddbcb625a457bb69fe2abf5975820",
                        "second_OsDisk_dddddbcb625a457bb69fe2abf5975820",
                        "microsoft.compute/disks",
                        "eastus"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/AATest",
                        "AATest",
                        "microsoft.automation/automationaccounts",
                        "westcentralus"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/TestAA/runbooks/RBTest",
                        "RBTest",
                        "microsoft.automation/automationaccounts/runbooks",
                        "westcentralus"
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 386
                }
              }
            },
            "title": "Next page query"
          },
          "Query options": {
            "description": "A query on resources specifying paging and max rows through query options",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "options": {
                  "$skip": 10,
                  "$top": 3
                },
                "query": "where name contains 'test' | project id, name, type, location",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "$skipToken": "eyAibm8yIjogImx1Y2syIiwgImJ1dDIiOiAibmljZTIiLCAidHJ5MiI6ICIhIiB9",
                  "count": 3,
                  "data": {
                    "columns": [
                      {
                        "name": "id",
                        "type": "string"
                      },
                      {
                        "name": "name",
                        "type": "string"
                      },
                      {
                        "name": "type",
                        "type": "string"
                      },
                      {
                        "name": "location",
                        "type": "string"
                      }
                    ],
                    "rows": [
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG4/providers/Microsoft.Compute/disks/yetanothertest_OsDisk_1_f396cbcb625a457bb69fe2abf5975820",
                        "yetanothertest_OsDisk_1_f396cbcb625a457bb69fe2abf5975820",
                        "microsoft.compute/disks",
                        "eastus"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG5/providers/Microsoft.Automation/automationAccounts/TestAA",
                        "TestAA",
                        "microsoft.automation/automationaccounts",
                        "westcentralus"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG5/providers/Microsoft.Automation/automationAccounts/TestAA/runbooks/TestRB",
                        "TestRB",
                        "microsoft.automation/automationaccounts/runbooks",
                        "westcentralus"
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 386
                }
              }
            },
            "title": "Query options"
          },
          "Query with a facet request": {
            "description": "A query on resources requesting extra facets.",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "facets": [
                  {
                    "expression": "location",
                    "options": {
                      "$top": 3,
                      "sortOrder": "desc"
                    }
                  },
                  {
                    "expression": "properties.storageProfile.osDisk.osType",
                    "options": {
                      "$top": 3,
                      "sortOrder": "desc"
                    }
                  },
                  {
                    "expression": "nonExistingColumn",
                    "options": {
                      "$top": 3,
                      "sortOrder": "desc"
                    }
                  },
                  {
                    "expression": "resourceGroup",
                    "options": {
                      "$top": 3,
                      "sortBy": "tolower(resourceGroup)",
                      "sortOrder": "asc"
                    }
                  },
                  {
                    "expression": "resourceGroup",
                    "options": {
                      "$top": 3,
                      "filter": "resourceGroup contains 'test'"
                    }
                  }
                ],
                "query": "where type =~ 'Microsoft.Compute/virtualMachines' | project id, name, location, resourceGroup, properties.storageProfile.osDisk.osType | limit 5",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "count": 5,
                  "data": {
                    "columns": [
                      {
                        "name": "id",
                        "type": "string"
                      },
                      {
                        "name": "name",
                        "type": "string"
                      },
                      {
                        "name": "location",
                        "type": "string"
                      },
                      {
                        "name": "resourceGroup",
                        "type": "string"
                      },
                      {
                        "name": "properties_storageProfile_osDisk_osType",
                        "type": "object"
                      }
                    ],
                    "rows": [
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/B-TEST-RG/providers/Microsoft.Compute/virtualMachines/myTestVm",
                        "myTestVm",
                        "eastus",
                        "B-TEST-RG",
                        "Windows"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/c-rg/providers/Microsoft.Compute/virtualMachines/myTestAccountVm",
                        "myTestAccountVm",
                        "westcentralus",
                        "c-rg",
                        "Windows"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/I-RG/providers/Microsoft.Compute/virtualMachines/yetanothertest",
                        "yetanothertest",
                        "eastus",
                        "I-RG",
                        "Linux"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/x-test-rg/providers/Microsoft.Compute/virtualMachines/drafttest1bux4cv7a7q3aw",
                        "drafttest1bux4cv7a7q3aw",
                        "southcentralus",
                        "x-test-rg",
                        "Linux"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/y-rg/providers/Microsoft.Compute/virtualMachines/testvmntp25370",
                        "testvmntp25370",
                        "eastus",
                        "y-rg",
                        "Windows"
                      ]
                    ]
                  },
                  "facets": [
                    {
                      "count": 3,
                      "data": {
                        "columns": [
                          {
                            "name": "location",
                            "type": "string"
                          },
                          {
                            "name": "count",
                            "type": "integer"
                          }
                        ],
                        "rows": [
                          [
                            "eastus",
                            3
                          ],
                          [
                            "southcentralus",
                            1
                          ],
                          [
                            "westcentralus",
                            1
                          ]
                        ]
                      },
                      "expression": "location",
                      "resultType": "FacetResult",
                      "totalRecords": 3
                    },
                    {
                      "count": 2,
                      "data": {
                        "columns": [
                          {
                            "name": "properties_storageProfile_osDisk_osType",
                            "type": "string"
                          },
                          {
                            "name": "count",
                            "type": "integer"
                          }
                        ],
                        "rows": [
                          [
                            "Linux",
                            2
                          ],
                          [
                            "Windows",
                            3
                          ]
                        ]
                      },
                      "expression": "properties.storageProfile.osDisk.osType",
                      "resultType": "FacetResult",
                      "totalRecords": 2
                    },
                    {
                      "errors": [
                        {
                          "code": "NoValidColumns",
                          "message": "No valid columns in facet expression."
                        },
                        {
                          "code": "InvalidColumnNames",
                          "message": "Invalid column names: [nonExistingColumn]."
                        }
                      ],
                      "expression": "nonExistingColumn",
                      "resultType": "FacetError"
                    },
                    {
                      "count": 3,
                      "data": {
                        "columns": [
                          {
                            "name": "resourceGroup",
                            "type": "string"
                          },
                          {
                            "name": "count",
                            "type": "integer"
                          }
                        ],
                        "rows": [
                          [
                            "B-TEST-RG",
                            1
                          ],
                          [
                            "c-rg",
                            1
                          ],
                          [
                            "I-RG",
                            1
                          ]
                        ]
                      },
                      "expression": "resourceGroup",
                      "resultType": "FacetResult",
                      "totalRecords": 5
                    },
                    {
                      "count": 2,
                      "data": {
                        "columns": [
                          {
                            "name": "resourceGroup",
                            "type": "string"
                          },
                          {
                            "name": "count",
                            "type": "integer"
                          }
                        ],
                        "rows": [
                          [
                            "B-TEST-RG",
                            1
                          ],
                          [
                            "x-test-rg",
                            1
                          ]
                        ]
                      },
                      "expression": "resourceGroup",
                      "resultType": "FacetResult",
                      "totalRecords": 2
                    }
                  ],
                  "resultTruncated": "false",
                  "totalRecords": 5
                }
              }
            },
            "title": "Facet Query"
          },
          "Random page query": {
            "description": "A query on resources requesting the random page using skip token, top and skip overrides",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "options": {
                  "$skip": 10,
                  "$skipToken": "eyAibm8iOiAibHVjayIsICJidXQiOiAibmljZSIsICJ0cnkiOiAiISIgfQ==",
                  "$top": 2
                },
                "query": "where name contains 'test' | project id, name, type, location",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "$skipToken": "eyAibm8yIjogImx1Y2syIiwgImJ1dDIiOiAibmljZTIiLCAidHJ5MiI6ICIhIiB9",
                  "count": 2,
                  "data": {
                    "columns": [
                      {
                        "name": "id",
                        "type": "string"
                      },
                      {
                        "name": "name",
                        "type": "string"
                      },
                      {
                        "name": "type",
                        "type": "string"
                      },
                      {
                        "name": "location",
                        "type": "string"
                      }
                    ],
                    "rows": [
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/disks/third_OsDisk_dddddbcb625a457bb69fe2abf5975820",
                        "third_OsDisk_dddddbcb625a457bb69fe2abf5975820",
                        "microsoft.compute/disks",
                        "eastus"
                      ],
                      [
                        "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/CCTest",
                        "CCTest",
                        "microsoft.automation/automationaccounts",
                        "westcentralus"
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 386
                }
              }
            },
            "title": "Random page query"
          },
          "Summarize resources by location": {
            "description": "A summarizing query on resources.",
            "parameters": {
              "api-version": "2019-04-01",
              "query": {
                "query": "project id, name, type, location | summarize by location",
                "subscriptions": [
                  "cfbbd179-59d2-4052-aa06-9270a38aa9d6"
                ]
              }
            },
            "responses": {
              "200": {
                "body": {
                  "count": 3,
                  "data": {
                    "columns": [
                      {
                        "name": "location",
                        "type": "string"
                      }
                    ],
                    "rows": [
                      [
                        "centralus"
                      ],
                      [
                        "eastus"
                      ],
                      [
                        "westus"
                      ]
                    ]
                  },
                  "resultTruncated": "false",
                  "totalRecords": 3
                }
              }
            },
            "title": "Summarize Query"
          }
        }
      }
    }
  },
  "definitions": {
    "Column": {
      "description": "Query result column descriptor.",
      "properties": {
        "name": {
          "description": "Column name.",
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/ColumnDataType",
          "description": "Column data type."
        }
      },
      "required": [
        "name",
        "type"
      ],
      "type": "object"
    },
    "ColumnDataType": {
      "description": "Data type of a column in a table.",
      "enum": [
        "string",
        "integer",
        "number",
        "boolean",
        "object"
      ],
      "type": "string",
      "x-ms-enum": {
        "modelAsString": false,
        "name": "ColumnDataType"
      }
    },
    "Error": {
      "description": "Error details.",
      "properties": {
        "code": {
          "description": "Error code identifying the specific error.",
          "type": "string"
        },
        "details": {
          "description": "Error details",
          "items": {
            "$ref": "#/definitions/ErrorDetails"
          },
          "type": "array"
        },
        "message": {
          "description": "A human readable error message.",
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "title": "Error info.",
      "type": "object"
    },
    "ErrorDetails": {
      "additionalProperties": {
        "type": "object"
      },
      "properties": {
        "code": {
          "description": "Error code identifying the specific error.",
          "type": "string"
        },
        "message": {
          "description": "A human readable error message.",
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "title": "Error details.",
      "type": "object"
    },
    "ErrorResponse": {
      "description": "An error response from the API.",
      "properties": {
        "error": {
          "$ref": "#/definitions/Error",
          "description": "Error information."
        }
      },
      "required": [
        "error"
      ],
      "title": "Error response.",
      "type": "object"
    },
    "Facet": {
      "description": "A facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError.",
      "discriminator": "resultType",
      "properties": {
        "expression": {
          "description": "Facet expression, same as in the corresponding facet request.",
          "type": "string"
        },
        "resultType": {
          "description": "Result type",
          "type": "string"
        }
      },
      "required": [
        "expression",
        "resultType"
      ],
      "type": "object"
    },
    "FacetError": {
      "allOf": [
        {
          "$ref": "#/definitions/Facet"
        }
      ],
      "description": "A facet whose execution resulted in an error.",
      "properties": {
        "errors": {
          "description": "An array containing detected facet errors with details.",
          "items": {
            "$ref": "#/definitions/ErrorDetails"
          },
          "type": "array"
        }
      },
      "required": [
        "errors"
      ],
      "type": "object",
      "x-ms-discriminator-value": "FacetError"
    },
    "FacetRequest": {
      "description": "A request to compute additional statistics (facets) over the query results.",
      "properties": {
        "expression": {
          "description": "The column or list of columns to summarize by",
          "type": "string"
        },
        "options": {
          "$ref": "#/definitions/FacetRequestOptions",
          "description": "The options for facet evaluation"
        }
      },
      "required": [
        "expression"
      ],
      "type": "object"
    },
    "FacetRequestOptions": {
      "description": "The options for facet evaluation",
      "properties": {
        "$top": {
          "description": "The maximum number of facet rows that should be returned.",
          "format": "int32",
          "maximum": 1000,
          "minimum": 1,
          "type": "integer"
        },
        "filter": {
          "description": "Specifies the filter condition for the 'where' clause which will be run on main query's result, just before the actual faceting.",
          "type": "string"
        },
        "sortBy": {
          "description": "The column name or query expression to sort on. Defaults to count if not present.",
          "type": "string"
        },
        "sortOrder": {
          "default": "desc",
          "description": "The sorting order by the selected column (count by default).",
          "enum": [
            "asc",
            "desc"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": false,
            "name": "FacetSortOrder"
          }
        }
      }
    },
    "FacetResult": {
      "allOf": [
        {
          "$ref": "#/definitions/Facet"
        }
      ],
      "description": "Successfully executed facet containing additional statistics on the response of a query.",
      "properties": {
        "count": {
          "description": "Number of records returned in the facet response.",
          "format": "int32",
          "type": "integer"
        },
        "data": {
          "description": "A table containing the desired facets. Only present if the facet is valid."
        },
        "totalRecords": {
          "description": "Number of total records in the facet results.",
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "totalRecords",
        "count",
        "data"
      ],
      "type": "object",
      "x-ms-discriminator-value": "FacetResult"
    },
    "Operation": {
      "description": "Resource Graph REST API operation definition.",
      "properties": {
        "display": {
          "description": "Display metadata associated with the operation.",
          "properties": {
            "description": {
              "description": "Description for the operation.",
              "type": "string"
            },
            "operation": {
              "description": "Type of operation: get, read, delete, etc.",
              "type": "string"
            },
            "provider": {
              "description": "Service provider: Microsoft Resource Graph.",
              "type": "string"
            },
            "resource": {
              "description": "Resource on which the operation is performed etc.",
              "type": "string"
            }
          }
        },
        "name": {
          "description": "Operation name: {provider}/{resource}/{operation}",
          "type": "string"
        },
        "origin": {
          "description": "The origin of operations.",
          "type": "string"
        }
      }
    },
    "OperationListResult": {
      "description": "Result of the request to list Resource Graph operations. It contains a list of operations and a URL link to get the next set of results.",
      "properties": {
        "value": {
          "description": "List of Resource Graph operations supported by the Resource Graph resource provider.",
          "items": {
            "$ref": "#/definitions/Operation"
          },
          "type": "array"
        }
      }
    },
    "QueryRequest": {
      "description": "Describes a query to be executed.",
      "properties": {
        "facets": {
          "description": "An array of facet requests to be computed against the query result.",
          "items": {
            "$ref": "#/definitions/FacetRequest"
          },
          "type": "array"
        },
        "options": {
          "$ref": "#/definitions/QueryRequestOptions",
          "description": "The query evaluation options"
        },
        "query": {
          "description": "The resources query.",
          "type": "string"
        },
        "subscriptions": {
          "description": "Azure subscriptions against which to execute the query.",
          "items": {
            "description": "Subscription Id.",
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "subscriptions",
        "query"
      ],
      "type": "object"
    },
    "QueryRequestOptions": {
      "description": "The options for query evaluation",
      "properties": {
        "$skip": {
          "description": "The number of rows to skip from the beginning of the results. Overrides the next page offset when ```$skipToken``` property is present.",
          "format": "int32",
          "minimum": 0,
          "type": "integer"
        },
        "$skipToken": {
          "description": "Continuation token for pagination, capturing the next page size and offset, as well as the context of the query.",
          "type": "string"
        },
        "$top": {
          "description": "The maximum number of rows that the query should return. Overrides the page size when ```$skipToken``` property is present.",
          "format": "int32",
          "maximum": 1000,
          "minimum": 1,
          "type": "integer"
        },
        "resultFormat": {
          "description": "Defines in which format query result returned.",
          "enum": [
            "table",
            "objectArray"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": false,
            "name": "ResultFormat"
          }
        }
      }
    },
    "QueryResponse": {
      "description": "Query result.",
      "properties": {
        "$skipToken": {
          "description": "When present, the value can be passed to a subsequent query call (together with the same query and subscriptions used in the current request) to retrieve the next page of data.",
          "type": "string"
        },
        "count": {
          "description": "Number of records returned in the current response. In the case of paging, this is the number of records in the current page.",
          "format": "int64",
          "type": "integer"
        },
        "data": {
          "description": "Query output in tabular format."
        },
        "facets": {
          "description": "Query facets.",
          "items": {
            "$ref": "#/definitions/Facet"
          },
          "type": "array"
        },
        "resultTruncated": {
          "description": "Indicates whether the query results are truncated.",
          "enum": [
            "true",
            "false"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": false,
            "name": "ResultTruncated"
          }
        },
        "totalRecords": {
          "description": "Number of total records matching the query.",
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "totalRecords",
        "count",
        "resultTruncated",
        "data"
      ],
      "type": "object"
    },
    "Row": {
      "description": "Query result row.",
      "items": {
        "description": "Cell value.",
        "type": "object"
      },
      "type": "array"
    },
    "Table": {
      "description": "Query output in tabular format.",
      "properties": {
        "columns": {
          "description": "Query result column descriptors.",
          "items": {
            "$ref": "#/definitions/Column",
            "description": "Column descriptor."
          },
          "type": "array"
        },
        "rows": {
          "description": "Query result rows.",
          "items": {
            "$ref": "#/definitions/Row",
            "description": "Query result row."
          },
          "type": "array"
        }
      },
      "required": [
        "columns",
        "rows"
      ],
      "type": "object"
    }
  }
}