diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChangeDetails.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChangeDetails.json new file mode 100644 index 000000000000..b7311949aeaa --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChangeDetails.json @@ -0,0 +1,119 @@ +{ + "title": "Resource Change Details Query", + "description": "A resource change details query.", + "parameters": { + "api-version": "2020-09-01-preview", + "parameters": { + "resourceIds": [ + "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount" + ], + "changeIds": [ + "53dc0515-b86b-4bc2-979b-e4694ab4a556" + ] + } + }, + "responses": { + "200": { + "body": [ + { + "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "changeId": "53dc0515-b86b-4bc2-979b-e4694ab4a556", + "beforeSnapshot": { + "timestamp": "2018-10-31T01:32:05.993Z", + "content": { + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "kind": "Storage", + "id": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "name": "mystorageaccount", + "type": "Microsoft.Storage/storageAccounts", + "location": "westus", + "tags": {}, + "properties": { + "networkAcls": { + "bypass": "AzureServices", + "virtualNetworkRules": [], + "ipRules": [], + "defaultAction": "Allow" + }, + "supportsHttpsTrafficOnly": false, + "encryption": { + "services": { + "file": { + "enabled": true, + "lastEnabledTime": "2018-07-27T18:37:21.8333895Z" + }, + "blob": { + "enabled": true, + "lastEnabledTime": "2018-07-27T18:37:21.8333895Z" + } + }, + "keySource": "Microsoft.Storage" + }, + "provisioningState": "Succeeded", + "creationTime": "2018-07-27T18:37:21.7708872Z", + "primaryEndpoints": { + "blob": "https://mystorageaccount.blob.core.windows.net/", + "queue": "https://mystorageaccount.queue.core.windows.net/", + "table": "https://mystorageaccount.table.core.windows.net/", + "file": "https://mystorageaccount.file.core.windows.net/" + }, + "primaryLocation": "westus", + "statusOfPrimary": "available" + } + } + }, + "afterSnapshot": { + "timestamp": "2018-10-31T01:54:24.42Z", + "content": { + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "kind": "Storage", + "id": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "name": "mystorageaccount", + "type": "Microsoft.Storage/storageAccounts", + "location": "westus", + "tags": {}, + "properties": { + "networkAcls": { + "bypass": "AzureServices", + "virtualNetworkRules": [], + "ipRules": [], + "defaultAction": "Allow" + }, + "supportsHttpsTrafficOnly": true, + "encryption": { + "services": { + "file": { + "enabled": true, + "lastEnabledTime": "2018-07-27T18:37:21.8333895Z" + }, + "blob": { + "enabled": true, + "lastEnabledTime": "2018-07-27T18:37:21.8333895Z" + } + }, + "keySource": "Microsoft.Storage" + }, + "provisioningState": "Succeeded", + "creationTime": "2018-07-27T18:37:21.7708872Z", + "primaryEndpoints": { + "blob": "https://mystorageaccount.blob.core.windows.net/", + "queue": "https://mystorageaccount.queue.core.windows.net/", + "table": "https://mystorageaccount.table.core.windows.net/", + "file": "https://mystorageaccount.file.core.windows.net/" + }, + "primaryLocation": "westus", + "statusOfPrimary": "available" + } + } + } + } + ] + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChanges.json new file mode 100644 index 000000000000..382d95660259 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChanges.json @@ -0,0 +1,46 @@ +{ + "title": "Basic Resource Changes Query", + "description": "A simple resource changes query.", + "parameters": { + "api-version": "2020-09-01-preview", + "parameters": { + "resourceIds": [ + "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount" + ], + "interval": { + "start": "2018-10-30T12:09:03.141Z", + "end": "2018-10-31T12:09:03.141Z" + } + } + }, + "responses": { + "200": { + "body": { + "changes": [ + { + "changeId": "2db0ad2d-f6f0-4f46-b529-5c4e8c494648", + "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "changeType": "Update", + "beforeSnapshot": { + "timestamp": "2018-10-31T01:32:05.993Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-31T01:54:24.42Z" + } + }, + { + "changeId": "9dc352cb-b7c1-4198-9eda-e5e3ed66aec8", + "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "changeType": "Create", + "beforeSnapshot": { + "timestamp": "2018-10-30T10:30:19.68Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-30T21:12:31.337Z" + } + } + ] + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChangesFirstPage.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChangesFirstPage.json new file mode 100644 index 000000000000..5df86f7bdb82 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChangesFirstPage.json @@ -0,0 +1,48 @@ +{ + "title": "Resource Changes Query: First Page", + "description": "A resource changes query requesting the first page.", + "parameters": { + "api-version": "2020-09-01-preview", + "parameters": { + "resourceIds": [ + "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount" + ], + "interval": { + "start": "2018-10-30T12:09:03.141Z", + "end": "2018-10-31T12:09:03.141Z" + }, + "$top": 2 + } + }, + "responses": { + "200": { + "body": { + "changes": [ + { + "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "changeId": "2db0ad2d-f6f0-4f46-b529-5c4e8c494648", + "changeType": "Update", + "beforeSnapshot": { + "timestamp": "2018-10-31T01:32:05.993Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-31T01:54:24.42Z" + } + }, + { + "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "changeId": "9dc352cb-b7c1-4198-9eda-e5e3ed66aec8", + "changeType": "Create", + "beforeSnapshot": { + "timestamp": "2018-10-30T10:30:19.68Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-30T21:12:31.337Z" + } + } + ], + "$skipToken": "ew0KICAiJGlkIjogIjEiLA0KICAiRW5kVGltZSI6ICJcL0RhdGUoMTU1MDc0NT" + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChangesNextPage.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChangesNextPage.json new file mode 100644 index 000000000000..51876247fb10 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/examples/ResourceChangesNextPage.json @@ -0,0 +1,49 @@ +{ + "title": "Resource Changes Query: Next Page", + "description": "A resource changes query requesting the next page using a skip token.", + "parameters": { + "api-version": "2020-04-01-preview", + "parameters": { + "resourceIds": [ + "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount" + ], + "interval": { + "start": "2018-10-30T12:09:03.141Z", + "end": "2018-10-31T12:09:03.141Z" + }, + "$top": 2, + "$skipToken": "ew0KICAiJGlkIjogIjEiLA0KICAiRW5kVGltZSI6ICJcL0RhdGUoMTU1MDc0NT" + } + }, + "responses": { + "200": { + "body": { + "changes": [ + { + "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "changeId": "55f458c4-f1c0-4963-bc6c-af275cd47702", + "changeType": "Update", + "beforeSnapshot": { + "timestamp": "2018-10-31T03:43:08.629Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-31T05:12:32.087Z" + } + }, + { + "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "changeId": "0495b929-b86d-46cc-a972-939145feed90", + "changeType": "Create", + "beforeSnapshot": { + "timestamp": "2018-10-31T01:54:24.42Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-31T02:01:02.163Z" + } + } + ], + "$skipToken": "kVGltZSI6ICJcL0RhdGUoMTU1MDc0NTew0KICAiJGlkIjogIjEiLA0KICAiRW5" + } + } + } +} diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/resourcechanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/resourcechanges.json new file mode 100644 index 000000000000..94eae9e88197 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2020-09-01-preview/resourcechanges.json @@ -0,0 +1,447 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Resource Graph", + "description": "Azure Resource Graph API Reference", + "version": "2020-09-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/ResourceChangeDataList" + } + }, + "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": { + "resourceIds": { + "description": "Specifies the list of resources for a changes request.", + "type": "array", + "items": { + "type": "string", + "description": "Specifies the resource for a changes request." + } + }, + "subscriptionId": { + "description": "The subscription id of resources to query the changes from. ", + "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 + }, + "table": { + "description": "The table name to query resources from.", + "type": "string" + }, + "fetchPropertyChanges": { + "description": "The flag if set to true will fetch property changes", + "type": "boolean" + }, + "fetchSnapshots": { + "description": "The flag if set to true will fetch change snapshots", + "type": "boolean" + } + }, + "required": [ + "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" + } + } + }, + "ResourceChangeDataList": { + "description": "A list of change details associated with a resource over a specific time interval.", + "type": "array", + "items": { + "$ref": "#/definitions/ResourceChangeData" + } + }, + "ResourceChangeData": { + "description": "Data on a specific change, represented by a pair of before and after resource snapshots.", + "type": "object", + "properties": { + "resourceId": { + "description": "The resource for a change.", + "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": { + "resourceIds": { + "description": "Specifies the list of resources for a change details request.", + "type": "array", + "items": { + "type": "string", + "description": "Specifies the resource for a change details request." + } + }, + "changeIds": { + "description": "Specifies the list of change IDs for a change details request.", + "type": "array", + "items": { + "type": "string", + "description": "Specifies the change ID." + } + } + }, + "required": [ + "resourceIds", + "changeIds" + ] + }, + "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 c016a7489782..367f03d2fa09 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -27,7 +27,7 @@ These are the global settings for the ResourceGraph API. ``` yaml title: ResourceGraphClient openapi-type: arm -tag: package-preview-2020-04 +tag: package-preview-2020-09 ``` ### Validations @@ -40,6 +40,16 @@ semantic-validator: true model-validator: true message-format: json ``` +### Tag: package-preview-2020-09 + +These settings apply only when `--tag=package-preview-2020-09` is specified on the command line. + +``` yaml $(tag) == 'package-preview-2020-09' +input-file: + - Microsoft.ResourceGraph/preview/2020-09-01-preview/resourcechanges.json + - Microsoft.ResourceGraph/preview/2020-04-01-preview/resourcegraph.json + - Microsoft.ResourceGraph/preview/2020-04-01-preview/resourceshistory.json +``` ### Tag: package-preview-2020-04