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, 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, 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