-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Microsoft.ResourceGraph public preview spec (#3716)
- Loading branch information
1 parent
21d580e
commit b85c2ca
Showing
14 changed files
with
1,343 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...e-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/OperationsList.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2018-09-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"value": [ | ||
{ | ||
"name": "Microsoft.ResourceGraph/resources/action", | ||
"display": { | ||
"provider": "Microsoft Resource Graph", | ||
"resource": "Resources", | ||
"operation": "Query resources", | ||
"description": "Submits a query on resources within specified subscriptions" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...ager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourcesAliasQuery.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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"title": "Alias Query", | ||
"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": "2018-09-01-preview", | ||
"query": { | ||
"subscriptions": [ | ||
"cfbbd179-59d2-4052-aa06-9270a38aa9d6" | ||
], | ||
"query": "where type =~ 'Microsoft.Web/serverFarms' | extend skuName = tostring(aliases['Microsoft.Web/serverfarms/sku.name']) | summarize count() by skuName" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"totalRecords": 3, | ||
"count": 3, | ||
"resultTruncated": "false", | ||
"data": { | ||
"columns": [ | ||
{ | ||
"name": "skuName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "count_", | ||
"type": "integer" | ||
} | ||
], | ||
"rows": [ | ||
[ | ||
"S2", | ||
1 | ||
], | ||
[ | ||
"Y1", | ||
3 | ||
], | ||
[ | ||
"S1", | ||
1 | ||
] | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
...ager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourcesBasicQuery.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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"title": "Basic Query", | ||
"description": "A simple resources query.", | ||
"parameters": { | ||
"api-version": "2018-09-01-preview", | ||
"query": { | ||
"subscriptions": [ | ||
"cfbbd179-59d2-4052-aa06-9270a38aa9d6" | ||
], | ||
"query": "project id, name, type, location, tags | limit 3" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"totalRecords": 3, | ||
"count": 3, | ||
"resultTruncated": "false", | ||
"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", | ||
{} | ||
] | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...er/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourcesComplexQuery.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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"title": "Complex Query", | ||
"description": "A complex query on resources featuring multiple operations.", | ||
"parameters": { | ||
"api-version": "2018-09-01-preview", | ||
"query": { | ||
"subscriptions": [ | ||
"cfbbd179-59d2-4052-aa06-9270a38aa9d6" | ||
], | ||
"query": "project id, name, type, location | where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by location | top 3 by count_" | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"totalRecords": 3, | ||
"count": 3, | ||
"resultTruncated": "false", | ||
"data": { | ||
"columns": [ | ||
{ | ||
"name": "location", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "count_", | ||
"type": "integer" | ||
} | ||
], | ||
"rows": [ | ||
[ | ||
"centralus", | ||
11 | ||
], | ||
[ | ||
"eastus", | ||
11 | ||
], | ||
[ | ||
"southcentralus", | ||
3 | ||
] | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
173 changes: 173 additions & 0 deletions
173
...ager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourcesFacetQuery.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 |
---|---|---|
@@ -0,0 +1,173 @@ | ||
{ | ||
"title": "Facet Query", | ||
"description": "A query on resources requesting extra facets.", | ||
"parameters": { | ||
"api-version": "2018-09-01-preview", | ||
"query": { | ||
"subscriptions": [ | ||
"cfbbd179-59d2-4052-aa06-9270a38aa9d6" | ||
], | ||
"query": "where type =~ 'Microsoft.Compute/virtualMachines' | project id, name, location, properties.storageProfile.osDisk.osType | limit 5", | ||
"facets": [ | ||
{ | ||
"expression": "location", | ||
"options": { | ||
"sortOrder": "desc", | ||
"$top": 3 | ||
} | ||
}, | ||
{ | ||
"expression": "properties.storageProfile.osDisk.osType", | ||
"options": { | ||
"sortOrder": "desc", | ||
"$top": 3 | ||
} | ||
}, | ||
{ | ||
"expression": "nonExistingColumn", | ||
"options": { | ||
"sortOrder": "desc", | ||
"$top": 3 | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"totalRecords": 5, | ||
"count": 5, | ||
"resultTruncated": "false", | ||
"data": { | ||
"columns": [ | ||
{ | ||
"name": "id", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "location", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "properties_storageProfile_osDisk_osType", | ||
"type": "object" | ||
} | ||
], | ||
"rows": [ | ||
[ | ||
"/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/virtualMachines/myTestVm", | ||
"myTestVm", | ||
"eastus", | ||
"Windows" | ||
], | ||
[ | ||
"/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/virtualMachines/myTestAccountVm", | ||
"myTestAccountVm", | ||
"westcentralus", | ||
"Windows" | ||
], | ||
[ | ||
"/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/virtualMachines/yetanothertest", | ||
"yetanothertest", | ||
"eastus", | ||
"Linux" | ||
], | ||
[ | ||
"/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Compute/virtualMachines/drafttest1bux4cv7a7q3aw", | ||
"drafttest1bux4cv7a7q3aw", | ||
"southcentralus", | ||
"Linux" | ||
], | ||
[ | ||
"/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Compute/virtualMachines/testvmntp25370", | ||
"testvmntp25370", | ||
"eastus", | ||
"Windows" | ||
] | ||
] | ||
}, | ||
"facets": [ | ||
{ | ||
"expression": "location", | ||
"resultType": "FacetResult", | ||
"totalRecords": 3, | ||
"count": 3, | ||
"data": { | ||
"columns": [ | ||
{ | ||
"name": "location", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "count", | ||
"type": "integer" | ||
} | ||
], | ||
"rows": [ | ||
[ | ||
"eastus", | ||
3 | ||
], | ||
[ | ||
"southcentralus", | ||
1 | ||
], | ||
[ | ||
"westcentralus", | ||
1 | ||
] | ||
] | ||
} | ||
}, | ||
{ | ||
"expression": "properties.storageProfile.osDisk.osType", | ||
"resultType": "FacetResult", | ||
"totalRecords": 2, | ||
"count": 2, | ||
"data": { | ||
"columns": [ | ||
{ | ||
"name": "properties_storageProfile_osDisk_osType", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "count", | ||
"type": "integer" | ||
} | ||
], | ||
"rows": [ | ||
[ | ||
"Linux", | ||
2 | ||
], | ||
[ | ||
"Windows", | ||
3 | ||
] | ||
] | ||
} | ||
}, | ||
{ | ||
"expression": "nonExistingColumn", | ||
"resultType": "FacetError", | ||
"errors": [ | ||
{ | ||
"code": "NoValidColumns", | ||
"message": "No valid columns in facet expression." | ||
}, | ||
{ | ||
"code": "InvalidColumnNames", | ||
"message": "Invalid column names: [nonExistingColumn]." | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.