Skip to content

Commit

Permalink
Update Spec to Match Backend - Add 200 Status Code for Resume and Sus…
Browse files Browse the repository at this point in the history
…pend APIs (Azure#30253)

* .

* fix typo

* add suppresions.yaml

* add suppressions to readme.md
  • Loading branch information
badeamarjieh authored Aug 26, 2024
1 parent 02b81f7 commit 260651b
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 2 deletions.
14 changes: 12 additions & 2 deletions specification/fabric/Microsoft.Fabric.Management/capacity.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ interface FabricCapacities {
listBySubscription is ArmListBySubscription<FabricCapacity>;

@doc("Resume operation of the specified Fabric capacity instance.")
resume is ArmResourceActionNoResponseContentAsync<FabricCapacity, void>;
resume is ArmResourceActionAsync<FabricCapacity, void, ResumeOkStatusCode>;

@doc("Suspend operation of the specified Fabric capacity instance.")
suspend is ArmResourceActionNoResponseContentAsync<FabricCapacity, void>;
suspend is ArmResourceActionAsync<FabricCapacity, void, SuspendOkStatusCode>;

checkNameAvailability is checkLocalNameAvailability;

Expand All @@ -74,3 +74,13 @@ interface FabricCapacities {
...Azure.ResourceManager.Foundations.DefaultProviderNamespace,
): RpSkuEnumerationForNewResourceResult | ErrorResponse;
}

@doc("The capacity was successfully suspended")
model SuspendOkStatusCode {
...OkResponse;
}

@doc("The capacity was successfully resumed")
model ResumeOkStatusCode {
...OkResponse;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"capacityName": "azsdktest"
},
"responses": {
"200": {},
"202": {
"headers": {
"Location": "https://management.azure.com/subscriptions/548B7FB7-3B2A-4F46-BB02-66473F1FC22C/providers/Microsoft.Fabric/locations/westcentralus/operationstatuses/82494E97-958D-4BFF-92F1-297BB0D9F2D7?api-version=2023-11-01&t=638525947760837928&c=MIIH5zCCBs-",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"capacityName": "azsdktest"
},
"responses": {
"200": {},
"202": {
"headers": {
"Location": "https://management.azure.com/subscriptions/548B7FB7-3B2A-4F46-BB02-66473F1FC22C/providers/Microsoft.Fabric/locations/westcentralus/operationstatuses/82494E97-958D-4BFF-92F1-297BB0D9F2D7?api-version=2023-11-01&t=638525947760837928&c=MIIH5zCCBs-",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"capacityName": "azsdktest"
},
"responses": {
"200": {},
"202": {
"headers": {
"Location": "https://management.azure.com/subscriptions/548B7FB7-3B2A-4F46-BB02-66473F1FC22C/providers/Microsoft.Fabric/locations/westcentralus/operationstatuses/82494E97-958D-4BFF-92F1-297BB0D9F2D7?api-version=2023-11-01&t=638525947760837928&c=MIIH5zCCBs-",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"capacityName": "azsdktest"
},
"responses": {
"200": {},
"202": {
"headers": {
"Location": "https://management.azure.com/subscriptions/548B7FB7-3B2A-4F46-BB02-66473F1FC22C/providers/Microsoft.Fabric/locations/westcentralus/operationstatuses/82494E97-958D-4BFF-92F1-297BB0D9F2D7?api-version=2023-11-01&t=638525947760837928&c=MIIH5zCCBs-",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,9 @@
}
],
"responses": {
"200": {
"description": "The capacity was successfully resumed"
},
"202": {
"description": "Resource operation accepted.",
"headers": {
Expand Down Expand Up @@ -648,6 +651,9 @@
}
],
"responses": {
"200": {
"description": "The capacity was successfully suspended"
},
"202": {
"description": "Resource operation accepted.",
"headers": {
Expand Down Expand Up @@ -935,6 +941,10 @@
]
}
},
"ResumeOkStatusCode": {
"type": "object",
"description": "The capacity was successfully resumed"
},
"RpSku": {
"type": "object",
"description": "Represents the SKU name and Azure pricing tier for Microsoft Fabric capacity resource.",
Expand Down Expand Up @@ -1077,6 +1087,10 @@
}
]
}
},
"SuspendOkStatusCode": {
"type": "object",
"description": "The capacity was successfully suspended"
}
},
"parameters": {
Expand Down
4 changes: 4 additions & 0 deletions specification/fabric/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ These settings apply only when `--tag=package-2023-11-01` is specified on the co
```yaml $(tag) == 'package-2023-11-01'
input-file:
- Microsoft.Fabric/stable/2023-11-01/fabric.json
suppressions:
- code: PostResponseCodes
reason: 2 POST Methods Resume and Suspend are LRO and the result returns 200 OK with no schema. It would take a while to fix the backend to return 204. Once fixed, will publish a new version. Specifying only 202 causes failues in the Az CLI Tools generation.
from: fabric.json
```
---

Expand Down

0 comments on commit 260651b

Please sign in to comment.