From 5296bd56232a510b0c3139156778ad97014793e5 Mon Sep 17 00:00:00 2001 From: Abhay Pratap Date: Sun, 11 Jun 2023 23:32:21 -0700 Subject: [PATCH 01/10] Resolving S320 Item - Missing Get SubscriptionOperations for 2021-10-01 version. --- .../examples/getSubscriptionOperation.json | 19 +++++++ .../stable/2021-10-01/subscriptions.json | 53 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getSubscriptionOperation.json diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getSubscriptionOperation.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getSubscriptionOperation.json new file mode 100644 index 000000000000..fdbed844fba1 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getSubscriptionOperation.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "operationId": "e4b8d068-f574-462a-a76f-6fa0afc613c9", + "api-version": "2021-10-01" + }, + "responses": { + "202": { + "headers": { + "Location": "/providers/Microsoft.Subscription/subscriptionOperations/e4b8d068-f574-462a-a76f-6fa0afc613c9?api-version=2021-10-01", + "Retry-After": 8 + } + }, + "200": { + "body": { + "subscriptionLink": "/subscriptions/4df8d5c2-1b7e-4dd5-bc61-640704bde633" + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json index 6fd06515f344..9e83fab81ee0 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json @@ -118,6 +118,50 @@ } } }, + "/providers/Microsoft.Subscription/subscriptionOperations/{operationId}": { + "get": { + "description": "Get the status of the pending Microsoft.Subscription API operations.", + "operationId": "SubscriptionOperation_Get", + "x-ms-examples": { + "getPendingSubscriptionOperations": { + "$ref": "./examples/getSubscriptionOperation.json" + } + }, + "responses": { + "200": { + "description": "Successful completion of the asynchronous operation", + "schema": { + "$ref": "#/definitions/SubscriptionCreationResult" + } + }, + "202": { + "description": "Accepted. Subscription update is in progress.", + "headers": { + "Location": { + "description": "The URL where the status of the asynchronous operation can be checked.", + "type": "string" + }, + "Retry-After": { + "description": "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds.", + "type": "integer" + } + } + } + }, + "parameters": [ + { + "name": "operationId", + "in": "path", + "description": "The operation ID, which can be found from the Location field in the generate recommendation response header.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + } + }, "/providers/Microsoft.Subscription/operations": { "get": { "description": "Lists all of the available Microsoft.Subscription API operations.", @@ -573,6 +617,15 @@ } } }, + "SubscriptionCreationResult": { + "description": "The created subscription object.", + "properties": { + "subscriptionLink": { + "description": "The link to the new subscription. Use this link to check the status of subscription creation operation.", + "type": "string" + } + } + }, "SubscriptionName": { "type": "object", "description": "The new name of the subscription.", From b6b053ee36a5157e3f46b757ed9d3e5aecc84257 Mon Sep 17 00:00:00 2001 From: Abhay Pratap Date: Mon, 12 Jun 2023 00:23:18 -0700 Subject: [PATCH 02/10] Fix pipeline suggestions. --- .../stable/2021-10-01/subscriptions.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json index 9e83fab81ee0..71479b5591d2 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json @@ -127,6 +127,7 @@ "$ref": "./examples/getSubscriptionOperation.json" } }, + "x-ms-long-running-operation": true, "responses": { "200": { "description": "Successful completion of the asynchronous operation", @@ -143,9 +144,16 @@ }, "Retry-After": { "description": "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds.", - "type": "integer" + "type": "integer", + "format": "int64" } } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } } }, "parameters": [ @@ -619,6 +627,7 @@ }, "SubscriptionCreationResult": { "description": "The created subscription object.", + "type": "object", "properties": { "subscriptionLink": { "description": "The link to the new subscription. Use this link to check the status of subscription creation operation.", From 4936e00f30d12f9c8d7f3e490336d47f4df1449b Mon Sep 17 00:00:00 2001 From: Abhay Pratap Date: Mon, 12 Jun 2023 00:28:26 -0700 Subject: [PATCH 03/10] Minor fix. --- .../Microsoft.Subscription/stable/2021-10-01/subscriptions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json index 71479b5591d2..876606b1f4d2 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json @@ -152,7 +152,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponseBody" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, From 0d9210140459bf291060394b6dbe24a07e6fd505 Mon Sep 17 00:00:00 2001 From: Abhay Pratap Date: Fri, 16 Jun 2023 19:52:33 -0700 Subject: [PATCH 04/10] Make Get Subscription operations sync in this version. --- .../Microsoft.Subscription/stable/2021-10-01/subscriptions.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json index 876606b1f4d2..08106f640315 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json @@ -127,7 +127,6 @@ "$ref": "./examples/getSubscriptionOperation.json" } }, - "x-ms-long-running-operation": true, "responses": { "200": { "description": "Successful completion of the asynchronous operation", From 77ea8065b33a3939a91dc46698bb826b7bfb259c Mon Sep 17 00:00:00 2001 From: Abhay Pratap Date: Tue, 20 Jun 2023 13:59:59 -0700 Subject: [PATCH 05/10] Added suppress rules for failing lint errors. --- specification/subscription/resource-manager/readme.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index b4f3b2c907d6..c138fb0c1e67 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -42,6 +42,17 @@ These settings apply only when `--tag=package-2021-10` is specified on the comma input-file: - Microsoft.Subscription/stable/2016-06-01/subscriptions.json - Microsoft.Subscription/stable/2021-10-01/subscriptions.json +directive: + - where: + - $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"] + suppress: + - LroExtension + reason: Avoid Lro changes on this api to return 202. + - where: + - $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"] + suppress: + - GetOperation200 + reason: This api will return 200 and 202 response. title: SubscriptionClient description: The subscription client ``` From 792cb8ad895aaa1072263539b98c7e41e2010abe Mon Sep 17 00:00:00 2001 From: Abhay Pratap Date: Wed, 28 Jun 2023 14:24:18 -0700 Subject: [PATCH 06/10] Fix suppression Issues. --- .../subscription/resource-manager/readme.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index c138fb0c1e67..64d374bd12a6 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -23,6 +23,14 @@ To see additional help and options, run: ``` yaml directive: - suppress: R2059 + - suppress: LroExtension + from: subscriptions.json + where: '$.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get' + reason: Avoid Lro changes on this api to return 202. + - suppress: GetOperation200 + from: subscriptions.json + where: '$.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get' + reason: This api will return 200 and 202 response. ``` @@ -42,17 +50,6 @@ These settings apply only when `--tag=package-2021-10` is specified on the comma input-file: - Microsoft.Subscription/stable/2016-06-01/subscriptions.json - Microsoft.Subscription/stable/2021-10-01/subscriptions.json -directive: - - where: - - $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"] - suppress: - - LroExtension - reason: Avoid Lro changes on this api to return 202. - - where: - - $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"] - suppress: - - GetOperation200 - reason: This api will return 200 and 202 response. title: SubscriptionClient description: The subscription client ``` From 80cf2cf0f0b4d9076bdb339446546ccab03d7597 Mon Sep 17 00:00:00 2001 From: Abhay Pratap Date: Wed, 28 Jun 2023 14:48:43 -0700 Subject: [PATCH 07/10] Minor fix suppression GetOperation200. --- specification/subscription/resource-manager/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index 64d374bd12a6..5617de2a2507 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -29,7 +29,7 @@ directive: reason: Avoid Lro changes on this api to return 202. - suppress: GetOperation200 from: subscriptions.json - where: '$.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get' + where: '$.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get.responses' reason: This api will return 200 and 202 response. ``` From 7f286d7abc5ae726531528986fda9e4176ecdc92 Mon Sep 17 00:00:00 2001 From: Abhay Pratap Date: Wed, 28 Jun 2023 23:09:28 -0700 Subject: [PATCH 08/10] Address minor fixes. --- .../stable/2021-10-01/subscriptions.json | 2 +- specification/subscription/resource-manager/readme.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json index 08106f640315..f9ff4225fe8a 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json @@ -151,7 +151,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponseBody" } } }, diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index 5617de2a2507..d686f6c1b476 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -25,11 +25,11 @@ directive: - suppress: R2059 - suppress: LroExtension from: subscriptions.json - where: '$.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get' + where: $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get reason: Avoid Lro changes on this api to return 202. - suppress: GetOperation200 from: subscriptions.json - where: '$.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get.responses' + where: $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get reason: This api will return 200 and 202 response. ``` From 30be453a97b9a4d64b1a7a6e45d7364bfbf4d8a2 Mon Sep 17 00:00:00 2001 From: Abhay Pratap Date: Thu, 29 Jun 2023 13:02:16 -0700 Subject: [PATCH 09/10] Address GetOperation200 changes. --- specification/subscription/resource-manager/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index d686f6c1b476..c4a643f48a2e 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -29,7 +29,7 @@ directive: reason: Avoid Lro changes on this api to return 202. - suppress: GetOperation200 from: subscriptions.json - where: $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get + where: $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get.responses reason: This api will return 200 and 202 response. ``` From 41f8f34937be245a855ff49552ecdeb0213ca525 Mon Sep 17 00:00:00 2001 From: Konrad Jamrozik Date: Thu, 29 Jun 2023 23:01:18 -0700 Subject: [PATCH 10/10] Update readme.md: attempt suppression fix by adding ["202"] to "responses" to path --- specification/subscription/resource-manager/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index c4a643f48a2e..0da990acfcbd 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -29,7 +29,7 @@ directive: reason: Avoid Lro changes on this api to return 202. - suppress: GetOperation200 from: subscriptions.json - where: $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get.responses + where: $.paths["/providers/Microsoft.Subscription/subscriptionOperations/{operationId}"].get.responses["202"] reason: This api will return 200 and 202 response. ```