Skip to content

Commit

Permalink
Added Stable Version changes for Saved Query API (Azure#29094)
Browse files Browse the repository at this point in the history
* Added saved query to a stable version

* Fixed the lint errors

* Fixed the semantic and lint errors

* Added example for 201

* Removued unused example

* Prettier check updated

* Added previous stable version api's as well

* added changes for previous stable version for graph query

* Added top level subscription id changes and added a new api which will fetch all the saved queries from subscription id

* Added swagger prettier checks
  • Loading branch information
srinivaskmsft authored and markcowl committed Jun 11, 2024
1 parent 5ad210f commit f00bed5
Show file tree
Hide file tree
Showing 19 changed files with 2,091 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"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": "2019-04-01",
"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"
}
}
},
"201": {
"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": "2019-04-01"
},
"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": "2019-04-01"
},
"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": "2019-04-01"
},
"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": "2019-04-01",
"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"
}
}
}
}
}
Loading

0 comments on commit f00bed5

Please sign in to comment.