From 5d08af2623a53c4d062b2b087ac54b202d4c422b Mon Sep 17 00:00:00 2001 From: Anatoli Beliaev Date: Wed, 20 Mar 2019 18:19:41 -0700 Subject: [PATCH 1/5] Add resourceChanges and resourceChangeDetails actions --- .../examples/ResourceChangeDetails.json | 107 +++++++++ .../examples/ResourceChanges.json | 36 +++ .../examples/ResourceChangesFirstPage.json | 38 +++ .../examples/ResourceChangesNextPage.json | 39 ++++ .../2018-09-01-preview/resourcegraph.json | 220 ++++++++++++++++++ 5 files changed, 440 insertions(+) create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChanges.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json create mode 100644 specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json new file mode 100644 index 000000000000..dbdb0e45d02a --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json @@ -0,0 +1,107 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "changeId": "53dc0515-b86b-4bc2-979b-e4694ab4a556" + }, + "responses": { + "200": { + "body": { + "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" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChanges.json new file mode 100644 index 000000000000..36be939f2b59 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChanges.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "resourceId": "/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", + "beforeSnapshot": { + "timestamp": "2018-10-31T01:32:05.993Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-31T01:54:24.42Z" + } + }, + { + "changeId": "9dc352cb-b7c1-4198-9eda-e5e3ed66aec8", + "beforeSnapshot": { + "timestamp": "2018-10-30T10:30:19.68Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-30T21:12:31.337Z" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json new file mode 100644 index 000000000000..fb21c2e59c65 --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "resourceId": "/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": [ + { + "changeId": "2db0ad2d-f6f0-4f46-b529-5c4e8c494648", + "beforeSnapshot": { + "timestamp": "2018-10-31T01:32:05.993Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-31T01:54:24.42Z" + } + }, + { + "changeId": "9dc352cb-b7c1-4198-9eda-e5e3ed66aec8", + "beforeSnapshot": { + "timestamp": "2018-10-30T10:30:19.68Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-30T21:12:31.337Z" + } + } + ], + "skipToken": "ew0KICAiJGlkIjogIjEiLA0KICAiRW5kVGltZSI6ICJcL0RhdGUoMTU1MDc0NT" + } + } + } +} \ No newline at end of file diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json new file mode 100644 index 000000000000..55953d92d45d --- /dev/null +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json @@ -0,0 +1,39 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "resourceId": "/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": [ + { + "changeId": "55f458c4-f1c0-4963-bc6c-af275cd47702", + "beforeSnapshot": { + "timestamp": "2018-10-31T03:43:08.629Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-31T05:12:32.087Z" + } + }, + { + "changeId": "0495b929-b86d-46cc-a972-939145feed90", + "beforeSnapshot": { + "timestamp": "2018-10-31T01:54:24.42Z" + }, + "afterSnapshot": { + "timestamp": "2018-10-31T02:01:02.163Z" + } + } + ], + "skipToken": "kVGltZSI6ICJcL0RhdGUoMTU1MDc0NTew0KICAiJGlkIjogIjEiLA0KICAiRW5" + } + } + } +} \ No newline at end of file diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/resourcegraph.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/resourcegraph.json index 14f879b17922..fb66706f7ce3 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/resourcegraph.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/resourcegraph.json @@ -88,6 +88,90 @@ } } }, + "/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": [ @@ -411,6 +495,142 @@ } ] }, + "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 + } + }, + "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" + } + ] + } + }, + "required": [ + "changeId", + "beforeSnapshot", + "afterSnapshot" + ] + }, + "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", From 9dd6841f6ca135257696a4021e9894bc7926f288 Mon Sep 17 00:00:00 2001 From: Anatoli Beliaev Date: Thu, 21 Mar 2019 13:53:32 -0700 Subject: [PATCH 2/5] Fix examples Add titles and descriptions Add wrapping 'parameters' --- .../examples/ResourceChangeDetails.json | 8 ++++++-- .../examples/ResourceChanges.json | 12 ++++++++---- .../examples/ResourceChangesFirstPage.json | 16 ++++++++++------ .../examples/ResourceChangesNextPage.json | 18 +++++++++++------- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json index dbdb0e45d02a..155b9bc0129a 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json @@ -1,8 +1,12 @@ { + "title": "Resource Change Details Query", + "description": "A resource change details query.", "parameters": { "api-version": "2018-09-01-preview", - "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", - "changeId": "53dc0515-b86b-4bc2-979b-e4694ab4a556" + "parameters": { + "resourceId": "/subscriptions/4d962866-1e3f-47f2-bd18-450c08f914c1/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount", + "changeId": "53dc0515-b86b-4bc2-979b-e4694ab4a556" + } }, "responses": { "200": { diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChanges.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChanges.json index 36be939f2b59..105886fa17a4 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChanges.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChanges.json @@ -1,10 +1,14 @@ { + "title": "Basic Resource Changes Query", + "description": "A simple resource changes query.", "parameters": { "api-version": "2018-09-01-preview", - "resourceId": "/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" + "parameters": { + "resourceId": "/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": { diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json index fb21c2e59c65..fd4425e2c9fd 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json @@ -1,12 +1,16 @@ { + "title": "Resource Changes Query: First Page", + "description": "A resource changes query requesting the first page.", "parameters": { "api-version": "2018-09-01-preview", - "resourceId": "/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" + "parameters": { + "resourceId": "/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": { diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json index 55953d92d45d..b9ff224190ac 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json @@ -1,13 +1,17 @@ { + "title": "Resource Changes Query: Next Page", + "description": "A resource changes query requesting the next page using a skip token.", "parameters": { "api-version": "2018-09-01-preview", - "resourceId": "/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" + "parameters": { + "resourceId": "/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": { From 06e67e395b89e09b2da5b34b8f5f22bbe5e00f1e Mon Sep 17 00:00:00 2001 From: Anatoli Beliaev Date: Thu, 21 Mar 2019 14:37:20 -0700 Subject: [PATCH 3/5] Fix examples Rename 'top' to '$top', 'skipToken' to '$skipToken' --- .../examples/ResourceChangesFirstPage.json | 4 ++-- .../examples/ResourceChangesNextPage.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json index fd4425e2c9fd..045368463744 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesFirstPage.json @@ -9,7 +9,7 @@ "start": "2018-10-30T12:09:03.141Z", "end": "2018-10-31T12:09:03.141Z" }, - "top": "2" + "$top": "2" } }, "responses": { @@ -35,7 +35,7 @@ } } ], - "skipToken": "ew0KICAiJGlkIjogIjEiLA0KICAiRW5kVGltZSI6ICJcL0RhdGUoMTU1MDc0NT" + "$skipToken": "ew0KICAiJGlkIjogIjEiLA0KICAiRW5kVGltZSI6ICJcL0RhdGUoMTU1MDc0NT" } } } diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json index b9ff224190ac..efbd570e98e0 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangesNextPage.json @@ -9,8 +9,8 @@ "start": "2018-10-30T12:09:03.141Z", "end": "2018-10-31T12:09:03.141Z" }, - "top": "2", - "skipToken": "ew0KICAiJGlkIjogIjEiLA0KICAiRW5kVGltZSI6ICJcL0RhdGUoMTU1MDc0NT" + "$top": "2", + "$skipToken": "ew0KICAiJGlkIjogIjEiLA0KICAiRW5kVGltZSI6ICJcL0RhdGUoMTU1MDc0NT" } }, "responses": { @@ -36,7 +36,7 @@ } } ], - "skipToken": "kVGltZSI6ICJcL0RhdGUoMTU1MDc0NTew0KICAiJGlkIjogIjEiLA0KICAiRW5" + "$skipToken": "kVGltZSI6ICJcL0RhdGUoMTU1MDc0NTew0KICAiJGlkIjogIjEiLA0KICAiRW5" } } } From 172d27bba30fc4d1d676c74c3eb58ab69e53b481 Mon Sep 17 00:00:00 2001 From: Anatoli Beliaev Date: Thu, 21 Mar 2019 14:37:54 -0700 Subject: [PATCH 4/5] Fix resourceChangeDetails example Add changeId to resourceChangeDetails response example --- .../2018-09-01-preview/examples/ResourceChangeDetails.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json index 155b9bc0129a..9aa3710fa824 100644 --- a/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json +++ b/specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2018-09-01-preview/examples/ResourceChangeDetails.json @@ -11,6 +11,7 @@ "responses": { "200": { "body": { + "changeId": "53dc0515-b86b-4bc2-979b-e4694ab4a556", "beforeSnapshot": { "timestamp": "2018-10-31T01:32:05.993Z", "content": { From 5a65ae0a1b786cdfe5431f1c691df72157c37e1a Mon Sep 17 00:00:00 2001 From: Anatoli Beliaev Date: Wed, 27 Mar 2019 12:40:22 -0700 Subject: [PATCH 5/5] Adds suppression to readme --- .../resourcegraph/resource-manager/readme.md | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/specification/resourcegraph/resource-manager/readme.md b/specification/resourcegraph/resource-manager/readme.md index 583bec8477de..f038c1573c65 100644 --- a/specification/resourcegraph/resource-manager/readme.md +++ b/specification/resourcegraph/resource-manager/readme.md @@ -4,10 +4,10 @@ This is the AutoRest configuration file for ResourceGraph. - - --- + ## Getting Started + To build the SDK for ResourceGraph, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: > `autorest` @@ -15,12 +15,13 @@ To build the SDK for ResourceGraph, simply [Install AutoRest](https://aka.ms/aut To see additional help and options, run: > `autorest --help` + --- ## Configuration - ### Basic Information + These are the global settings for the ResourceGraph API. ``` yaml @@ -30,6 +31,7 @@ tag: package-2018-09-preview ``` ### Validations + Run validations when `--validate` is specified on command line ``` yaml $(validate) @@ -39,7 +41,6 @@ model-validator: true message-format: json ``` - ### Tag: package-2018-09-preview These settings apply only when `--tag=package-2018-09-preview` is specified on the command line. @@ -51,7 +52,6 @@ input-file: # Code Generation - ## Swagger to SDK This section describes what SDK should be generated by the automatic system. @@ -62,8 +62,7 @@ swagger-to-sdk: - repo: azure-sdk-for-python ``` - -## C# +## C# These settings apply only when `--csharp` is specified on the command line. Please also specify `--csharp-sdks-folder=`. @@ -76,3 +75,20 @@ csharp: output-folder: $(csharp-sdks-folder)/ResourceGraph/Management/Management.ResourceGraph/Generated clear-output-folder: true ``` + +## Suppression + +``` yaml +directive: + - suppress: ListInOperationName + from: resourcegraph.json + where: '$.paths["/providers/Microsoft.ResourceGraph/resourceChanges"].post.operationId' + reason: |- + 1. Is this rule applicable? R1003 ListInOperationName says: "Per ARM SDK guidelines, each 'GET' operation on a resource should have "list" in the name...". However, this is POST, not GET. + + 2. If the rule is applicable anyway, how should we fix it? Renaming it to ResourceChanges_List causes another warning: + "OperationId should contain the verb: 'resourcechanges' in:'ResourceChanges_List'. Consider updating the operationId" + Renaming it to ResourceChanges_ListResourceChanges causes yet another warning: + "Per the Noun_Verb convention for Operation Ids, the noun 'ResourceChanges' should not appear after the underscore." + Renaming it to ResourceChanges_Listresourcechanges seems to get rid of warnings, but the result looks very strange. +```