Skip to content

Commit

Permalink
S360 Item - Missing Get SubscriptionOperations for 2021-10-01 version. (
Browse files Browse the repository at this point in the history
#24395)

* Resolving S320 Item - Missing Get SubscriptionOperations for 2021-10-01 version.

* Fix pipeline suggestions.

* Minor fix.

* Make Get Subscription operations sync in this version.

* Added suppress rules for failing lint errors.

* Fix suppression Issues.

* Minor fix suppression GetOperation200.

* Address minor fixes.

* Address GetOperation200 changes.

* Update readme.md: attempt suppression fix by adding ["202"] to "responses" to path

---------

Co-authored-by: Abhay Pratap <abhaypratap@microsoft.com>
Co-authored-by: Konrad Jamrozik <kojamroz@microsoft.com>
  • Loading branch information
3 people authored Jul 7, 2023
1 parent 1968865 commit 0f39a2d
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,57 @@
}
}
},
"/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",
"format": "int64"
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponseBody"
}
}
},
"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.",
Expand Down Expand Up @@ -573,6 +624,16 @@
}
}
},
"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.",
"type": "string"
}
}
},
"SubscriptionName": {
"type": "object",
"description": "The new name of the subscription.",
Expand Down
8 changes: 8 additions & 0 deletions specification/subscription/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.responses["202"]
reason: This api will return 200 and 202 response.
```
Expand Down

0 comments on commit 0f39a2d

Please sign in to comment.