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 79dfb25c2b9e..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 @@ -277,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." }, @@ -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/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 new file mode 100644 index 000000000000..5172d1253b90 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/examples/ResourcesHistoryGet.json @@ -0,0 +1,60 @@ +{ + "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/graphquery.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/graphquery.json index ef9c0ff36b8c..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 @@ -322,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." } @@ -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." }, 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..756b26f212ad --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcechanges.json @@ -0,0 +1,417 @@ +{ + "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": { + "resourceId": { + "description": "The ID of the resource", + "type": "string" + }, + "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": { + "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", + "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", + "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/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..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 @@ -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": [ @@ -223,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": { @@ -540,214 +456,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/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..4602093d8c9f --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json @@ -0,0 +1,218 @@ +{ + "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/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" + } + }, + { + "$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" + } + } + } + } + }, + "definitions": { + "ResourcesHistoryRequest": { + "type": "object", + "properties": { + "subscriptions": { + "uniqueItems": false, + "type": "array", + "items": { + "type": "string" + } + }, + "query": { + "type": "string" + }, + "options": { + "$ref": "#/definitions/ResourcesHistoryRequestOptions" + }, + "managementGroupId": { + "type": "string" + } + } + }, + "ResourcesHistoryRequestOptions": { + "type": "object", + "properties": { + "interval": { + "$ref": "#/definitions/DateTimeInterval" + }, + "$top": { + "format": "int32", + "type": "integer" + }, + "$skip": { + "format": "int32", + "type": "integer" + }, + "$skipToken": { + "type": "string" + }, + "resultFormat": { + "enum": [ + "table", + "objectArray" + ], + "type": "string" + } + } + }, + "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.md b/specification/resourcegraph/resource-manager/readme.md index e0c9a9cb572f..c016a7489782 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -48,6 +48,8 @@ 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 + - Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json ``` ### Tag: package-2019-04