From 16172063933c0e380b5e8ec249e679fa8fbd6c79 Mon Sep 17 00:00:00 2001 From: Todd Moscinski Date: Thu, 15 Jul 2021 13:56:40 -0500 Subject: [PATCH] Fixing S360 swagger issues --- .../examples/CalculateReservationOrder.json | 70 +++++++++ .../stable/2021-07-01/reservations.json | 145 +++++++++++++++++- 2 files changed, 213 insertions(+), 2 deletions(-) create mode 100644 specification/reservations/resource-manager/Microsoft.Capacity/stable/2021-07-01/examples/CalculateReservationOrder.json diff --git a/specification/reservations/resource-manager/Microsoft.Capacity/stable/2021-07-01/examples/CalculateReservationOrder.json b/specification/reservations/resource-manager/Microsoft.Capacity/stable/2021-07-01/examples/CalculateReservationOrder.json new file mode 100644 index 000000000000..44c41345ca3a --- /dev/null +++ b/specification/reservations/resource-manager/Microsoft.Capacity/stable/2021-07-01/examples/CalculateReservationOrder.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "api-version": "2021-07-01", + "body": { + "sku": { + "name": "standard_D1" + }, + "location": "westus", + "properties": { + "reservedResourceType": "VirtualMachines", + "billingScopeId": "/subscriptions/ed3a1871-612d-abcd-a849-c2542a68be83", + "term": "P1Y", + "billingPlan": "Monthly", + "quantity": 1, + "displayName": "TestReservationOrder", + "appliedScopes": null, + "appliedScopeType": "Shared", + "reservedResourceProperties": { + "instanceFlexibility": "On" + } + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "billingCurrencyTotal": { + "currencyCode": "USD", + "amount": 46.0 + }, + "reservationOrderId": "6d9cec54-7de8-abcd-9de7-80f5d634f2d2", + "skuTitle": "Reserved VM Instance, Standard_D1, US West, 1 Year", + "skuDescription": "standard_D1", + "pricingCurrencyTotal": { + "currencyCode": "USD", + "amount": 46.0 + }, + "paymentSchedule": [ + { + "dueDate": "2019-05-14", + "pricingCurrencyTotal": { + "currencyCode": "USD", + "amount": 46 + }, + "billingCurrencyTotal": { + "currencyCode": "EUR", + "amount": 40 + } + }, + { + "dueDate": "2019-06-14", + "pricingCurrencyTotal": { + "currencyCode": "USD", + "amount": 46 + } + }, + { + "dueDate": "2019-07-14", + "pricingCurrencyTotal": { + "currencyCode": "USD", + "amount": 46 + } + } + ] + } + } + } + } +} diff --git a/specification/reservations/resource-manager/Microsoft.Capacity/stable/2021-07-01/reservations.json b/specification/reservations/resource-manager/Microsoft.Capacity/stable/2021-07-01/reservations.json index de66493b4df9..03c4db0ffaad 100644 --- a/specification/reservations/resource-manager/Microsoft.Capacity/stable/2021-07-01/reservations.json +++ b/specification/reservations/resource-manager/Microsoft.Capacity/stable/2021-07-01/reservations.json @@ -109,6 +109,43 @@ } } }, + "/providers/Microsoft.Capacity/calculatePrice": { + "post": { + "summary": "Calculate price for a `ReservationOrder`.", + "description": "Calculate price for placing a `ReservationOrder`.", + "operationId": "ReservationOrder_Calculate", + "x-ms-examples": { + "Purchase": { + "$ref": "./examples/CalculateReservationOrder.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/PurchaseParameter" + } + ], + "tags": [ + "Reservation, Calculate" + ], + "responses": { + "200": { + "description": "Detailed price info for purchasing `ReservationOrder`", + "schema": { + "$ref": "#/definitions/CalculatePriceResponse" + } + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, "/providers/Microsoft.Capacity/reservationOrders": { "get": { "summary": "Get all `ReservationOrder`s.", @@ -852,6 +889,18 @@ "$ref": "#/definitions/SkuProperty" } }, + "msrp": { + "type": "object", + "readOnly": true, + "description": "Pricing information about the SKU", + "properties": { + "p1Y": { + "type": "object", + "$ref": "#/definitions/Price", + "description": "Amount in pricing currency. Tax not included." + } + } + }, "restrictions": { "type": "array", "readOnly": true, @@ -1238,7 +1287,8 @@ "description": "Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked price 30 days before expiry.", "properties": { "currencyCode": { - "type": "string" + "type": "string", + "description": "The ISO 4217 3-letter currency code for the currency used by this purchase record." }, "amount": { "type": "number" @@ -1250,7 +1300,8 @@ "description": "Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included.", "properties": { "currencyCode": { - "type": "string" + "type": "string", + "description": "The ISO 4217 3-letter currency code for the currency used by this purchase record." }, "amount": { "type": "number" @@ -1291,6 +1342,14 @@ "description": "The applied scope type", "$ref": "#/definitions/AppliedScopeType" }, + "archived": { + "description": "Indicates if the reservation is archived", + "type": "boolean" + }, + "capabilities": { + "description": "Capabilities of the reservation", + "type": "string" + }, "quantity": { "description": "Quantity of the SKUs that are part of the Reservation.", "$ref": "#/definitions/ReservationQuantity" @@ -1882,6 +1941,88 @@ "name": "OperationStatus", "modelAsString": true } + }, + "CalculatePriceResponse": { + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/CalculatePriceResponseProperties" + } + } + }, + "CalculatePriceResponseProperties": { + "type": "object", + "properties": { + "billingCurrencyTotal": { + "type": "object", + "description": "Currency and amount that customer will be charged in customer's local currency. Tax is not included.", + "properties": { + "currencyCode": { + "type": "string", + "description": "The ISO 4217 3-letter currency code for the currency used by this purchase record." + }, + "amount": { + "type": "number", + "description": "Amount in pricing currency. Tax is not included.", + "format": "double" + } + } + }, + "netTotal": { + "type": "number", + "description": "Net total amount in pricing currency.", + "format": "double" + }, + "taxTotal": { + "type": "number", + "description": "Tax amount in pricing currency.", + "format": "double" + }, + "grandTotal": { + "type": "number", + "description": "Total amount in pricing currency.", + "format": "double" + }, + "isTaxIncluded": { + "type": "boolean", + "description": "Whether or not tax is included in grand total" + }, + "isBillingPartnerManaged": { + "description": "True if billing is managed by Microsoft Partner. Used only for CSP accounts.", + "type": "boolean" + }, + "reservationOrderId": { + "description": "GUID that represents reservation order that can be placed after calculating price.", + "type": "string" + }, + "skuTitle": { + "description": "Title of SKU that is being purchased.", + "type": "string" + }, + "skuDescription": { + "description": "Description of SKU that is being purchased.", + "type": "string" + }, + "pricingCurrencyTotal": { + "type": "object", + "description": "Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.", + "properties": { + "currencyCode": { + "type": "string", + "description": "The ISO 4217 3-letter currency code for the currency used by this purchase record." + }, + "amount": { + "type": "number" + } + } + }, + "paymentSchedule": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentDetail" + } + } + } } }, "parameters": {