From 216e7ae3aafefd2ea16a5b64a49281d21da6cb1a Mon Sep 17 00:00:00 2001 From: Ju Hee Lee Date: Mon, 14 Dec 2020 22:23:01 -0800 Subject: [PATCH] Adding Azure-AsyncOperation header (#12080) --- .../examples/CalculateExchange.json | 51 +++++++++---------- .../2020-10-01-preview/examples/Exchange.json | 51 +++++++++---------- .../2020-10-01-preview/reservations.json | 16 ++++-- 3 files changed, 58 insertions(+), 60 deletions(-) diff --git a/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/examples/CalculateExchange.json b/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/examples/CalculateExchange.json index b6c1098be7d3..a22df514e396 100644 --- a/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/examples/CalculateExchange.json +++ b/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/examples/CalculateExchange.json @@ -43,22 +43,25 @@ "properties": { "sessionId": "66e2ac8f-439e-4345-8235-6fef07608081", "netPayable": { - "currencyCode": "EUR", - "amount": -688.11 + "currencyCode": "USD", + "amount": 15840.0 }, "refundsTotal": { - "currencyCode": "EUR", - "amount": 2938.11 + "currencyCode": "USD", + "amount": 3960.0 }, "purchasesTotal": { - "currencyCode": "EUR", - "amount": 2250.0 + "currencyCode": "USD", + "amount": 19800.0 + }, + "policyResult": { + "policyErrors": null }, "reservationsToPurchase": [ { "billingCurrencyTotal": { - "currencyCode": "EUR", - "amount": 2250.0 + "currencyCode": "USD", + "amount": 19800.0 } } ], @@ -67,40 +70,32 @@ "reservationId": "/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6", "quantity": 1, "billingRefundAmount": { - "currencyCode": "EUR", - "amount": 34.17 + "currencyCode": "USD", + "amount": 3960.0 }, "billingInformation": { "billingCurrencyTotalPaidAmount": { - "currencyCode": "EUR", - "amount": 170.82 + "currencyCode": "USD", + "amount": 19800.0 }, "billingCurrencyProratedAmount": { - "currencyCode": "EUR", - "amount": 136.65 + "currencyCode": "USD", + "amount": 15840.0 }, "billingCurrencyRemainingCommitmentAmount": { - "currencyCode": "EUR", - "amount": 2903.94 + "currencyCode": "USD", + "amount": 0.0 } } } - ], - "policyResult": { - "policyErrors": [ - { - "code": "RefundsLessThanPurchase", - "message": "New purchase amount should be greater than the total refunds." - } - ] - } - }, - "error": null + ] + } } }, "202": { "headers": { - "Location": "https://management.azure.com/Microsoft.Capacity/operationResults/8d542218-8bfe-4fd2-b909-0656c610281c?api-version=2019-04-01", + "Azure-AsyncOperation": "https://management.azure.com/Microsoft.Capacity/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188?api-version=2020-10-01-preview", + "Location": "https://management.azure.com/Microsoft.Capacity/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188?api-version=2020-10-01-preview", "Retry-After": 5 } } diff --git a/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/examples/Exchange.json b/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/examples/Exchange.json index 830af9a60569..704632a04eb9 100644 --- a/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/examples/Exchange.json +++ b/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/examples/Exchange.json @@ -16,23 +16,26 @@ "properties": { "sessionId": "66e2ac8f-439e-4345-8235-6fef07608081", "netPayable": { - "currencyCode": "EUR", - "amount": -688.11 + "currencyCode": "USD", + "amount": 15840.0 }, "refundsTotal": { - "currencyCode": "EUR", - "amount": 2938.11 + "currencyCode": "USD", + "amount": 3960.0 }, "purchasesTotal": { - "currencyCode": "EUR", - "amount": 2250.0 + "currencyCode": "USD", + "amount": 19800.0 + }, + "policyResult": { + "policyErrors": null }, "reservationsToPurchase": [ { "reservationOrderId": "/providers/microsoft.capacity/reservationOrders/1e85c519-b815-4169-8d79-62fc460c608f", "billingCurrencyTotal": { - "currencyCode": "EUR", - "amount": 2250.0 + "currencyCode": "USD", + "amount": 19800.0 }, "status": "Succeeded" } @@ -42,41 +45,33 @@ "reservationId": "/providers/microsoft.capacity/reservationOrders/1f14354c-dc12-4c8d-8090-6f295a3a34aa/reservations/c8c926bd-fc5d-4e29-9d43-b68340ac23a6", "quantity": 1, "billingRefundAmount": { - "currencyCode": "EUR", - "amount": 34.17 + "currencyCode": "USD", + "amount": 3960.0 }, "billingInformation": { "billingCurrencyTotalPaidAmount": { - "currencyCode": "EUR", - "amount": 170.82 + "currencyCode": "USD", + "amount": 19800.0 }, "billingCurrencyProratedAmount": { - "currencyCode": "EUR", - "amount": 136.65 + "currencyCode": "USD", + "amount": 15840.0 }, "billingCurrencyRemainingCommitmentAmount": { - "currencyCode": "EUR", - "amount": 2903.94 + "currencyCode": "USD", + "amount": 0.0 } }, "status": "Succeeded" } - ], - "policyResult": { - "policyErrors": [ - { - "code": "RefundsLessThanPurchase", - "message": "New purchase amount should be greater than the total refunds." - } - ] - } - }, - "error": null + ] + } } }, "202": { "headers": { - "Location": "https://management.azure.com/Microsoft.Capacity/operationResults/8d542218-8bfe-4fd2-b909-0656c610281c?api-version=2019-04-01", + "Azure-AsyncOperation": "https://management.azure.com/Microsoft.Capacity/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188?api-version=2020-10-01-preview", + "Location": "https://management.azure.com/Microsoft.Capacity/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188?api-version=2020-10-01-preview", "Retry-After": 5 } } diff --git a/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/reservations.json b/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/reservations.json index dfba93a15ca3..121e2fc61b8f 100644 --- a/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/reservations.json +++ b/specification/reservations/resource-manager/Microsoft.Capacity/preview/2020-10-01-preview/reservations.json @@ -643,7 +643,7 @@ }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { - "final-state-via": "location" + "final-state-via": "azure-async-operation" }, "parameters": [ { @@ -666,9 +666,13 @@ "202": { "description": "The request is accepted and is being processed.", "headers": { + "Azure-AsyncOperation": { + "type": "string", + "description": "URL for checking the ongoing status of the operation." + }, "Location": { "type": "string", - "description": "URL to query for the status of the operation." + "description": "URL for determining when an operation has completed. Only use this value only when Azure-AsyncOperation isn't returned." }, "Retry-After": { "type": "integer", @@ -698,7 +702,7 @@ }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { - "final-state-via": "location" + "final-state-via": "azure-async-operation" }, "parameters": [ { @@ -721,9 +725,13 @@ "202": { "description": "The request is accepted and is being processed.", "headers": { + "Azure-AsyncOperation": { + "type": "string", + "description": "URL for checking the ongoing status of the operation." + }, "Location": { "type": "string", - "description": "URL to query for the status of the operation." + "description": "URL for determining when an operation has completed. Only use this value only when Azure-AsyncOperation isn't returned." }, "Retry-After": { "type": "integer",