From 1254f450cf15bfdf01aefc754d284b832821f92f Mon Sep 17 00:00:00 2001 From: "Y. Shen" Date: Mon, 28 Sep 2020 14:11:28 -0700 Subject: [PATCH 01/15] Add missing subscriptionId and resourceGroup --- .../preview/2018-09-01-preview/graphquery.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json index 79dfb25c2b9e..302413d0a624 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json @@ -267,6 +267,16 @@ "readOnly": true, "description": "Azure resource name. This is GUID value. The display name should be assigned within properties field." }, + "subscriptionId": { + "type": "string", + "readOnly": true, + "description": "The Id of the subscription to which the resource belongs." + }, + "resourceGroup": { + "type": "string", + "readOnly": true, + "description": "The name of the resource group this resource belongs to." + }, "location": { "type": "string", "readOnly": false, From c8b1632d931ccdc79a92e883192a2175bd8c43fa Mon Sep 17 00:00:00 2001 From: "Y. Shen" Date: Mon, 5 Oct 2020 10:38:46 -0700 Subject: [PATCH 02/15] Update 2020-04-01-preview --- .../preview/2020-04-01-preview/graphquery.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json index ef9c0ff36b8c..9539836ed680 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json @@ -267,6 +267,16 @@ "readOnly": true, "description": "Azure resource name. This is GUID value. The display name should be assigned within properties field." }, + "subscriptionId": { + "type": "string", + "readOnly": true, + "description": "The Id of the subscription to which the resource belongs." + }, + "resourceGroup": { + "type": "string", + "readOnly": true, + "description": "The name of the resource group this resource belongs to." + }, "location": { "type": "string", "readOnly": true, From e2b86932d41716682fdea9ba32f5c04be86e4bf9 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Wed, 7 Oct 2020 13:24:41 -0700 Subject: [PATCH 03/15] Split 2020-04-01-preview --- .../2020-04-01-preview/resourcechanges.json | 405 ++++++++++++++++++ .../2020-04-01-preview/resourcegraph.json | 298 ------------- .../resourcegraph/resource-manager/readme.md | 1 + 3 files changed, 406 insertions(+), 298 deletions(-) create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json new file mode 100644 index 000000000000..69620ab4d8a2 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json @@ -0,0 +1,405 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Resource Graph", + "description": "Azure Resource Graph API Reference", + "version": "2020-04-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/resourceChanges": { + "post": { + "description": "List changes to a resource for a given time interval.", + "operationId": "ResourceChanges", + "tags": [ + "Changes" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "description": "the parameters for this request for changes.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ResourceChangesRequestParameters" + } + } + ], + "responses": { + "200": { + "description": "A list of changes associated with a resource over a specific time interval.", + "schema": { + "$ref": "#/definitions/ResourceChangeList" + } + }, + "default": { + "description": "A response indicating an error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Basic query": { + "$ref": "./examples/ResourceChanges.json" + }, + "First page query": { + "$ref": "./examples/ResourceChangesFirstPage.json" + }, + "Next page query": { + "$ref": "./examples/ResourceChangesNextPage.json" + } + } + } + }, + "/providers/Microsoft.ResourceGraph/resourceChangeDetails": { + "post": { + "description": "Get resource change details.", + "operationId": "ResourceChangeDetails", + "tags": [ + "Changes" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "description": "The parameters for this request for resource change details.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ResourceChangeDetailsRequestParameters" + } + } + ], + "responses": { + "200": { + "description": "Resource change details.", + "schema": { + "$ref": "#/definitions/ResourceChangeData" + } + }, + "default": { + "description": "A response indicating an error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Basic query": { + "$ref": "./examples/ResourceChangeDetails.json" + } + } + } + } + }, + "definitions": { + "ResourceChangesRequestParameters": { + "description": "The parameters for a specific changes request.", + "type": "object", + "properties": { + "resourceId": { + "description": "Specifies the resource for a changes request.", + "type": "string" + }, + "interval": { + "description": "Specifies the date and time interval for a changes request.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/DateTimeInterval" + } + ] + }, + "$skipToken": { + "description": "Acts as the continuation token for paged responses.", + "type": "string" + }, + "$top": { + "description": "The maximum number of changes the client can accept in a paged response.", + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + }, + "fetchPropertyChanges": { + "description": "The flag if set to true will fetch property changes", + "type": "boolean" + } + }, + "required": [ + "resourceId", + "interval" + ] + }, + "ResourceChangeList": { + "description": "A list of changes associated with a resource over a specific time interval.", + "type": "object", + "properties": { + "changes": { + "description": "The pageable value returned by the operation, i.e. a list of changes to the resource.\n\n- The list is ordered from the most recent changes to the least recent changes.\n- This list will be empty if there were no changes during the requested interval.\n- The `Before` snapshot timestamp value of the oldest change can be outside of the specified time interval.", + "type": "array", + "items": { + "$ref": "#/definitions/ResourceChangeData" + } + }, + "$skipToken": { + "description": "Skip token that encodes the skip information while executing the current request" + } + } + }, + "ResourceChangeData": { + "description": "Data on a specific change, represented by a pair of before and after resource snapshots.", + "type": "object", + "properties": { + "changeId": { + "description": "The change ID. Valid and unique within the specified resource only.", + "type": "string" + }, + "beforeSnapshot": { + "description": "The snapshot before the change.", + "allOf": [ + { + "$ref": "#/definitions/ResourceSnapshotData" + } + ] + }, + "afterSnapshot": { + "description": "The snapshot after the change.", + "allOf": [ + { + "$ref": "#/definitions/ResourceSnapshotData" + } + ] + }, + "changeType": { + "description": "The change type for snapshot. PropertyChanges will be provided in case of Update change type", + "type": "string", + "enum": [ + "Create", + "Update", + "Delete" + ], + "x-ms-enum": { + "name": "ChangeType", + "modelAsString": false + } + }, + "propertyChanges": { + "description": "An array of resource property change", + "type": "array", + "items": { + "$ref": "#/definitions/ResourcePropertyChange" + } + } + }, + "required": [ + "changeId", + "beforeSnapshot", + "afterSnapshot" + ] + }, + "ResourcePropertyChange": { + "description": "The resource property change", + "type": "object", + "properties": { + "propertyName": { + "description": "The property name", + "type": "string" + }, + "beforeValue": { + "description": "The property value in before snapshot", + "type": "string" + }, + "afterValue": { + "description": "The property value in after snapshot", + "type": "string" + }, + "changeCategory": { + "description": "The change category.", + "type": "string", + "enum": [ + "User", + "System" + ], + "x-ms-enum": { + "name": "ChangeCategory", + "modelAsString": false + } + }, + "propertyChangeType": { + "description": "The property change Type", + "type": "string", + "enum": [ + "Insert", + "Update", + "Remove" + ], + "x-ms-enum": { + "name": "PropertyChangeType", + "modelAsString": false + } + } + }, + "required": [ + "propertyName", + "changeCategory", + "propertyChangeType" + ] + }, + "ResourceSnapshotData": { + "description": "Data on a specific resource snapshot.", + "type": "object", + "properties": { + "timestamp": { + "description": "The time when the snapshot was created.\nThe snapshot timestamp provides an approximation as to when a modification to a resource was detected. There can be a difference between the actual modification time and the detection time. This is due to differences in how operations that modify a resource are processed, versus how operation that record resource snapshots are processed.", + "type": "string", + "format": "date-time" + }, + "content": { + "description": "The resource snapshot content (in resourceChangeDetails response only).", + "type": "object" + } + }, + "required": [ + "timestamp" + ] + }, + "ResourceChangeDetailsRequestParameters": { + "description": "The parameters for a specific change details request.", + "type": "object", + "properties": { + "resourceId": { + "description": "Specifies the resource for a change details request.", + "type": "string" + }, + "changeId": { + "description": "Specifies the change ID.", + "type": "string" + } + }, + "required": [ + "resourceId", + "changeId" + ] + }, + "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": { + "properties": { + "error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "readOnly": true, + "type": "string", + "description": "The error code." + }, + "message": { + "readOnly": true, + "type": "string", + "description": "The error message." + }, + "target": { + "readOnly": true, + "type": "string", + "description": "The error target." + }, + "details": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResponse" + }, + "description": "The error details." + }, + "additionalInfo": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorAdditionalInfo" + }, + "description": "The error additional info." + } + } + } + }, + "description": "The resource management error response." + }, + "ErrorAdditionalInfo": { + "properties": { + "type": { + "readOnly": true, + "type": "string", + "description": "The additional info type." + }, + "info": { + "readOnly": true, + "type": "object", + "description": "The additional info." + } + }, + "description": "The resource management error additional info." + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Api Version." + } + } +} \ No newline at end of file diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json index 0fbf96dc2401..ded0a07c8400 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json @@ -110,96 +110,6 @@ } } }, - "/providers/Microsoft.ResourceGraph/resourceChanges": { - "post": { - "description": "List changes to a resource for a given time interval.", - "operationId": "ResourceChanges", - "tags": [ - "Changes" - ], - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "parameters", - "description": "the parameters for this request for changes.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ResourceChangesRequestParameters" - } - } - ], - "responses": { - "200": { - "description": "A list of changes associated with a resource over a specific time interval.", - "schema": { - "$ref": "#/definitions/ResourceChangeList" - } - }, - "default": { - "description": "A response indicating an error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Basic query": { - "$ref": "./examples/ResourceChanges.json" - }, - "First page query": { - "$ref": "./examples/ResourceChangesFirstPage.json" - }, - "Next page query": { - "$ref": "./examples/ResourceChangesNextPage.json" - } - } - } - }, - "/providers/Microsoft.ResourceGraph/resourceChangeDetails": { - "post": { - "description": "Get resource change details.", - "operationId": "ResourceChangeDetails", - "tags": [ - "Changes" - ], - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "parameters", - "description": "The parameters for this request for resource change details.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ResourceChangeDetailsRequestParameters" - } - } - ], - "responses": { - "200": { - "description": "Resource change details.", - "schema": { - "$ref": "#/definitions/ResourceChangeData" - } - }, - "default": { - "description": "A response indicating an error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Basic query": { - "$ref": "./examples/ResourceChangeDetails.json" - } - } - } - }, "/providers/Microsoft.ResourceGraph/operations": { "get": { "tags": [ @@ -540,214 +450,6 @@ } ] }, - "ResourceChangesRequestParameters": { - "description": "The parameters for a specific changes request.", - "type": "object", - "properties": { - "resourceId": { - "description": "Specifies the resource for a changes request.", - "type": "string" - }, - "interval": { - "description": "Specifies the date and time interval for a changes request.", - "allOf": [ - { - "$ref": "#/definitions/DateTimeInterval" - } - ] - }, - "$skipToken": { - "description": "Acts as the continuation token for paged responses.", - "type": "string" - }, - "$top": { - "description": "The maximum number of changes the client can accept in a paged response.", - "type": "integer", - "format": "int32", - "minimum": 1, - "maximum": 1000 - }, - "fetchPropertyChanges": { - "description": "The flag if set to true will fetch property changes", - "type": "boolean" - } - }, - "required": [ - "resourceId", - "interval" - ] - }, - "ResourceChangeList": { - "description": "A list of changes associated with a resource over a specific time interval.", - "type": "object", - "properties": { - "changes": { - "description": "The pageable value returned by the operation, i.e. a list of changes to the resource.\n\n- The list is ordered from the most recent changes to the least recent changes.\n- This list will be empty if there were no changes during the requested interval.\n- The `Before` snapshot timestamp value of the oldest change can be outside of the specified time interval.", - "type": "array", - "items": { - "$ref": "#/definitions/ResourceChangeData" - } - }, - "$skipToken": { - "description": "Skip token that encodes the skip information while executing the current request" - } - } - }, - "ResourceChangeData": { - "description": "Data on a specific change, represented by a pair of before and after resource snapshots.", - "type": "object", - "properties": { - "changeId": { - "description": "The change ID. Valid and unique within the specified resource only.", - "type": "string" - }, - "beforeSnapshot": { - "description": "The snapshot before the change.", - "allOf": [ - { - "$ref": "#/definitions/ResourceSnapshotData" - } - ] - }, - "afterSnapshot": { - "description": "The snapshot after the change.", - "allOf": [ - { - "$ref": "#/definitions/ResourceSnapshotData" - } - ] - }, - "changeType": { - "description": "The change type for snapshot. PropertyChanges will be provided in case of Update change type", - "type": "string", - "enum": [ - "Create", - "Update", - "Delete" - ], - "x-ms-enum": { - "name": "ChangeType", - "modelAsString": false - } - }, - "propertyChanges": { - "description": "An array of resource property change", - "type": "array", - "items": { - "$ref": "#/definitions/ResourcePropertyChange" - } - } - }, - "required": [ - "changeId", - "beforeSnapshot", - "afterSnapshot" - ] - }, - "ResourcePropertyChange": { - "description": "The resource property change", - "type": "object", - "properties": { - "propertyName": { - "description": "The property name", - "type": "string" - }, - "beforeValue": { - "description": "The property value in before snapshot", - "type": "string" - }, - "afterValue": { - "description": "The property value in after snapshot", - "type": "string" - }, - "changeCategory": { - "description": "The change category.", - "type": "string", - "enum": [ - "User", - "System" - ], - "x-ms-enum": { - "name": "ChangeCategory", - "modelAsString": false - } - }, - "propertyChangeType": { - "description": "The property change Type", - "type": "string", - "enum": [ - "Insert", - "Update", - "Remove" - ], - "x-ms-enum": { - "name": "PropertyChangeType", - "modelAsString": false - } - } - }, - "required": [ - "propertyName", - "changeCategory", - "propertyChangeType" - ] - }, - "ResourceSnapshotData": { - "description": "Data on a specific resource snapshot.", - "type": "object", - "properties": { - "timestamp": { - "description": "The time when the snapshot was created.\nThe snapshot timestamp provides an approximation as to when a modification to a resource was detected. There can be a difference between the actual modification time and the detection time. This is due to differences in how operations that modify a resource are processed, versus how operation that record resource snapshots are processed.", - "type": "string", - "format": "date-time" - }, - "content": { - "description": "The resource snapshot content (in resourceChangeDetails response only).", - "type": "object" - } - }, - "required": [ - "timestamp" - ] - }, - "ResourceChangeDetailsRequestParameters": { - "description": "The parameters for a specific change details request.", - "type": "object", - "properties": { - "resourceId": { - "description": "Specifies the resource for a change details request.", - "type": "string" - }, - "changeId": { - "description": "Specifies the change ID.", - "type": "string" - } - }, - "required": [ - "resourceId", - "changeId" - ] - }, - "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", diff --git a/specification/resourcegraph/resource-manager/readme.md b/specification/resourcegraph/resource-manager/readme.md index e0c9a9cb572f..ff97016e617b 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -48,6 +48,7 @@ These settings apply only when `--tag=package-preview-2020-04` is specified on t ``` yaml $(tag) == 'package-preview-2020-04' input-file: - Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json + - Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json ``` ### Tag: package-2019-04 From cc35b3d5b6db84f4971b845713472eda3de73863 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Wed, 14 Oct 2020 13:00:30 -0700 Subject: [PATCH 04/15] Reverting changes for subscriptionId/resourceGroup; Fix casing for etag field. --- .../preview/2018-09-01-preview/graphquery.json | 12 +----------- .../preview/2020-04-01-preview/graphquery.json | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json index 302413d0a624..765246ec74b2 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json @@ -267,16 +267,6 @@ "readOnly": true, "description": "Azure resource name. This is GUID value. The display name should be assigned within properties field." }, - "subscriptionId": { - "type": "string", - "readOnly": true, - "description": "The Id of the subscription to which the resource belongs." - }, - "resourceGroup": { - "type": "string", - "readOnly": true, - "description": "The name of the resource group this resource belongs to." - }, "location": { "type": "string", "readOnly": false, @@ -287,7 +277,7 @@ "readOnly": true, "description": "Azure resource type" }, - "eTag": { + "etag": { "type": "string", "description": "This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict." }, diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json index 9539836ed680..24fabc089a55 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json @@ -267,16 +267,6 @@ "readOnly": true, "description": "Azure resource name. This is GUID value. The display name should be assigned within properties field." }, - "subscriptionId": { - "type": "string", - "readOnly": true, - "description": "The Id of the subscription to which the resource belongs." - }, - "resourceGroup": { - "type": "string", - "readOnly": true, - "description": "The name of the resource group this resource belongs to." - }, "location": { "type": "string", "readOnly": true, @@ -332,7 +322,7 @@ "readOnly": true, "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/systemData" }, - "eTag": { + "etag": { "type": "string", "description": "This will be used to handle Optimistic Concurrency." } From 10dada2aca7e0b67a691ff39a3d3f23f2f695d61 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Wed, 18 Nov 2020 11:58:34 -0800 Subject: [PATCH 05/15] Adding missing ResourcesHistory API to swagger --- .../2020-04-01-preview/resourceshistory.json | 156 ++++++++++++++++++ .../resourcegraph/resource-manager/readme.md | 1 + 2 files changed, 157 insertions(+) create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json new file mode 100644 index 000000000000..69bdf9f99ac9 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json @@ -0,0 +1,156 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Resource Graph", + "description": "Azure Resource Graph API Reference", + "version": "2020-04-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": { + "/partner/microsoft.resourcegraph/ResourcesHistory": { + "post": { + "tags": [ + "Acis::OperationGroup::Partner", + "Acis::Claim::ARGPartner-PlatformServiceAdministrator" + ], + "operationId": "PartnerResourceHistory_ResourcesHistory", + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.ResourcesHistoryRequest" + } + }, + { + "name": "commandName", + "in": "query", + "description": "Optional command name header for tagging unique query scenarios. This is equivalent to ARM header x-ms-command-name.", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + } + } + } + } + }, + "definitions": { + "Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.ResourcesHistoryRequest": { + "type": "object", + "properties": { + "subscriptions": { + "uniqueItems": false, + "type": "array", + "items": { + "type": "string" + } + }, + "query": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.ResourcesHistoryRequestOptions" + }, + "managementGroupId": { + "type": "string" + } + } + }, + "Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.ResourcesHistoryRequestOptions": { + "type": "object", + "properties": { + "interval": { + "$ref": "#/definitions/Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.DateTimeInterval" + }, + "$top": { + "format": "int32", + "type": "integer" + }, + "$skip": { + "format": "int32", + "type": "integer" + }, + "$skipToken": { + "type": "string" + }, + "resultFormat": { + "enum": [ + "table", + "objectArray" + ], + "type": "string" + } + } + }, + "Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.DateTimeInterval": { + "type": "object", + "properties": { + "start": { + "format": "date-time", + "type": "string" + }, + "end": { + "format": "date-time", + "type": "string" + } + } + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + } +} \ No newline at end of file diff --git a/specification/resourcegraph/resource-manager/readme.md b/specification/resourcegraph/resource-manager/readme.md index ff97016e617b..c016a7489782 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -49,6 +49,7 @@ These settings apply only when `--tag=package-preview-2020-04` is specified on t input-file: - Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json - Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json + - Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json ``` ### Tag: package-2019-04 From 7ba5e89db033ebebf8545d95a0111973a31f29f7 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Wed, 18 Nov 2020 13:43:51 -0800 Subject: [PATCH 06/15] Fix API definition; Add an example --- .../examples/ResourcesHistoryGet.json | 61 ++++++++++++ .../2020-04-01-preview/resourceshistory.json | 93 ++++++++++++++----- 2 files changed, 133 insertions(+), 21 deletions(-) create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/ResourcesHistoryGet.json diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/ResourcesHistoryGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/ResourcesHistoryGet.json new file mode 100644 index 000000000000..e07446a76ae0 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/ResourcesHistoryGet.json @@ -0,0 +1,61 @@ +{ + "title": "Resource History Query", + "description": "A resource history query.", + "parameters": { + "api-version": "2020-04-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/preview/2020-04-01-preview/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json index 69bdf9f99ac9..bca1280dc832 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json @@ -34,22 +34,12 @@ } }, "paths": { - "/partner/microsoft.resourcegraph/ResourcesHistory": { + "/providers/Microsoft.ResourceGraph/ResourcesHistory": { "post": { + "description": "List all snapshots of a resource for a given time interval.", + "operationId": "ResourcesHistory", "tags": [ - "Acis::OperationGroup::Partner", - "Acis::Claim::ARGPartner-PlatformServiceAdministrator" - ], - "operationId": "PartnerResourceHistory_ResourcesHistory", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "application/json", - "text/json" + "History" ], "parameters": [ { @@ -60,13 +50,6 @@ "$ref": "#/definitions/Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.ResourcesHistoryRequest" } }, - { - "name": "commandName", - "in": "query", - "description": "Optional command name header for tagging unique query scenarios. This is equivalent to ARM header x-ms-command-name.", - "required": false, - "type": "string" - }, { "$ref": "#/parameters/ApiVersionParameter" } @@ -77,6 +60,17 @@ "schema": { "type": "object" } + }, + "default": { + "description": "A response indicating an error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Resource History Query": { + "$ref": "./examples/ResourcesHistoryGet.json" } } } @@ -142,6 +136,63 @@ "type": "string" } } + }, + "ErrorResponse": { + "properties": { + "error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "readOnly": true, + "type": "string", + "description": "The error code." + }, + "message": { + "readOnly": true, + "type": "string", + "description": "The error message." + }, + "target": { + "readOnly": true, + "type": "string", + "description": "The error target." + }, + "details": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResponse" + }, + "description": "The error details." + }, + "additionalInfo": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorAdditionalInfo" + }, + "description": "The error additional info." + } + } + } + }, + "description": "The resource management error response." + }, + "ErrorAdditionalInfo": { + "properties": { + "type": { + "readOnly": true, + "type": "string", + "description": "The additional info type." + }, + "info": { + "readOnly": true, + "type": "object", + "description": "The additional info." + } + }, + "description": "The resource management error additional info." } }, "parameters": { From 64a43adf88cdab489ae7b3aa774e9a9e08509171 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Mon, 30 Nov 2020 14:40:09 -0800 Subject: [PATCH 07/15] Fix multiple issues 1) Rename PropertyChangeType to ChangeType; 2) Add resourceId ResourceChangeData; 3) Add snapshotId to ResourceSnapshotData; 4) Fix model name in resourceshistory.json --- .../2020-04-01-preview/resourcechanges.json | 14 +++++++++++--- .../2020-04-01-preview/resourceshistory.json | 12 ++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json index 69620ab4d8a2..c924a77c2b99 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json @@ -184,6 +184,10 @@ "description": "Data on a specific change, represented by a pair of before and after resource snapshots.", "type": "object", "properties": { + "resourceId": { + "description": "The ID of the resource", + "type": "string" + }, "changeId": { "description": "The change ID. Valid and unique within the specified resource only.", "type": "string" @@ -259,7 +263,7 @@ "modelAsString": false } }, - "propertyChangeType": { + "changeType": { "description": "The property change Type", "type": "string", "enum": [ @@ -268,7 +272,7 @@ "Remove" ], "x-ms-enum": { - "name": "PropertyChangeType", + "name": "ChangeType", "modelAsString": false } } @@ -276,13 +280,17 @@ "required": [ "propertyName", "changeCategory", - "propertyChangeType" + "changeType" ] }, "ResourceSnapshotData": { "description": "Data on a specific resource snapshot.", "type": "object", "properties": { + "snapshotId": { + "description": "The ID of the snapshot.", + "type": "string" + }, "timestamp": { "description": "The time when the snapshot was created.\nThe snapshot timestamp provides an approximation as to when a modification to a resource was detected. There can be a difference between the actual modification time and the detection time. This is due to differences in how operations that modify a resource are processed, versus how operation that record resource snapshots are processed.", "type": "string", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json index bca1280dc832..a4019ee2635f 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json @@ -47,7 +47,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.ResourcesHistoryRequest" + "$ref": "#/definitions/ResourcesHistoryRequest" } }, { @@ -77,7 +77,7 @@ } }, "definitions": { - "Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.ResourcesHistoryRequest": { + "ResourcesHistoryRequest": { "type": "object", "properties": { "subscriptions": { @@ -91,18 +91,18 @@ "type": "string" }, "options": { - "$ref": "#/definitions/Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.ResourcesHistoryRequestOptions" + "$ref": "#/definitions/ResourcesHistoryRequestOptions" }, "managementGroupId": { "type": "string" } } }, - "Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.ResourcesHistoryRequestOptions": { + "ResourcesHistoryRequestOptions": { "type": "object", "properties": { "interval": { - "$ref": "#/definitions/Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.DateTimeInterval" + "$ref": "#/definitions/DateTimeInterval" }, "$top": { "format": "int32", @@ -124,7 +124,7 @@ } } }, - "Microsoft.WindowsAzure.Governance.ResourcesCache.QueryApiService.Contracts.External.ResourceHistory.DateTimeInterval": { + "DateTimeInterval": { "type": "object", "properties": { "start": { From b715ff6a2cbece6380bb7b605d79c49139d4a451 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Mon, 30 Nov 2020 15:22:40 -0800 Subject: [PATCH 08/15] Fix linter/model issues --- .../2020-04-01-preview/examples/GraphQueryAdd.json | 2 +- .../2020-04-01-preview/examples/GraphQueryGet.json | 2 +- .../2020-04-01-preview/examples/GraphQueryList.json | 4 ++-- .../2020-04-01-preview/examples/GraphQueryUpdate.json | 4 ++-- .../examples/ResourcesHistoryGet.json | 3 +-- .../preview/2020-04-01-preview/resourcechanges.json | 10 +++++----- .../preview/2020-04-01-preview/resourceshistory.json | 6 +++--- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryAdd.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryAdd.json index 811b67dab4a6..d420aa5c85bb 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryAdd.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryAdd.json @@ -20,7 +20,7 @@ "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", + "etag": "5d64408e-4ca3-41f7-b725-6914f3012afa", "tags": {}, "properties": { "description": "Docker VMs in PROD", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryGet.json index 70a9b50cfd52..0ca3040a9ecc 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryGet.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryGet.json @@ -13,7 +13,7 @@ "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", + "etag": "5d64408e-4ca3-41f7-b725-6914f3012afa", "tags": null, "properties": { "description": "Docker VMs in PROD", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryList.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryList.json index 451ee110ad70..de63cd60cf63 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryList.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryList.json @@ -16,7 +16,7 @@ "name": "MyDockerVMs", "type": "Microsoft.ResourceGraph/queries", "tags": {}, - "eTag": "5d64408e-4ca3-41f7-b725-6914f3012afa", + "etag": "5d64408e-4ca3-41f7-b725-6914f3012afa", "properties": { "description": "Docker VMs in PROD", "query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'", @@ -37,7 +37,7 @@ "name": "MyTestVMs", "type": "Microsoft.ResourceGraph/queries", "tags": {}, - "eTag": "b0809832-ca62-4133-8f13-0c46580f9db1", + "etag": "b0809832-ca62-4133-8f13-0c46580f9db1", "properties": { "description": "Test VMs in PROD", "query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'test'", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryUpdate.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryUpdate.json index 4dbff41392a3..48b51edab80a 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryUpdate.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/GraphQueryUpdate.json @@ -8,7 +8,7 @@ "api-version": "2020-04-01-preview", "body": { "tags": null, - "eTag": "b0809832-ca62-4133-8f13-0c46580f9db1", + "etag": "b0809832-ca62-4133-8f13-0c46580f9db1", "properties": { "description": "Modified description", "query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'" @@ -21,7 +21,7 @@ "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", + "etag": "73811091-6188-4523-97b7-b5e7134e7fd9", "tags": null, "properties": { "description": "Modified description", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/ResourcesHistoryGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/ResourcesHistoryGet.json index e07446a76ae0..5172d1253b90 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/ResourcesHistoryGet.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/ResourcesHistoryGet.json @@ -20,8 +20,7 @@ "200": { "body": { "count": 2, - "snapshots": - { + "snapshots": { "columns": [ { "name": "id", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json index c924a77c2b99..ba83da54e929 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json @@ -184,10 +184,10 @@ "description": "Data on a specific change, represented by a pair of before and after resource snapshots.", "type": "object", "properties": { - "resourceId": { + "resourceId": { "description": "The ID of the resource", "type": "string" - }, + }, "changeId": { "description": "The change ID. Valid and unique within the specified resource only.", "type": "string" @@ -287,10 +287,10 @@ "description": "Data on a specific resource snapshot.", "type": "object", "properties": { - "snapshotId": { + "snapshotId": { "description": "The ID of the snapshot.", "type": "string" - }, + }, "timestamp": { "description": "The time when the snapshot was created.\nThe snapshot timestamp provides an approximation as to when a modification to a resource was detected. There can be a difference between the actual modification time and the detection time. This is due to differences in how operations that modify a resource are processed, versus how operation that record resource snapshots are processed.", "type": "string", @@ -410,4 +410,4 @@ "description": "Api Version." } } -} \ No newline at end of file +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json index a4019ee2635f..98374eda6c34 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json @@ -34,12 +34,12 @@ } }, "paths": { - "/providers/Microsoft.ResourceGraph/ResourcesHistory": { + "/providers/Microsoft.ResourceGraph/resourcesHistory": { "post": { "description": "List all snapshots of a resource for a given time interval.", "operationId": "ResourcesHistory", "tags": [ - "History" + "History" ], "parameters": [ { @@ -204,4 +204,4 @@ "description": "Client Api Version." } } -} \ No newline at end of file +} From 6824bd52bc463546ac9aa36941423419de5f7f39 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Mon, 30 Nov 2020 15:48:42 -0800 Subject: [PATCH 09/15] Fix etag casing more places --- .../preview/2018-09-01-preview/examples/GraphQueryAdd.json | 2 +- .../preview/2018-09-01-preview/examples/GraphQueryGet.json | 2 +- .../preview/2018-09-01-preview/examples/GraphQueryList.json | 4 ++-- .../preview/2018-09-01-preview/examples/GraphQueryUpdate.json | 4 ++-- .../preview/2018-09-01-preview/graphquery.json | 2 +- .../preview/2020-04-01-preview/graphquery.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryAdd.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryAdd.json index 0185d29943a7..3fa4a5c8902f 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryAdd.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryAdd.json @@ -20,7 +20,7 @@ "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", + "etag": "5d64408e-4ca3-41f7-b725-6914f3012afa", "tags": {}, "properties": { "description": "Docker VMs in PROD", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryGet.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryGet.json index cfcca047862c..790f59a66ba4 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryGet.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryGet.json @@ -13,7 +13,7 @@ "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", + "etag": "5d64408e-4ca3-41f7-b725-6914f3012afa", "tags": null, "properties": { "description": "Docker VMs in PROD", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryList.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryList.json index 08e276d0a25a..2992adfb7c60 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryList.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryList.json @@ -16,7 +16,7 @@ "name": "MyDockerVMs", "type": "Microsoft.ResourceGraph/queries", "tags": {}, - "eTag": "5d64408e-4ca3-41f7-b725-6914f3012afa", + "etag": "5d64408e-4ca3-41f7-b725-6914f3012afa", "properties": { "description": "Docker VMs in PROD", "query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'", @@ -29,7 +29,7 @@ "name": "MyTestVMs", "type": "Microsoft.ResourceGraph/queries", "tags": {}, - "eTag": "b0809832-ca62-4133-8f13-0c46580f9db1", + "etag": "b0809832-ca62-4133-8f13-0c46580f9db1", "properties": { "description": "Test VMs in PROD", "query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'test'", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryUpdate.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryUpdate.json index ac56f403fe66..31211c3b027e 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryUpdate.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/GraphQueryUpdate.json @@ -8,7 +8,7 @@ "api-version": "2018-09-01-preview", "body": { "tags": null, - "eTag": "b0809832-ca62-4133-8f13-0c46580f9db1", + "etag": "b0809832-ca62-4133-8f13-0c46580f9db1", "properties": { "description": "Modified description", "query": "where isnotnull(tags['Prod']) and properties.extensions[0].Name == 'docker'" @@ -21,7 +21,7 @@ "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", + "etag": "73811091-6188-4523-97b7-b5e7134e7fd9", "tags": null, "properties": { "description": "Modified description", diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json index 765246ec74b2..b2628e714677 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/graphquery.json @@ -367,7 +367,7 @@ }, "description": "Resource tags" }, - "eTag": { + "etag": { "type": "string", "description": "This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict." }, diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json index 24fabc089a55..24aa7ca2d916 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json @@ -371,7 +371,7 @@ }, "description": "Resource tags" }, - "eTag": { + "etag": { "type": "string", "description": "This will be used to handle Optimistic Concurrency. If not present, it will always overwrite the existing resource without checking conflict." }, From ef6e44865440f4a70f7110363d10d40b423f9896 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Mon, 14 Dec 2020 16:50:41 -0800 Subject: [PATCH 10/15] Fix ErrorResponse modeling in resourcechanges.json and resourcehistory.json --- .../2020-04-01-preview/resourcechanges.json | 92 ++++++++++--------- .../2020-04-01-preview/resourceshistory.json | 92 ++++++++++--------- 2 files changed, 96 insertions(+), 88 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json index ba83da54e929..1f6175e61c00 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json @@ -344,61 +344,65 @@ ] }, "ErrorResponse": { + "title": "Error response.", + "type": "object", + "description": "An error response from the API.", "properties": { "error": { - "type": "object", - "description": "The error object.", - "properties": { - "code": { - "readOnly": true, - "type": "string", - "description": "The error code." - }, - "message": { - "readOnly": true, - "type": "string", - "description": "The error message." - }, - "target": { - "readOnly": true, - "type": "string", - "description": "The error target." - }, - "details": { - "readOnly": true, - "type": "array", - "items": { - "$ref": "#/definitions/ErrorResponse" - }, - "description": "The error details." - }, - "additionalInfo": { - "readOnly": true, - "type": "array", - "items": { - "$ref": "#/definitions/ErrorAdditionalInfo" - }, - "description": "The error additional info." - } + "$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" } } }, - "description": "The resource management error response." + "required": [ + "code", + "message" + ] }, - "ErrorAdditionalInfo": { + "ErrorDetails": { + "title": "Error details.", + "type": "object", "properties": { - "type": { - "readOnly": true, + "code": { "type": "string", - "description": "The additional info type." + "description": "Error code identifying the specific error." }, - "info": { - "readOnly": true, - "type": "object", - "description": "The additional info." + "message": { + "type": "string", + "description": "A human readable error message." } }, - "description": "The resource management error additional info." + "additionalProperties": { + "type": "object" + }, + "required": [ + "code", + "message" + ] } }, "parameters": { diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json index 98374eda6c34..6a8189d66fb5 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json @@ -138,61 +138,65 @@ } }, "ErrorResponse": { + "title": "Error response.", + "type": "object", + "description": "An error response from the API.", "properties": { "error": { - "type": "object", - "description": "The error object.", - "properties": { - "code": { - "readOnly": true, - "type": "string", - "description": "The error code." - }, - "message": { - "readOnly": true, - "type": "string", - "description": "The error message." - }, - "target": { - "readOnly": true, - "type": "string", - "description": "The error target." - }, - "details": { - "readOnly": true, - "type": "array", - "items": { - "$ref": "#/definitions/ErrorResponse" - }, - "description": "The error details." - }, - "additionalInfo": { - "readOnly": true, - "type": "array", - "items": { - "$ref": "#/definitions/ErrorAdditionalInfo" - }, - "description": "The error additional info." - } + "$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" } } }, - "description": "The resource management error response." + "required": [ + "code", + "message" + ] }, - "ErrorAdditionalInfo": { + "ErrorDetails": { + "title": "Error details.", + "type": "object", "properties": { - "type": { - "readOnly": true, + "code": { "type": "string", - "description": "The additional info type." + "description": "Error code identifying the specific error." }, - "info": { - "readOnly": true, - "type": "object", - "description": "The additional info." + "message": { + "type": "string", + "description": "A human readable error message." } }, - "description": "The resource management error additional info." + "additionalProperties": { + "type": "object" + }, + "required": [ + "code", + "message" + ] } }, "parameters": { From 42c6436e2d6eca1c49eaad817bf1979b0061bfd2 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Mon, 14 Dec 2020 16:59:05 -0800 Subject: [PATCH 11/15] Add default response for Operations API --- .../preview/2020-04-01-preview/resourcegraph.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json index ded0a07c8400..99a1dc03ca9b 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json @@ -133,6 +133,12 @@ "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": { From 87c3af19d3ad8c4461577707c3ff285e0f2053b4 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Tue, 5 Jan 2021 10:22:21 -0800 Subject: [PATCH 12/15] Revert renaming of PropertyChangeType --- .../preview/2020-04-01-preview/resourcechanges.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json index 1f6175e61c00..756b26f212ad 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json @@ -263,7 +263,7 @@ "modelAsString": false } }, - "changeType": { + "propertyChangeType": { "description": "The property change Type", "type": "string", "enum": [ @@ -272,7 +272,7 @@ "Remove" ], "x-ms-enum": { - "name": "ChangeType", + "name": "PropertyChangeType", "modelAsString": false } } @@ -280,7 +280,7 @@ "required": [ "propertyName", "changeCategory", - "changeType" + "propertyChangeType" ] }, "ResourceSnapshotData": { From 5bfd7fbd9492abc96076a459f7ca914e44bffc9a Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Tue, 5 Jan 2021 11:24:58 -0800 Subject: [PATCH 13/15] Add changeType to swagger --- .../preview/2020-04-01-preview/resourcechanges.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json index 756b26f212ad..5728f043f105 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json @@ -275,6 +275,19 @@ "name": "PropertyChangeType", "modelAsString": false } + }, + "changeType": { + "description": "The property change Type. This is an alias to the propertyChangeType property.", + "type": "string", + "enum": [ + "Insert", + "Update", + "Remove" + ], + "x-ms-enum": { + "name": "ChangeType", + "modelAsString": false + } } }, "required": [ From 7e5968498cde97ab61e1ca23e93b265233d70ec3 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Tue, 5 Jan 2021 12:17:42 -0800 Subject: [PATCH 14/15] Revert "Add changeType to swagger" This reverts commit 5bfd7fbd9492abc96076a459f7ca914e44bffc9a. --- .../preview/2020-04-01-preview/resourcechanges.json | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json index 5728f043f105..756b26f212ad 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json @@ -275,19 +275,6 @@ "name": "PropertyChangeType", "modelAsString": false } - }, - "changeType": { - "description": "The property change Type. This is an alias to the propertyChangeType property.", - "type": "string", - "enum": [ - "Insert", - "Update", - "Remove" - ], - "x-ms-enum": { - "name": "ChangeType", - "modelAsString": false - } } }, "required": [ From 3deaa2802fb8de4a74328fcd7db0cb7c41fce3e5 Mon Sep 17 00:00:00 2001 From: Youke Shen Date: Mon, 11 Jan 2021 11:10:00 -0800 Subject: [PATCH 15/15] Fix swagger for resourcesHistory --- .../2020-04-01-preview/resourceshistory.json | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json index 6a8189d66fb5..4602093d8c9f 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json @@ -125,17 +125,24 @@ } }, "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": { - "format": "date-time", - "type": "string" + "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": { - "format": "date-time", - "type": "string" + "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.", @@ -205,7 +212,7 @@ "in": "query", "required": true, "type": "string", - "description": "Client Api Version." + "description": "Api Version." } } }