Skip to content

Commit

Permalink
Create new resource type: Microsoft.ResourceGraph/queries (#5478)
Browse files Browse the repository at this point in the history
* Adding Workbooks resource type.

* Rename workbookDelete.json to WorkbookDelete.json

* Fixed undefiend parameter issue with Delete verb.

* Update swagger to add subscriptionId

* Fixed duplicated operation id issue

* Removed links endpoint

* Removed unused samples

* Revert "Removed unused samples"

This reverts commit bed6bc3.

* Revert "Removed links endpoint"

This reverts commit c245a85.

* Removed link logic and added get by resourceid

* Applied PR comments

* Added Resource Group parameter for GET. Removed get by sourceId since we are not using sourceId anymore

* Resolved the merge conflicts with readme.md

* Remove a location parameter since ARM routes it as we are using an tracted resource type

* Created newer version (2018-04-01-preview) for workbook resource type.

* Added Microsoft/Insights/Operations

* Added Microsoft/Insights/Operations

* Corrected the api version.

* Made properties of PATCH operation as not required. Updated the version number to reflect the actual production one.

* Updated Resource properties with the correct fields. Created new definition for PATCH operation since location is not required field

* Update readme file

* Uses plural for operation group name

* Removed x-ms-mutability settings

* Removed the location settings for PATCH

* Added Microsoft.ResourceGraph/SavedQuery resource type

* Fixed various validation errors

* Updated ARG/resources to add a saved query support along with examples

* Updated ARM/resources based on the feedback

* Prepared for Swagger submittion

* Added saved query entry in readme.md

* Changed HTTP status code of 201 to 200 for DELETE

* Removed a name from payload since it is already specified in url

* Removed location since it is a global resource and added eTag

* Moved savedquery.json along with all examples into 2018-09-01-preview folder

* Update saved query metadata in OperationsList.json

* Updated readme.md file to address a version

* Fixed a version for saved query

* Fixed indentation of -input-file in readme

* Renamed Saved => Graph

* Applied PR comments

* Restored extended enum value in ResultKind since we are using it

* Removed the extended enum value again

* Apply ARM API team comments

* Fix examples

* Fix examples

* Added nextLinkName

* add Go SDK build

* make descriptions match

* Added nextLink definition in OperationListResult

* Removed a duplicated OperationListResult and reference to resourcegraph.json

* Added nextLinkName: nextLink for x-ms-pageable in operations

* fix formatting and description

* Removed extended from enum
  • Loading branch information
ericc1103 authored and jhendrixMSFT committed Apr 29, 2019
1 parent 80daf98 commit 1569c26
Show file tree
Hide file tree
Showing 10 changed files with 677 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"title": "Create a saved query",
"description": "Create new saved query resource.",
"parameters": {
"subscriptionId": "024e2271-06fa-46b6-9079-f1ed3c7b070e",
"resourceGroupName": "my-resource-group",
"resourceName": "MyDockerVMs",
"api-version": "2018-09-01-preview",
"properties": {
"tags": {},
"properties": {
"description": "Docker VMs in PROD",
"query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'"
}
}
},
"responses": {
"200": {
"body": {
"id": " /subscriptions/024e2271-06fa-46b6-9079-f1ed3c7b070e/resources/my-resource-group/providers/Microsoft.ResourceGraph/queries/MyDockerVMs",
"name": "MyDockerVMs",
"type": "Microsoft.ResourceGraph/queries",
"eTag": "5d64408e-4ca3-41f7-b725-6914f3012afa",
"tags": {},
"properties": {
"description": "Docker VMs in PROD",
"query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
"resultKind": "basic",
"timeModified": "2019-03-12T13:51:13-07:00"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"title": "Delete a saved query",
"description": "Delete a saved query resource by subid, resource group, and resource name.",
"parameters": {
"subscriptionId": "024e2271-06fa-46b6-9079-f1ed3c7b070e",
"resourceGroupName": "my-resource-group",
"resourceName": "MyDockerVM",
"api-version": "2018-09-01-preview"
},
"responses": {
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"title": "Get a saved query",
"description": "Get a saved query resource by subid, resource group, and resource name.",
"parameters": {
"subscriptionId": "024e2271-06fa-46b6-9079-f1ed3c7b070e",
"resourceGroupName": "my-resource-group",
"resourceName": "MyDockerVMs",
"api-version": "2018-09-01-preview"
},
"responses": {
"200": {
"body": {
"id": " /subscriptions/024e2271-06fa-46b6-9079-f1ed3c7b070e/resources/my-resource-group/providers/Microsoft.ResourceGraph/queries/MyDockerVMs",
"name": "MyDockerVMs",
"type": "Microsoft.ResourceGraph/queries",
"eTag": "5d64408e-4ca3-41f7-b725-6914f3012afa",
"tags": null,
"properties": {
"description": "Docker VMs in PROD",
"query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
"resultKind": "basic",
"timeModified": "2019-03-12T13:51:13-07:00"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"title": "Get a list of saved queries",
"description": "Get a list of saved queries within subscription id and resource group.",
"parameters": {
"subscriptionId": "024e2271-06fa-46b6-9079-f1ed3c7b070e",
"resourceGroupName": "my-resource-group",
"api-version": "2018-09-01-preview"
},
"responses": {
"200": {
"body": {
"nextLink": "https://management.azure.com/subscriptions/subscriptionId/providers/Microsoft.ResourceGraph/queries?api-version=2019-09-01-preview&$top=10&$skiptoken=skiptoken",
"value": [
{
"id": "/subscriptions/87f4f8b0-83c1-4aa9-b318-5237aeb15264/resources/rid1/providers/Microsoft.ResourceGraph/queries/MyDockerVMs",
"name": "MyDockerVMs",
"type": "Microsoft.ResourceGraph/queries",
"tags": {},
"eTag": "5d64408e-4ca3-41f7-b725-6914f3012afa",
"properties": {
"description": "Docker VMs in PROD",
"query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
"resultKind": "basic",
"timeModified": "2019-03-12T13:51:13-07:00"
}
},
{
"id": "/subscriptions/6abb2f31-3e6a-4134-9968-219a596012a0/resources/rid2/providers/Microsoft.ResourceGraph/queries/MyTestVMs",
"name": "MyTestVMs",
"type": "Microsoft.ResourceGraph/queries",
"tags": {},
"eTag": "b0809832-ca62-4133-8f13-0c46580f9db1",
"properties": {
"description": "Test VMs in PROD",
"query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'test'",
"resultKind": "basic",
"timeModified": "2019-03-13T13:51:13-07:00"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"title": "Update a saved query",
"description": "Update the existing saved query resource.",
"parameters": {
"subscriptionId": "024e2271-06fa-46b6-9079-f1ed3c7b070e",
"resourceGroupName": "my-resource-group",
"resourceName": "MyDockerVMs",
"api-version": "2018-09-01-preview",
"body": {
"tags": null,
"eTag": "b0809832-ca62-4133-8f13-0c46580f9db1",
"properties": {
"description": "Modified description",
"query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'"
}
}
},
"responses": {
"200": {
"body": {
"id": " /subscriptions/024e2271-06fa-46b6-9079-f1ed3c7b070e/resources/my-resource-group/providers/Microsoft.ResourceGraph/queries/MyDockerVMs",
"name": "MyDockerVMs",
"type": "Microsoft.ResourceGraph/queries",
"eTag": "73811091-6188-4523-97b7-b5e7134e7fd9",
"tags": null,
"properties": {
"description": "Modified description",
"query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'",
"resultKind": "basic",
"timeModified": "2019-03-14T13:51:13-07:00"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"responses": {
"200": {
"body": {
"nextLink": "https://management.azure.com/subscriptions/subscriptionId/providers/Microsoft.ResourceGraph/?api-version=2019-09-01-preview&$top=10&$skiptoken=skiptoken",
"value": [
{
"name": "Microsoft.ResourceGraph/resources/action",
Expand All @@ -14,6 +15,15 @@
"operation": "Query resources",
"description": "Submits a query on resources within specified subscriptions"
}
},
{
"name": "Microsoft.ResourceGraph/queries/action",
"display": {
"provider": "Microsoft Resource Graph",
"resource": "Queries",
"operation": "CRUD operations of graph queries",
"description": "Create/Update/Retrieve a query within specified subscription and resource group."
}
}
]
}
Expand Down
Loading

0 comments on commit 1569c26

Please sign in to comment.