From 6674f4cf98941fa9ef1cc9dbf8ff80a3eb2577bc Mon Sep 17 00:00:00 2001 From: npotrebich <113951184+npotrebich@users.noreply.github.com> Date: Tue, 20 Sep 2022 09:38:18 -0700 Subject: [PATCH 01/10] Adds base for updating Microsoft.ResourceGraph from version preview/2021-06-01-preview to version 2022-10-01 --- .../2022-10-01/examples/OperationsList.json | 31 + .../examples/ResourcesBasicQuery.json | 48 ++ .../examples/ResourcesComplexQuery.json | 37 ++ .../examples/ResourcesFacetQuery.json | 185 ++++++ .../examples/ResourcesFilterQuery.json | 43 ++ .../examples/ResourcesFirstPageQuery.json | 48 ++ .../examples/ResourcesHistoryGet.json | 60 ++ .../examples/ResourcesHistoryMgsGet.json | 61 ++ .../examples/ResourcesMgBasicQuery.json | 49 ++ .../examples/ResourcesNextPageQuery.json | 47 ++ .../examples/ResourcesPropertiesQuery.json | 33 + .../examples/ResourcesRandomPageQuery.json | 42 ++ .../examples/ResourcesSummarizeQuery.json | 34 + .../examples/ResourcesTenantBasicQuery.json | 45 ++ .../stable/2022-10-01/resourcegraph.json | 602 ++++++++++++++++++ .../stable/2022-10-01/resourceshistory.json | 244 +++++++ 16 files changed, 1609 insertions(+) create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/OperationsList.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesBasicQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesComplexQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFacetQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFilterQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFirstPageQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesMgBasicQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesNextPageQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesPropertiesQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesRandomPageQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesSummarizeQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesTenantBasicQuery.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/OperationsList.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/OperationsList.json new file mode 100644 index 000000000000..844835abb972 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/OperationsList.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2021-06-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.ResourceGraph/operations/read", + "display": { + "provider": "Microsoft Resource Graph", + "resource": "Operation", + "operation": "Get Operations", + "description": "Gets the list of supported operations" + } + }, + { + "name": "Microsoft.ResourceGraph/resources/read", + "display": { + "provider": "Microsoft Resource Graph", + "resource": "Resources", + "operation": "Query resources", + "description": "Submits a query on resources within specified subscriptions, the specified management groups, or against all access granted in the tenant." + } + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesBasicQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesBasicQuery.json new file mode 100644 index 000000000000..a6c9a0b79467 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesBasicQuery.json @@ -0,0 +1,48 @@ +{ + "title": "Basic Query", + "description": "A simple resources query.", + "parameters": { + "api-version": "2021-06-01-preview", + "query": { + "subscriptions": [ + "cfbbd179-59d2-4052-aa06-9270a38aa9d6" + ], + "query": "Resources | project id, name, type, location, tags | limit 3" + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 3, + "count": 3, + "resultTruncated": "false", + "facets": [], + "data": [ + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Network/networkInterfaces/myNetworkInterface", + "name": "myNetworkInterface", + "type": "microsoft.network/networkinterfaces", + "location": "centralus", + "tags": { + "tag1": "Value1" + } + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Network/virtualNetworks/myVnet", + "name": "myVnet", + "type": "microsoft.network/virtualnetworks", + "location": "westus", + "tags": {} + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Network/publicIPAddresses/myPublicIp", + "name": "myPublicIp", + "type": "microsoft.network/publicipaddresses", + "location": "westus", + "tags": {} + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesComplexQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesComplexQuery.json new file mode 100644 index 000000000000..90f60e294f18 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesComplexQuery.json @@ -0,0 +1,37 @@ +{ + "title": "Complex Query", + "description": "A complex query on resources featuring multiple operations.", + "parameters": { + "api-version": "2021-06-01-preview", + "query": { + "subscriptions": [ + "cfbbd179-59d2-4052-aa06-9270a38aa9d6" + ], + "query": "Resources | 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", + "facets": [], + "data": [ + { + "location": "centralus", + "count_": 11 + }, + { + "location": "eastus", + "count_": 11 + }, + { + "location": "southcentralus", + "count_": 3 + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFacetQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFacetQuery.json new file mode 100644 index 000000000000..cbcec2d623e3 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFacetQuery.json @@ -0,0 +1,185 @@ +{ + "title": "Facet Query", + "description": "A query on resources requesting extra facets.", + "parameters": { + "api-version": "2021-06-01-preview", + "query": { + "subscriptions": [ + "cfbbd179-59d2-4052-aa06-9270a38aa9d6" + ], + "query": "Resources | where type =~ 'Microsoft.Compute/virtualMachines' | project id, name, location, resourceGroup, 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 + } + }, + { + "expression": "resourceGroup", + "options": { + "sortBy": "tolower(resourceGroup)", + "sortOrder": "asc", + "$top": 3 + } + }, + { + "expression": "resourceGroup", + "options": { + "filter": "resourceGroup contains 'test'", + "$top": 3 + } + } + ] + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 5, + "count": 5, + "resultTruncated": "false", + "data": [ + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/B-TEST-RG/providers/Microsoft.Compute/virtualMachines/myTestVm", + "name": "myTestVm", + "location": "eastus", + "resourceGroup": "B-TEST-RG", + "properties_storageProfile_osDisk_osType": "Windows" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/c-rg/providers/Microsoft.Compute/virtualMachines/myTestAccountVm", + "name": "myTestAccountVm", + "location": "westcentralus", + "resourceGroup": "c-rg", + "properties_storageProfile_osDisk_osType": "Windows" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/I-RG/providers/Microsoft.Compute/virtualMachines/yetanothertest", + "name": "yetanothertest", + "location": "eastus", + "resourceGroup": "I-RG", + "properties_storageProfile_osDisk_osType": "Linux" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/x-test-rg/providers/Microsoft.Compute/virtualMachines/drafttest1bux4cv7a7q3aw", + "name": "drafttest1bux4cv7a7q3aw", + "location": "southcentralus", + "resourceGroup": "x-test-rg", + "properties_storageProfile_osDisk_osType": "Linux" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/y-rg/providers/Microsoft.Compute/virtualMachines/testvmntp25370", + "name": "testvmntp25370", + "location": "eastus", + "resourceGroup": "y-rg", + "properties_storageProfile_osDisk_osType": "Windows" + } + ], + "facets": [ + { + "expression": "location", + "resultType": "FacetResult", + "totalRecords": 3, + "count": 3, + "data": [ + { + "location": "eastus", + "count": 3 + }, + { + "location": "southcentralus", + "count": 1 + }, + { + "location": "westcentralus", + "count": 1 + } + ] + }, + { + "expression": "properties.storageProfile.osDisk.osType", + "resultType": "FacetResult", + "totalRecords": 2, + "count": 2, + "data": [ + { + "properties_storageProfile_osDisk_osType": "Linux", + "count": 2 + }, + { + "properties_storageProfile_osDisk_osType": "Windows", + "count": 3 + } + ] + }, + { + "expression": "nonExistingColumn", + "resultType": "FacetError", + "errors": [ + { + "code": "NoValidColumns", + "message": "No valid columns in facet expression." + }, + { + "code": "InvalidColumnNames", + "message": "Invalid column names: [nonExistingColumn]." + } + ] + }, + { + "expression": "resourceGroup", + "resultType": "FacetResult", + "totalRecords": 5, + "count": 3, + "data": [ + { + "resourceGroup": "B-TEST-RG", + "count": 1 + }, + { + "resourceGroup": "c-rg", + "count": 1 + }, + { + "resourceGroup": "I-RG", + "count": 1 + } + ] + }, + { + "expression": "resourceGroup", + "resultType": "FacetResult", + "totalRecords": 2, + "count": 2, + "data": [ + { + "resourceGroup": "B-TEST-RG", + "count": 1 + }, + { + "resourceGroup": "x-test-rg", + "count": 1 + } + ] + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFilterQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFilterQuery.json new file mode 100644 index 000000000000..2f335f223d3e --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFilterQuery.json @@ -0,0 +1,43 @@ +{ + "title": "Filter query", + "description": "A filtering query on resources.", + "parameters": { + "api-version": "2021-06-01-preview", + "query": { + "subscriptions": [ + "cfbbd179-59d2-4052-aa06-9270a38aa9d6" + ], + "query": "Resources | project id, name, type, location | where type =~ 'Microsoft.Compute/virtualMachines' | limit 3" + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 3, + "count": 3, + "resultTruncated": "false", + "facets": [], + "data": [ + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/virtualMachines/myVm1", + "name": "myVm1", + "type": "microsoft.compute/virtualmachines", + "location": "centralus" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Compute/virtualMachines/myVirtualMachine", + "name": "myVirtualMachine", + "type": "microsoft.compute/virtualmachines", + "location": "eastus" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG3/providers/Microsoft.Compute/virtualMachines/testVm", + "name": "testVm", + "type": "microsoft.compute/virtualmachines", + "location": "eastus" + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFirstPageQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFirstPageQuery.json new file mode 100644 index 000000000000..4b3de5eabeb5 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFirstPageQuery.json @@ -0,0 +1,48 @@ +{ + "title": "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": "2021-06-01-preview", + "query": { + "subscriptions": [ + "cfbbd179-59d2-4052-aa06-9270a38aa9d6" + ], + "query": "Resources | where name contains 'test' | project id, name, type, location", + "options": { + "$top": 3, + "$skip": 0 + } + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 386, + "count": 3, + "resultTruncated": "false", + "facets": [], + "$skipToken": "eyAibm8iOiAibHVjayIsICJidXQiOiAibmljZSIsICJ0cnkiOiAiISIgfQ==", + "data": [ + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/disks/yetanothertest_OsDisk_1_f396cbcb625a457bb69fe2abf5975820", + "name": "yetanothertest_OsDisk_1_f396cbcb625a457bb69fe2abf5975820", + "type": "microsoft.compute/disks", + "location": "eastus" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/TestAA", + "name": "TestAA", + "type": "microsoft.automation/automationaccounts", + "location": "westcentralus" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/TestAA/runbooks/TestRB", + "name": "TestRB", + "type": "microsoft.automation/automationaccounts/runbooks", + "location": "westcentralus" + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json new file mode 100644 index 000000000000..e769fed7218c --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json @@ -0,0 +1,60 @@ +{ + "title": "Resource History Query", + "description": "A resource history query.", + "parameters": { + "api-version": "2021-06-01-preview", + "request": { + "subscriptions": [ + "a7f33fdb-e646-4f15-89aa-3a360210861e" + ], + "query": "where name =~ 'cpu-utilization' | project id, name, properties", + "options": { + "interval": { + "start": "2020-11-12T01:00:00.0000000Z", + "end": "2020-11-12T01:25:00.0000000Z" + } + } + } + }, + "responses": { + "200": { + "body": { + "count": 2, + "snapshots": { + "columns": [ + { + "name": "id", + "type": "string" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "properties", + "type": "object" + } + ], + "rows": [ + [ + "/subscriptions/a7f33fdb-e646-4f15-89aa-3a360210861e/resourceGroups/meya-test-rg/providers/Microsoft.Compute/virtualMachines/meya-win-eus/providers/Microsoft.WorkloadMonitor/monitors/cpu-utilization", + "cpu-utilization", + { + "monitorName": "", + "currentStateFirstObservedTimestamp": "" + } + ], + [ + "/subscriptions/a7f33fdb-e646-4f15-89aa-3a360210861e/resourceGroups/meya-test-rg/providers/Microsoft.Compute/virtualMachines/meya-win-eus/providers/Microsoft.WorkloadMonitor/monitors/cpu-utilization", + "cpu-utilization", + { + "monitorName": "test", + "currentStateFirstObservedTimestamp": "" + } + ] + ] + } + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json new file mode 100644 index 000000000000..9177059060bb --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json @@ -0,0 +1,61 @@ +{ + "title": "Resource History Management Group scoped Query", + "description": "A resource history query scoped to a list of management groups.", + "parameters": { + "api-version": "2021-06-01-preview", + "request": { + "managementGroups": [ + "e927f598-c1d4-4f72-8541-95d83a6a4ac8", + "ProductionMG" + ], + "query": "where name =~ 'cpu-utilization' | project id, name, properties", + "options": { + "interval": { + "start": "2020-11-12T01:00:00.0000000Z", + "end": "2020-11-12T01:25:00.0000000Z" + } + } + } + }, + "responses": { + "200": { + "body": { + "count": 2, + "snapshots": { + "columns": [ + { + "name": "id", + "type": "string" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "properties", + "type": "object" + } + ], + "rows": [ + [ + "/subscriptions/a7f33fdb-e646-4f15-89aa-3a360210861e/resourceGroups/meya-test-rg/providers/Microsoft.Compute/virtualMachines/meya-win-eus/providers/Microsoft.WorkloadMonitor/monitors/cpu-utilization", + "cpu-utilization", + { + "monitorName": "", + "currentStateFirstObservedTimestamp": "" + } + ], + [ + "/subscriptions/a7f33fdb-e646-4f15-89aa-3a360210861e/resourceGroups/meya-test-rg/providers/Microsoft.Compute/virtualMachines/meya-win-eus/providers/Microsoft.WorkloadMonitor/monitors/cpu-utilization", + "cpu-utilization", + { + "monitorName": "test", + "currentStateFirstObservedTimestamp": "" + } + ] + ] + } + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesMgBasicQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesMgBasicQuery.json new file mode 100644 index 000000000000..8c117aa61a4d --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesMgBasicQuery.json @@ -0,0 +1,49 @@ +{ + "title": "Basic Query", + "description": "A simple management groups scoped resources query.", + "parameters": { + "api-version": "2021-06-01-preview", + "query": { + "managementGroups": [ + "e927f598-c1d4-4f72-8541-95d83a6a4ac8", + "ProductionMG" + ], + "query": "Resources | project id, name, type, location, tags | limit 3" + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 3, + "count": 3, + "resultTruncated": "false", + "facets": [], + "data": [ + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Network/networkInterfaces/myNetworkInterface", + "name": "myNetworkInterface", + "type": "microsoft.network/networkinterfaces", + "location": "centralus", + "tags": { + "tag1": "Value1" + } + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Network/virtualNetworks/myVnet", + "name": "myVnet", + "type": "microsoft.network/virtualnetworks", + "location": "westus", + "tags": {} + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Network/publicIPAddresses/myPublicIp", + "name": "myPublicIp", + "type": "microsoft.network/publicipaddresses", + "location": "westus", + "tags": {} + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesNextPageQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesNextPageQuery.json new file mode 100644 index 000000000000..691a7a380fb1 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesNextPageQuery.json @@ -0,0 +1,47 @@ +{ + "title": "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": "2021-06-01-preview", + "query": { + "subscriptions": [ + "cfbbd179-59d2-4052-aa06-9270a38aa9d6" + ], + "query": "Resources | where name contains 'test' | project id, name, type, location", + "options": { + "$skipToken": "eyAibm8iOiAibHVjayIsICJidXQiOiAibmljZSIsICJ0cnkiOiAiISIgfQ==" + } + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 386, + "count": 3, + "resultTruncated": "false", + "facets": [], + "$skipToken": "eyAibm8yIjogImx1Y2syIiwgImJ1dDIiOiAibmljZTIiLCAidHJ5MiI6ICIhIiB9", + "data": [ + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/disks/second_OsDisk_dddddbcb625a457bb69fe2abf5975820", + "name": "second_OsDisk_dddddbcb625a457bb69fe2abf5975820", + "type": "microsoft.compute/disks", + "location": "eastus" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/AATest", + "name": "AATest", + "type": "microsoft.automation/automationaccounts", + "location": "westcentralus" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/TestAA/runbooks/RBTest", + "name": "RBTest", + "type": "microsoft.automation/automationaccounts/runbooks", + "location": "westcentralus" + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesPropertiesQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesPropertiesQuery.json new file mode 100644 index 000000000000..ab6a53f32c2a --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesPropertiesQuery.json @@ -0,0 +1,33 @@ +{ + "title": "Properties Query", + "description": "A query accessing one of the resource properties.", + "parameters": { + "api-version": "2021-06-01-preview", + "query": { + "subscriptions": [ + "cfbbd179-59d2-4052-aa06-9270a38aa9d6" + ], + "query": "Resources | where type =~ 'Microsoft.Compute/virtualMachines' | summarize count() by tostring(properties.storageProfile.osDisk.osType)" + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 2, + "count": 2, + "resultTruncated": "false", + "facets": [], + "data": [ + { + "properties_storageProfile_osDisk_osType": "Linux", + "count": 7 + }, + { + "properties_storageProfile_osDisk_osType": "Windows", + "count": 23 + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesRandomPageQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesRandomPageQuery.json new file mode 100644 index 000000000000..ae9cdd5e4c84 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesRandomPageQuery.json @@ -0,0 +1,42 @@ +{ + "title": "Random page query", + "description": "A query on resources specifying paging and max rows through query options", + "parameters": { + "api-version": "2021-06-01-preview", + "query": { + "subscriptions": [ + "cfbbd179-59d2-4052-aa06-9270a38aa9d6" + ], + "query": "Resources | where name contains 'test' | project id, name, type, location", + "options": { + "$top": 2, + "$skip": 10 + } + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 386, + "count": 2, + "resultTruncated": "false", + "facets": [], + "$skipToken": "eyAibm8iOiAibHVjayIsICJidXQiOiAibmljZSIsICJ0cnkiOiAiISIgfQ==", + "data": [ + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Compute/disks/third_OsDisk_dddddbcb625a457bb69fe2abf5975820", + "name": "third_OsDisk_dddddbcb625a457bb69fe2abf5975820", + "type": "microsoft.compute/disks", + "location": "eastus" + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Automation/automationAccounts/CCTest", + "name": "CCTest", + "type": "microsoft.automation/automationaccounts", + "location": "westcentralus" + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesSummarizeQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesSummarizeQuery.json new file mode 100644 index 000000000000..d37a4cc89cbc --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesSummarizeQuery.json @@ -0,0 +1,34 @@ +{ + "title": "Summarize Query", + "description": "A summarizing query on resources.", + "parameters": { + "api-version": "2021-06-01-preview", + "query": { + "subscriptions": [ + "cfbbd179-59d2-4052-aa06-9270a38aa9d6" + ], + "query": "Resources | project id, name, type, location | summarize by location" + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 3, + "count": 3, + "resultTruncated": "false", + "facets": [], + "data": [ + { + "location": "centralus" + }, + { + "location": "eastus" + }, + { + "location": "westus" + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesTenantBasicQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesTenantBasicQuery.json new file mode 100644 index 000000000000..24c77dad1793 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesTenantBasicQuery.json @@ -0,0 +1,45 @@ +{ + "title": "Basic Query", + "description": "A simple tenant scoped resources query.", + "parameters": { + "api-version": "2021-06-01-preview", + "query": { + "query": "Resources | project id, name, type, location, tags | limit 3" + } + }, + "responses": { + "200": { + "body": { + "totalRecords": 3, + "count": 3, + "resultTruncated": "false", + "facets": [], + "data": [ + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG1/providers/Microsoft.Network/networkInterfaces/myNetworkInterface", + "name": "myNetworkInterface", + "type": "microsoft.network/networkinterfaces", + "location": "centralus", + "tags": { + "tag1": "Value1" + } + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Network/virtualNetworks/myVnet", + "name": "myVnet", + "type": "microsoft.network/virtualnetworks", + "location": "westus", + "tags": {} + }, + { + "id": "/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6/resourceGroups/RG2/providers/Microsoft.Network/publicIPAddresses/myPublicIp", + "name": "myPublicIp", + "type": "microsoft.network/publicipaddresses", + "location": "westus", + "tags": {} + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json new file mode 100644 index 000000000000..f2459aa21128 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json @@ -0,0 +1,602 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Resource Graph", + "description": "Azure Resource Graph API Reference", + "version": "2021-06-01-preview" + }, + "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": { + "/providers/Microsoft.ResourceGraph/resources": { + "post": { + "tags": [ + "Resources" + ], + "operationId": "Resources", + "description": "Queries the resources managed by Azure Resource Manager for scopes specified in the request.", + "externalDocs": { + "description": "Learn more about the query syntax here", + "url": "https://aka.ms/resource-graph/learntoquery" + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "query", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/QueryRequest" + }, + "description": "Request specifying query and its options." + } + ], + "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" + } + } + }, + "x-ms-examples": { + "Basic query": { + "$ref": "./examples/ResourcesBasicQuery.json" + }, + "Basic tenant query": { + "$ref": "./examples/ResourcesTenantBasicQuery.json" + }, + "Basic management group query": { + "$ref": "./examples/ResourcesMgBasicQuery.json" + }, + "Filter resources": { + "$ref": "./examples/ResourcesFilterQuery.json" + }, + "Summarize resources by location": { + "$ref": "./examples/ResourcesSummarizeQuery.json" + }, + "Complex query": { + "$ref": "./examples/ResourcesComplexQuery.json" + }, + "Access a properties field": { + "$ref": "./examples/ResourcesPropertiesQuery.json" + }, + "Query with a facet request": { + "$ref": "./examples/ResourcesFacetQuery.json" + }, + "First page query": { + "$ref": "./examples/ResourcesFirstPageQuery.json" + }, + "Next page query": { + "$ref": "./examples/ResourcesNextPageQuery.json" + }, + "Random page query": { + "$ref": "./examples/ResourcesRandomPageQuery.json" + } + } + } + }, + "/providers/Microsoft.ResourceGraph/operations": { + "get": { + "tags": [ + "Operations" + ], + "description": "Lists all of the available REST API operations.", + "operationId": "Operations_List", + "x-ms-examples": { + "OperationsList": { + "$ref": "./examples/OperationsList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + }, + "default": { + "description": "An error occurred while processing the request. See the error.code parameter to identify the specific error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + } + }, + "definitions": { + "QueryRequest": { + "description": "Describes a query to be executed.", + "type": "object", + "properties": { + "subscriptions": { + "description": "Azure subscriptions against which to execute the query.", + "type": "array", + "items": { + "type": "string", + "description": "Subscription Id." + } + }, + "managementGroups": { + "description": "Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ]", + "type": "array", + "items": { + "type": "string", + "description": "The name of Management group." + } + }, + "query": { + "description": "The resources query.", + "type": "string" + }, + "options": { + "description": "The query evaluation options", + "$ref": "#/definitions/QueryRequestOptions" + }, + "facets": { + "description": "An array of facet requests to be computed against the query result.", + "type": "array", + "items": { + "$ref": "#/definitions/FacetRequest" + } + } + }, + "required": [ + "query" + ] + }, + "QueryRequestOptions": { + "description": "The options for query evaluation", + "properties": { + "$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.", + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + }, + "$skip": { + "description": "The number of rows to skip from the beginning of the results. Overrides the next page offset when ```$skipToken``` property is present.", + "type": "integer", + "format": "int32", + "minimum": 0 + }, + "resultFormat": { + "description": "Defines in which format query result returned.", + "type": "string", + "enum": [ + "table", + "objectArray" + ], + "default": "objectArray", + "x-ms-enum": { + "name": "ResultFormat", + "modelAsString": false + } + }, + "allowPartialScopes": { + "description": "Only applicable for tenant and management group level queries to decide whether to allow partial scopes for result in case the number of subscriptions exceed allowed limits.", + "type": "boolean", + "default": false + }, + "authorizationScopeFilter": { + "description": "Defines what level of authorization resources should be returned based on the which subscriptions and management groups are passed as scopes.", + "type": "string", + "enum": [ + "AtScopeAndBelow", + "AtScopeAndAbove", + "AtScopeExact", + "AtScopeAboveAndBelow" + ], + "default": "AtScopeAndBelow", + "x-ms-enum": { + "name": "AuthorizationScopeFilter", + "modelAsString": false + } + } + } + }, + "FacetRequest": { + "description": "A request to compute additional statistics (facets) over the query results.", + "type": "object", + "properties": { + "expression": { + "description": "The column or list of columns to summarize by", + "type": "string" + }, + "options": { + "description": "The options for facet evaluation", + "$ref": "#/definitions/FacetRequestOptions" + } + }, + "required": [ + "expression" + ] + }, + "FacetRequestOptions": { + "description": "The options for facet evaluation", + "properties": { + "sortBy": { + "description": "The column name or query expression to sort on. Defaults to count if not present.", + "type": "string" + }, + "sortOrder": { + "description": "The sorting order by the selected column (count by default).", + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "FacetSortOrder", + "modelAsString": false + } + }, + "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" + }, + "$top": { + "description": "The maximum number of facet rows that should be returned.", + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + } + } + }, + "QueryResponse": { + "description": "Query result.", + "type": "object", + "properties": { + "totalRecords": { + "description": "Number of total records matching the query.", + "type": "integer", + "format": "int64" + }, + "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.", + "type": "integer", + "format": "int64" + }, + "resultTruncated": { + "description": "Indicates whether the query results are truncated.", + "type": "string", + "enum": [ + "true", + "false" + ], + "x-ms-enum": { + "name": "ResultTruncated", + "modelAsString": false + } + }, + "$skipToken": { + "description": "When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data.", + "type": "string" + }, + "data": { + "description": "Query output in JObject array or Table format.", + "type": "object" + }, + "facets": { + "description": "Query facets.", + "type": "array", + "items": { + "$ref": "#/definitions/Facet" + } + } + }, + "required": [ + "totalRecords", + "count", + "resultTruncated", + "data" + ] + }, + "Table": { + "description": "Query output in tabular format.", + "type": "object", + "properties": { + "columns": { + "description": "Query result column descriptors.", + "type": "array", + "items": { + "$ref": "#/definitions/Column", + "description": "Column descriptor." + } + }, + "rows": { + "description": "Query result rows.", + "type": "array", + "items": { + "$ref": "#/definitions/Row", + "description": "Query result row." + } + } + }, + "required": [ + "columns", + "rows" + ] + }, + "Column": { + "description": "Query result column descriptor.", + "type": "object", + "properties": { + "name": { + "description": "Column name.", + "type": "string" + }, + "type": { + "description": "Column data type.", + "$ref": "#/definitions/ColumnDataType" + } + }, + "required": [ + "name", + "type" + ] + }, + "ColumnDataType": { + "description": "Data type of a column in a table.", + "type": "string", + "enum": [ + "string", + "integer", + "number", + "boolean", + "object", + "datetime" + ], + "x-ms-enum": { + "name": "ColumnDataType", + "modelAsString": false + } + }, + "Row": { + "description": "Query result row.", + "type": "array", + "items": { + "type": "object", + "description": "Cell value." + } + }, + "Facet": { + "description": "A facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError.", + "type": "object", + "properties": { + "expression": { + "description": "Facet expression, same as in the corresponding facet request.", + "type": "string" + }, + "resultType": { + "description": "Result type", + "type": "string" + } + }, + "required": [ + "expression", + "resultType" + ], + "discriminator": "resultType" + }, + "FacetResult": { + "x-ms-discriminator-value": "FacetResult", + "description": "Successfully executed facet containing additional statistics on the response of a query.", + "type": "object", + "properties": { + "totalRecords": { + "description": "Number of total records in the facet results.", + "type": "integer", + "format": "int64" + }, + "count": { + "description": "Number of records returned in the facet response.", + "type": "integer", + "format": "int32" + }, + "data": { + "description": "A JObject array or Table containing the desired facets. Only present if the facet is valid.", + "type": "object" + } + }, + "required": [ + "totalRecords", + "count", + "data" + ], + "allOf": [ + { + "$ref": "#/definitions/Facet" + } + ] + }, + "FacetError": { + "x-ms-discriminator-value": "FacetError", + "description": "A facet whose execution resulted in an error.", + "type": "object", + "properties": { + "errors": { + "description": "An array containing detected facet errors with details.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "required": [ + "errors" + ], + "allOf": [ + { + "$ref": "#/definitions/Facet" + } + ] + }, + "ErrorResponse": { + "title": "Error response.", + "type": "object", + "description": "An error response from the API.", + "properties": { + "error": { + "$ref": "#/definitions/Error", + "description": "Error information." + } + }, + "required": [ + "error" + ] + }, + "Error": { + "title": "Error info.", + "type": "object", + "description": "Error details.", + "properties": { + "code": { + "type": "string", + "description": "Error code identifying the specific error." + }, + "message": { + "type": "string", + "description": "A human readable error message." + }, + "details": { + "type": "array", + "description": "Error details", + "items": { + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "required": [ + "code", + "message" + ] + }, + "ErrorDetails": { + "title": "Error details.", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error code identifying the specific error." + }, + "message": { + "type": "string", + "description": "A human readable error message." + } + }, + "additionalProperties": { + "type": "object" + }, + "required": [ + "code", + "message" + ] + }, + "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": { + "type": "array", + "items": { + "$ref": "#/definitions/Operation" + }, + "description": "List of Resource Graph operations supported by the Resource Graph resource provider." + } + } + }, + "Operation": { + "description": "Resource Graph REST API operation definition.", + "properties": { + "name": { + "description": "Operation name: {provider}/{resource}/{operation}", + "type": "string" + }, + "display": { + "description": "Display metadata associated with the operation.", + "properties": { + "provider": { + "description": "Service provider: Microsoft Resource Graph.", + "type": "string" + }, + "resource": { + "description": "Resource on which the operation is performed etc.", + "type": "string" + }, + "operation": { + "description": "Type of operation: get, read, delete, etc.", + "type": "string" + }, + "description": { + "description": "Description for the operation.", + "type": "string" + } + } + }, + "origin": { + "type": "string", + "description": "The origin of operations." + } + } + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Api Version." + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json new file mode 100644 index 000000000000..56b81330feff --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json @@ -0,0 +1,244 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Resource Graph", + "description": "Azure Resource Graph API Reference", + "version": "2021-06-01-preview" + }, + "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": { + "/providers/Microsoft.ResourceGraph/resourcesHistory": { + "post": { + "description": "List all snapshots of a resource for a given time interval.", + "operationId": "ResourcesHistory", + "tags": [ + "History" + ], + "parameters": [ + { + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ResourcesHistoryRequest" + }, + "description": "Request specifying the query and its options." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "default": { + "description": "A response indicating an error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Resource History Query": { + "$ref": "./examples/ResourcesHistoryGet.json" + }, + "Resource History Management Group scope Query": { + "$ref": "./examples/ResourcesHistoryMgsGet.json" + } + } + } + } + }, + "definitions": { + "ResourcesHistoryRequest": { + "description": "Describes a history request to be executed.", + "type": "object", + "properties": { + "subscriptions": { + "description": "Azure subscriptions against which to execute the query.", + "type": "array", + "items": { + "type": "string", + "description": "Subscription Id." + } + }, + "query": { + "description": "The resources query.", + "type": "string" + }, + "options": { + "description": "The history request evaluation options", + "$ref": "#/definitions/ResourcesHistoryRequestOptions" + }, + "managementGroups": { + "description": "Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ]", + "type": "array", + "items": { + "type": "string", + "description": "The name of Management group." + } + } + } + }, + "ResourcesHistoryRequestOptions": { + "description": "The options for history request evaluation", + "type": "object", + "properties": { + "interval": { + "description": "The time interval used to fetch history.", + "$ref": "#/definitions/DateTimeInterval" + }, + "$top": { + "description": "The maximum number of rows that the query should return. Overrides the page size when ```$skipToken``` property is present.", + "format": "int32", + "type": "integer", + "minimum": 1, + "maximum": 1000 + }, + "$skip": { + "description": "The number of rows to skip from the beginning of the results. Overrides the next page offset when ```$skipToken``` property is present.", + "type": "integer", + "format": "int32", + "minimum": 0 + }, + "$skipToken": { + "description": "Continuation token for pagination, capturing the next page size and offset, as well as the context of the query.", + "type": "string" + }, + "resultFormat": { + "description": "Defines in which format query result returned.", + "type": "string", + "enum": [ + "table", + "objectArray" + ], + "x-ms-enum": { + "name": "ResultFormat", + "modelAsString": false + } + } + } + }, + "DateTimeInterval": { + "description": "An interval in time specifying the date and time for the inclusive start and exclusive end, i.e. `[start, end)`.", + "type": "object", + "properties": { + "start": { + "description": "A datetime indicating the inclusive/closed start of the time interval, i.e. `[`**`start`**`, end)`. Specifying a `start` that occurs chronologically after `end` will result in an error.", + "type": "string", + "format": "date-time" + }, + "end": { + "description": "A datetime indicating the exclusive/open end of the time interval, i.e. `[start, `**`end`**`)`. Specifying an `end` that occurs chronologically before `start` will result in an error.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "start", + "end" + ] + }, + "ErrorResponse": { + "title": "Error response.", + "type": "object", + "description": "An error response from the API.", + "properties": { + "error": { + "$ref": "#/definitions/Error", + "description": "Error information." + } + }, + "required": [ + "error" + ] + }, + "Error": { + "title": "Error info.", + "type": "object", + "description": "Error details.", + "properties": { + "code": { + "type": "string", + "description": "Error code identifying the specific error." + }, + "message": { + "type": "string", + "description": "A human readable error message." + }, + "details": { + "type": "array", + "description": "Error details", + "items": { + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "required": [ + "code", + "message" + ] + }, + "ErrorDetails": { + "title": "Error details.", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error code identifying the specific error." + }, + "message": { + "type": "string", + "description": "A human readable error message." + } + }, + "additionalProperties": { + "type": "object" + }, + "required": [ + "code", + "message" + ] + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Api Version." + } + } +} From ab62fa9ecd11eacfa11a80405f2d37dac33dab93 Mon Sep 17 00:00:00 2001 From: npotrebich <113951184+npotrebich@users.noreply.github.com> Date: Tue, 20 Sep 2022 09:38:22 -0700 Subject: [PATCH 02/10] Updates readme --- .../resourcegraph/resource-manager/readme.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/specification/resourcegraph/resource-manager/readme.md b/specification/resourcegraph/resource-manager/readme.md index 80cca72884c1..5fb5d5aecd3b 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -27,7 +27,7 @@ These are the global settings for the ResourceGraph API. ``` yaml title: ResourceGraphClient openapi-type: arm -tag: package-preview-2021-06 +tag: package-2022-10 ``` ### Validations @@ -42,15 +42,25 @@ message-format: json ``` +### Tag: package-2022-10 + +These settings apply only when `--tag=package-2022-10` is specified on the command line. + +```yaml $(tag) == 'package-2022-10' +input-file: + - Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json + - Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json +``` ### Tag: package-preview-2021-06 These settings apply only when `--tag=package-preview-2021-06` is specified on the command line. -```yaml $(tag) == 'package-preview-2021-06' +``` yaml $(tag) == 'package-preview-2021-06' input-file: - Microsoft.ResourceGraph/preview/2021-06-01-preview/resourcegraph.json - Microsoft.ResourceGraph/preview/2021-06-01-preview/resourceshistory.json ``` + ### Tag: package-preview-2021-03 These settings apply only when `--tag=package-preview-2021-03` is specified on the command line. From 590016acde716630b2128b1505166d437fa0941b Mon Sep 17 00:00:00 2001 From: npotrebich <113951184+npotrebich@users.noreply.github.com> Date: Tue, 20 Sep 2022 09:38:25 -0700 Subject: [PATCH 03/10] Updates API version in new specs and examples --- .../stable/2022-10-01/examples/OperationsList.json | 2 +- .../stable/2022-10-01/examples/ResourcesBasicQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesComplexQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesFacetQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesFilterQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesFirstPageQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesHistoryGet.json | 2 +- .../stable/2022-10-01/examples/ResourcesHistoryMgsGet.json | 2 +- .../stable/2022-10-01/examples/ResourcesMgBasicQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesNextPageQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesPropertiesQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesRandomPageQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesSummarizeQuery.json | 2 +- .../stable/2022-10-01/examples/ResourcesTenantBasicQuery.json | 2 +- .../stable/2022-10-01/resourcegraph.json | 2 +- .../stable/2022-10-01/resourceshistory.json | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/OperationsList.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/OperationsList.json index 844835abb972..0c1174ec4880 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/OperationsList.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/OperationsList.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-06-01-preview" + "api-version": "2022-10-01" }, "responses": { "200": { diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesBasicQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesBasicQuery.json index a6c9a0b79467..0a5d0f4274e5 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesBasicQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesBasicQuery.json @@ -2,7 +2,7 @@ "title": "Basic Query", "description": "A simple resources query.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "subscriptions": [ "cfbbd179-59d2-4052-aa06-9270a38aa9d6" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesComplexQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesComplexQuery.json index 90f60e294f18..c1d7f4174820 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesComplexQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesComplexQuery.json @@ -2,7 +2,7 @@ "title": "Complex Query", "description": "A complex query on resources featuring multiple operations.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "subscriptions": [ "cfbbd179-59d2-4052-aa06-9270a38aa9d6" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFacetQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFacetQuery.json index cbcec2d623e3..1c400ae3ee51 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFacetQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFacetQuery.json @@ -2,7 +2,7 @@ "title": "Facet Query", "description": "A query on resources requesting extra facets.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "subscriptions": [ "cfbbd179-59d2-4052-aa06-9270a38aa9d6" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFilterQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFilterQuery.json index 2f335f223d3e..dd0730aa5e52 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFilterQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFilterQuery.json @@ -2,7 +2,7 @@ "title": "Filter query", "description": "A filtering query on resources.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "subscriptions": [ "cfbbd179-59d2-4052-aa06-9270a38aa9d6" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFirstPageQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFirstPageQuery.json index 4b3de5eabeb5..1edf8110f6f4 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFirstPageQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesFirstPageQuery.json @@ -2,7 +2,7 @@ "title": "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": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "subscriptions": [ "cfbbd179-59d2-4052-aa06-9270a38aa9d6" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json index e769fed7218c..2e5c32bcff1b 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json @@ -2,7 +2,7 @@ "title": "Resource History Query", "description": "A resource history query.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "request": { "subscriptions": [ "a7f33fdb-e646-4f15-89aa-3a360210861e" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json index 9177059060bb..bf8346febb02 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json @@ -2,7 +2,7 @@ "title": "Resource History Management Group scoped Query", "description": "A resource history query scoped to a list of management groups.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "request": { "managementGroups": [ "e927f598-c1d4-4f72-8541-95d83a6a4ac8", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesMgBasicQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesMgBasicQuery.json index 8c117aa61a4d..d8135762db4b 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesMgBasicQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesMgBasicQuery.json @@ -2,7 +2,7 @@ "title": "Basic Query", "description": "A simple management groups scoped resources query.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "managementGroups": [ "e927f598-c1d4-4f72-8541-95d83a6a4ac8", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesNextPageQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesNextPageQuery.json index 691a7a380fb1..000f3ad15126 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesNextPageQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesNextPageQuery.json @@ -2,7 +2,7 @@ "title": "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": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "subscriptions": [ "cfbbd179-59d2-4052-aa06-9270a38aa9d6" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesPropertiesQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesPropertiesQuery.json index ab6a53f32c2a..a5c742e3383d 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesPropertiesQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesPropertiesQuery.json @@ -2,7 +2,7 @@ "title": "Properties Query", "description": "A query accessing one of the resource properties.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "subscriptions": [ "cfbbd179-59d2-4052-aa06-9270a38aa9d6" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesRandomPageQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesRandomPageQuery.json index ae9cdd5e4c84..cc8eee16b18a 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesRandomPageQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesRandomPageQuery.json @@ -2,7 +2,7 @@ "title": "Random page query", "description": "A query on resources specifying paging and max rows through query options", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "subscriptions": [ "cfbbd179-59d2-4052-aa06-9270a38aa9d6" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesSummarizeQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesSummarizeQuery.json index d37a4cc89cbc..23ca5cdcd7a9 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesSummarizeQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesSummarizeQuery.json @@ -2,7 +2,7 @@ "title": "Summarize Query", "description": "A summarizing query on resources.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "subscriptions": [ "cfbbd179-59d2-4052-aa06-9270a38aa9d6" diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesTenantBasicQuery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesTenantBasicQuery.json index 24c77dad1793..b0f6b3c49cf5 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesTenantBasicQuery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesTenantBasicQuery.json @@ -2,7 +2,7 @@ "title": "Basic Query", "description": "A simple tenant scoped resources query.", "parameters": { - "api-version": "2021-06-01-preview", + "api-version": "2022-10-01", "query": { "query": "Resources | project id, name, type, location, tags | limit 3" } diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json index f2459aa21128..2166b97c342a 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json @@ -3,7 +3,7 @@ "info": { "title": "Azure Resource Graph", "description": "Azure Resource Graph API Reference", - "version": "2021-06-01-preview" + "version": "2022-10-01" }, "host": "management.azure.com", "schemes": [ diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json index 56b81330feff..d5efc0e31d4f 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json @@ -3,7 +3,7 @@ "info": { "title": "Azure Resource Graph", "description": "Azure Resource Graph API Reference", - "version": "2021-06-01-preview" + "version": "2022-10-01" }, "host": "management.azure.com", "schemes": [ From 9e4bbb5c32ba09367eb73bc996ef28d552a6fcf5 Mon Sep 17 00:00:00 2001 From: Nina Potrebich Date: Tue, 20 Sep 2022 13:58:42 -0700 Subject: [PATCH 04/10] Add ResourceHistoryRequestResponse type --- .../stable/2022-10-01/resourceshistory.json | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json index d5efc0e31d4f..76fcc589ef60 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json @@ -59,7 +59,7 @@ "200": { "description": "OK", "schema": { - "type": "object" + "$ref": "#/definitions/ResourceHistoryRequestResponse" } }, "default": { @@ -150,6 +150,21 @@ } } }, + "ResourceHistoryRequestResponse": { + "description": "The result of quering for snapshots of a resource for a given time interval.", + "type": "object", + "properties": { + "count": { + "description": "Number of snapshots returned in the current response.", + "type": "integer", + "format": "int64" + }, + "snapshots": { + "description": "All snapshots of a resource for a given time interval.", + "type": "object" + } + } + }, "DateTimeInterval": { "description": "An interval in time specifying the date and time for the inclusive start and exclusive end, i.e. `[start, end)`.", "type": "object", From 2ed05145c20f3167f995d2c9bb1346798883126a Mon Sep 17 00:00:00 2001 From: Nina Potrebich Date: Wed, 21 Sep 2022 08:55:59 -0700 Subject: [PATCH 05/10] Spell check fix --- .../stable/2022-10-01/resourceshistory.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json index 76fcc589ef60..b3c7ea5753a6 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json @@ -151,7 +151,7 @@ } }, "ResourceHistoryRequestResponse": { - "description": "The result of quering for snapshots of a resource for a given time interval.", + "description": "Query result for snapshots of a resource for a given time interval.", "type": "object", "properties": { "count": { From e9a986f89bae98b18095c5575fd952af33a7cb11 Mon Sep 17 00:00:00 2001 From: Nina Potrebich Date: Thu, 22 Sep 2022 14:05:23 -0700 Subject: [PATCH 06/10] Remove resourcehistory.json. Update readme. --- .../examples/ResourcesHistoryGet.json | 60 ---- .../examples/ResourcesHistoryMgsGet.json | 61 ----- .../stable/2022-10-01/resourceshistory.json | 259 ------------------ .../resource-manager/readme.go.md | 10 + .../resourcegraph/resource-manager/readme.md | 3 +- 5 files changed, 12 insertions(+), 381 deletions(-) delete mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json delete mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json delete mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json deleted file mode 100644 index 2e5c32bcff1b..000000000000 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryGet.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "title": "Resource History Query", - "description": "A resource history query.", - "parameters": { - "api-version": "2022-10-01", - "request": { - "subscriptions": [ - "a7f33fdb-e646-4f15-89aa-3a360210861e" - ], - "query": "where name =~ 'cpu-utilization' | project id, name, properties", - "options": { - "interval": { - "start": "2020-11-12T01:00:00.0000000Z", - "end": "2020-11-12T01:25:00.0000000Z" - } - } - } - }, - "responses": { - "200": { - "body": { - "count": 2, - "snapshots": { - "columns": [ - { - "name": "id", - "type": "string" - }, - { - "name": "name", - "type": "string" - }, - { - "name": "properties", - "type": "object" - } - ], - "rows": [ - [ - "/subscriptions/a7f33fdb-e646-4f15-89aa-3a360210861e/resourceGroups/meya-test-rg/providers/Microsoft.Compute/virtualMachines/meya-win-eus/providers/Microsoft.WorkloadMonitor/monitors/cpu-utilization", - "cpu-utilization", - { - "monitorName": "", - "currentStateFirstObservedTimestamp": "" - } - ], - [ - "/subscriptions/a7f33fdb-e646-4f15-89aa-3a360210861e/resourceGroups/meya-test-rg/providers/Microsoft.Compute/virtualMachines/meya-win-eus/providers/Microsoft.WorkloadMonitor/monitors/cpu-utilization", - "cpu-utilization", - { - "monitorName": "test", - "currentStateFirstObservedTimestamp": "" - } - ] - ] - } - } - } - } -} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json deleted file mode 100644 index bf8346febb02..000000000000 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/examples/ResourcesHistoryMgsGet.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "title": "Resource History Management Group scoped Query", - "description": "A resource history query scoped to a list of management groups.", - "parameters": { - "api-version": "2022-10-01", - "request": { - "managementGroups": [ - "e927f598-c1d4-4f72-8541-95d83a6a4ac8", - "ProductionMG" - ], - "query": "where name =~ 'cpu-utilization' | project id, name, properties", - "options": { - "interval": { - "start": "2020-11-12T01:00:00.0000000Z", - "end": "2020-11-12T01:25:00.0000000Z" - } - } - } - }, - "responses": { - "200": { - "body": { - "count": 2, - "snapshots": { - "columns": [ - { - "name": "id", - "type": "string" - }, - { - "name": "name", - "type": "string" - }, - { - "name": "properties", - "type": "object" - } - ], - "rows": [ - [ - "/subscriptions/a7f33fdb-e646-4f15-89aa-3a360210861e/resourceGroups/meya-test-rg/providers/Microsoft.Compute/virtualMachines/meya-win-eus/providers/Microsoft.WorkloadMonitor/monitors/cpu-utilization", - "cpu-utilization", - { - "monitorName": "", - "currentStateFirstObservedTimestamp": "" - } - ], - [ - "/subscriptions/a7f33fdb-e646-4f15-89aa-3a360210861e/resourceGroups/meya-test-rg/providers/Microsoft.Compute/virtualMachines/meya-win-eus/providers/Microsoft.WorkloadMonitor/monitors/cpu-utilization", - "cpu-utilization", - { - "monitorName": "test", - "currentStateFirstObservedTimestamp": "" - } - ] - ] - } - } - } - } -} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json deleted file mode 100644 index b3c7ea5753a6..000000000000 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure Resource Graph", - "description": "Azure Resource Graph API Reference", - "version": "2022-10-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": { - "/providers/Microsoft.ResourceGraph/resourcesHistory": { - "post": { - "description": "List all snapshots of a resource for a given time interval.", - "operationId": "ResourcesHistory", - "tags": [ - "History" - ], - "parameters": [ - { - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ResourcesHistoryRequest" - }, - "description": "Request specifying the query and its options." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/ResourceHistoryRequestResponse" - } - }, - "default": { - "description": "A response indicating an error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Resource History Query": { - "$ref": "./examples/ResourcesHistoryGet.json" - }, - "Resource History Management Group scope Query": { - "$ref": "./examples/ResourcesHistoryMgsGet.json" - } - } - } - } - }, - "definitions": { - "ResourcesHistoryRequest": { - "description": "Describes a history request to be executed.", - "type": "object", - "properties": { - "subscriptions": { - "description": "Azure subscriptions against which to execute the query.", - "type": "array", - "items": { - "type": "string", - "description": "Subscription Id." - } - }, - "query": { - "description": "The resources query.", - "type": "string" - }, - "options": { - "description": "The history request evaluation options", - "$ref": "#/definitions/ResourcesHistoryRequestOptions" - }, - "managementGroups": { - "description": "Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ]", - "type": "array", - "items": { - "type": "string", - "description": "The name of Management group." - } - } - } - }, - "ResourcesHistoryRequestOptions": { - "description": "The options for history request evaluation", - "type": "object", - "properties": { - "interval": { - "description": "The time interval used to fetch history.", - "$ref": "#/definitions/DateTimeInterval" - }, - "$top": { - "description": "The maximum number of rows that the query should return. Overrides the page size when ```$skipToken``` property is present.", - "format": "int32", - "type": "integer", - "minimum": 1, - "maximum": 1000 - }, - "$skip": { - "description": "The number of rows to skip from the beginning of the results. Overrides the next page offset when ```$skipToken``` property is present.", - "type": "integer", - "format": "int32", - "minimum": 0 - }, - "$skipToken": { - "description": "Continuation token for pagination, capturing the next page size and offset, as well as the context of the query.", - "type": "string" - }, - "resultFormat": { - "description": "Defines in which format query result returned.", - "type": "string", - "enum": [ - "table", - "objectArray" - ], - "x-ms-enum": { - "name": "ResultFormat", - "modelAsString": false - } - } - } - }, - "ResourceHistoryRequestResponse": { - "description": "Query result for snapshots of a resource for a given time interval.", - "type": "object", - "properties": { - "count": { - "description": "Number of snapshots returned in the current response.", - "type": "integer", - "format": "int64" - }, - "snapshots": { - "description": "All snapshots of a resource for a given time interval.", - "type": "object" - } - } - }, - "DateTimeInterval": { - "description": "An interval in time specifying the date and time for the inclusive start and exclusive end, i.e. `[start, end)`.", - "type": "object", - "properties": { - "start": { - "description": "A datetime indicating the inclusive/closed start of the time interval, i.e. `[`**`start`**`, end)`. Specifying a `start` that occurs chronologically after `end` will result in an error.", - "type": "string", - "format": "date-time" - }, - "end": { - "description": "A datetime indicating the exclusive/open end of the time interval, i.e. `[start, `**`end`**`)`. Specifying an `end` that occurs chronologically before `start` will result in an error.", - "type": "string", - "format": "date-time" - } - }, - "required": [ - "start", - "end" - ] - }, - "ErrorResponse": { - "title": "Error response.", - "type": "object", - "description": "An error response from the API.", - "properties": { - "error": { - "$ref": "#/definitions/Error", - "description": "Error information." - } - }, - "required": [ - "error" - ] - }, - "Error": { - "title": "Error info.", - "type": "object", - "description": "Error details.", - "properties": { - "code": { - "type": "string", - "description": "Error code identifying the specific error." - }, - "message": { - "type": "string", - "description": "A human readable error message." - }, - "details": { - "type": "array", - "description": "Error details", - "items": { - "$ref": "#/definitions/ErrorDetails" - } - } - }, - "required": [ - "code", - "message" - ] - }, - "ErrorDetails": { - "title": "Error details.", - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Error code identifying the specific error." - }, - "message": { - "type": "string", - "description": "A human readable error message." - } - }, - "additionalProperties": { - "type": "object" - }, - "required": [ - "code", - "message" - ] - } - }, - "parameters": { - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Api Version." - } - } -} diff --git a/specification/resourcegraph/resource-manager/readme.go.md b/specification/resourcegraph/resource-manager/readme.go.md index e87e8f92138b..a728d20796ae 100644 --- a/specification/resourcegraph/resource-manager/readme.go.md +++ b/specification/resourcegraph/resource-manager/readme.go.md @@ -21,12 +21,22 @@ azure-arm: true ``` yaml $(go) && $(multiapi) batch: + - tag: package-2022-10 - tag: package-preview-2021-03 - tag: package-2021-03 - tag: package-2019-04 - tag: package-2018-09-preview ``` +### Tag: package-2022-10 and go + +These settings apply only when `--tag=package-2022-10 --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'package-2022-10' && $(go) +output-folder: $(go-sdk-folder)/services/$(namespace)/mgmt/2022-10-01/$(namespace) +``` + ### Tag: package-preview-2021-03 and go These settings apply only when `--tag=package-preview-2021-03 --go` is specified on the command line. diff --git a/specification/resourcegraph/resource-manager/readme.md b/specification/resourcegraph/resource-manager/readme.md index 5fb5d5aecd3b..a3518a0052e9 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -48,8 +48,9 @@ These settings apply only when `--tag=package-2022-10` is specified on the comma ```yaml $(tag) == 'package-2022-10' input-file: + - Microsoft.ResourceGraph/preview/2020-09-01-preview/resourcechanges.json - Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json - - Microsoft.ResourceGraph/stable/2022-10-01/resourceshistory.json + - Microsoft.ResourceGraph/preview/2021-06-01-preview/resourceshistory.json ``` ### Tag: package-preview-2021-06 From d8c5ee2a7b6fa1606cf0398b7dc8f3b33305ff9c Mon Sep 17 00:00:00 2001 From: Nina Potrebich Date: Thu, 22 Sep 2022 14:41:33 -0700 Subject: [PATCH 07/10] Update readme --- specification/resourcegraph/resource-manager/readme.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/resourcegraph/resource-manager/readme.md b/specification/resourcegraph/resource-manager/readme.md index a3518a0052e9..48f66b013909 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -48,9 +48,7 @@ These settings apply only when `--tag=package-2022-10` is specified on the comma ```yaml $(tag) == 'package-2022-10' input-file: - - Microsoft.ResourceGraph/preview/2020-09-01-preview/resourcechanges.json - Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json - - Microsoft.ResourceGraph/preview/2021-06-01-preview/resourceshistory.json ``` ### Tag: package-preview-2021-06 From fea17e313d8758bd3b23b1320ce358b6b794175d Mon Sep 17 00:00:00 2001 From: Nina Potrebich Date: Thu, 22 Sep 2022 14:57:46 -0700 Subject: [PATCH 08/10] Revert "Update readme" This reverts commit d8c5ee2a7b6fa1606cf0398b7dc8f3b33305ff9c. --- specification/resourcegraph/resource-manager/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/resourcegraph/resource-manager/readme.md b/specification/resourcegraph/resource-manager/readme.md index 48f66b013909..a3518a0052e9 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -48,7 +48,9 @@ These settings apply only when `--tag=package-2022-10` is specified on the comma ```yaml $(tag) == 'package-2022-10' input-file: + - Microsoft.ResourceGraph/preview/2020-09-01-preview/resourcechanges.json - Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json + - Microsoft.ResourceGraph/preview/2021-06-01-preview/resourceshistory.json ``` ### Tag: package-preview-2021-06 From c1011dc786d031877d702ef23a06cf91f0c6f6bd Mon Sep 17 00:00:00 2001 From: Nina Potrebich Date: Tue, 27 Sep 2022 15:30:56 -0700 Subject: [PATCH 09/10] Update readme --- specification/resourcegraph/resource-manager/readme.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/specification/resourcegraph/resource-manager/readme.md b/specification/resourcegraph/resource-manager/readme.md index a3518a0052e9..8299529c370f 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -46,11 +46,9 @@ message-format: json These settings apply only when `--tag=package-2022-10` is specified on the command line. -```yaml $(tag) == 'package-2022-10' +``` yaml $(tag) == 'package-2022-10' input-file: - - Microsoft.ResourceGraph/preview/2020-09-01-preview/resourcechanges.json - Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json - - Microsoft.ResourceGraph/preview/2021-06-01-preview/resourceshistory.json ``` ### Tag: package-preview-2021-06 From 1f2b3f6ec79911a5378698d2d4dc787679359ec7 Mon Sep 17 00:00:00 2001 From: Nina Potrebich Date: Thu, 29 Sep 2022 12:57:56 -0700 Subject: [PATCH 10/10] Update readme --- specification/resourcegraph/resource-manager/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/resourcegraph/resource-manager/readme.md b/specification/resourcegraph/resource-manager/readme.md index 8299529c370f..babf9d7b0ac9 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -49,6 +49,8 @@ These settings apply only when `--tag=package-2022-10` is specified on the comma ``` yaml $(tag) == 'package-2022-10' input-file: - Microsoft.ResourceGraph/stable/2022-10-01/resourcegraph.json + - Microsoft.ResourceGraph/preview/2021-06-01-preview/resourceshistory.json + - Microsoft.ResourceGraph/preview/2020-09-01-preview/resourcechanges.json ``` ### Tag: package-preview-2021-06