From 260651b67269ee08d515b2bae9d2e9f9c5732c42 Mon Sep 17 00:00:00 2001 From: Badea Marjieh <127952241+badeamarjieh@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:54:31 +0300 Subject: [PATCH] Update Spec to Match Backend - Add 200 Status Code for Resume and Suspend APIs (#30253) * . * fix typo * add suppresions.yaml * add suppressions to readme.md --- .../Microsoft.Fabric.Management/capacity.tsp | 14 ++++++++++++-- .../2023-11-01/FabricCapacities_Resume.json | 1 + .../2023-11-01/FabricCapacities_Suspend.json | 1 + .../examples/FabricCapacities_Resume.json | 1 + .../examples/FabricCapacities_Suspend.json | 1 + .../Microsoft.Fabric/stable/2023-11-01/fabric.json | 14 ++++++++++++++ specification/fabric/resource-manager/readme.md | 4 ++++ 7 files changed, 34 insertions(+), 2 deletions(-) diff --git a/specification/fabric/Microsoft.Fabric.Management/capacity.tsp b/specification/fabric/Microsoft.Fabric.Management/capacity.tsp index c2f4407acd4e..94c6fad070ee 100644 --- a/specification/fabric/Microsoft.Fabric.Management/capacity.tsp +++ b/specification/fabric/Microsoft.Fabric.Management/capacity.tsp @@ -45,10 +45,10 @@ interface FabricCapacities { listBySubscription is ArmListBySubscription; @doc("Resume operation of the specified Fabric capacity instance.") - resume is ArmResourceActionNoResponseContentAsync; + resume is ArmResourceActionAsync; @doc("Suspend operation of the specified Fabric capacity instance.") - suspend is ArmResourceActionNoResponseContentAsync; + suspend is ArmResourceActionAsync; checkNameAvailability is checkLocalNameAvailability; @@ -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; +} diff --git a/specification/fabric/Microsoft.Fabric.Management/examples/2023-11-01/FabricCapacities_Resume.json b/specification/fabric/Microsoft.Fabric.Management/examples/2023-11-01/FabricCapacities_Resume.json index ec90eb13207e..b80c7f8adf4f 100644 --- a/specification/fabric/Microsoft.Fabric.Management/examples/2023-11-01/FabricCapacities_Resume.json +++ b/specification/fabric/Microsoft.Fabric.Management/examples/2023-11-01/FabricCapacities_Resume.json @@ -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-", diff --git a/specification/fabric/Microsoft.Fabric.Management/examples/2023-11-01/FabricCapacities_Suspend.json b/specification/fabric/Microsoft.Fabric.Management/examples/2023-11-01/FabricCapacities_Suspend.json index 7507ad604a2f..14fd5b186f12 100644 --- a/specification/fabric/Microsoft.Fabric.Management/examples/2023-11-01/FabricCapacities_Suspend.json +++ b/specification/fabric/Microsoft.Fabric.Management/examples/2023-11-01/FabricCapacities_Suspend.json @@ -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-", diff --git a/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/examples/FabricCapacities_Resume.json b/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/examples/FabricCapacities_Resume.json index ec90eb13207e..b80c7f8adf4f 100644 --- a/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/examples/FabricCapacities_Resume.json +++ b/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/examples/FabricCapacities_Resume.json @@ -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-", diff --git a/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/examples/FabricCapacities_Suspend.json b/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/examples/FabricCapacities_Suspend.json index 7507ad604a2f..14fd5b186f12 100644 --- a/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/examples/FabricCapacities_Suspend.json +++ b/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/examples/FabricCapacities_Suspend.json @@ -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-", diff --git a/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/fabric.json b/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/fabric.json index f9be285b9349..1018facc7be8 100644 --- a/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/fabric.json +++ b/specification/fabric/resource-manager/Microsoft.Fabric/stable/2023-11-01/fabric.json @@ -542,6 +542,9 @@ } ], "responses": { + "200": { + "description": "The capacity was successfully resumed" + }, "202": { "description": "Resource operation accepted.", "headers": { @@ -648,6 +651,9 @@ } ], "responses": { + "200": { + "description": "The capacity was successfully suspended" + }, "202": { "description": "Resource operation accepted.", "headers": { @@ -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.", @@ -1077,6 +1087,10 @@ } ] } + }, + "SuspendOkStatusCode": { + "type": "object", + "description": "The capacity was successfully suspended" } }, "parameters": { diff --git a/specification/fabric/resource-manager/readme.md b/specification/fabric/resource-manager/readme.md index 9963df034821..617d8d2ed09c 100644 --- a/specification/fabric/resource-manager/readme.md +++ b/specification/fabric/resource-manager/readme.md @@ -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 ``` ---