Skip to content

Commit 4314c1c

Browse files
authored
[Hub Generated] Review request for Microsoft.Consumption to add version stable/2019-10-01 (#9670)
* Adding GTM reservation transactions API * update * updating examples * updating examples * adding scope parameter * updating examples * prettifying * updates * Adding missing property in examples * updates * prettify examples * Removing LegacyReservationTransactionsListResult * Removing updates to ReservationTransactions at BillingAccount scope * updates * updating example * removing extra property
1 parent 68bd022 commit 4314c1c

File tree

3 files changed

+279
-9
lines changed

3 files changed

+279
-9
lines changed

specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json

Lines changed: 234 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,8 +1129,8 @@
11291129
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/"
11301130
},
11311131
"x-ms-examples": {
1132-
"ReservationTransaction": {
1133-
"$ref": "./examples/ReservationTransactionsListByBillingAccountId.json"
1132+
"ReservationTransactionsByEnrollmentNumber": {
1133+
"$ref": "./examples/ReservationTransactionsListByEnrollmentNumber.json"
11341134
}
11351135
},
11361136
"parameters": [
@@ -1167,6 +1167,58 @@
11671167
}
11681168
}
11691169
},
1170+
"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/reservationTransactions": {
1171+
"get": {
1172+
"tags": [
1173+
"ReservationTransactions"
1174+
],
1175+
"operationId": "ReservationTransactions_ListByBillingProfile",
1176+
"description": "List of transactions for reserved instances on billing account scope",
1177+
"externalDocs": {
1178+
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/"
1179+
},
1180+
"x-ms-examples": {
1181+
"ReservationTransactionsByBillingProfileId": {
1182+
"$ref": "./examples/ReservationTransactionsListByBillingProfileId.json"
1183+
}
1184+
},
1185+
"parameters": [
1186+
{
1187+
"name": "$filter",
1188+
"description": "Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' ",
1189+
"in": "query",
1190+
"required": false,
1191+
"type": "string"
1192+
},
1193+
{
1194+
"$ref": "#/parameters/apiVersionParameter"
1195+
},
1196+
{
1197+
"$ref": "#/parameters/billingAccountIdParameter"
1198+
},
1199+
{
1200+
"$ref": "#/parameters/billingProfileIdParameter"
1201+
}
1202+
],
1203+
"responses": {
1204+
"200": {
1205+
"description": "OK. The request has succeeded.",
1206+
"schema": {
1207+
"$ref": "#/definitions/ModernReservationTransactionsListResult"
1208+
}
1209+
},
1210+
"default": {
1211+
"description": "Error response describing why the operation failed.",
1212+
"schema": {
1213+
"$ref": "#/definitions/ErrorResponse"
1214+
}
1215+
}
1216+
},
1217+
"x-ms-pageable": {
1218+
"nextLinkName": "nextLink"
1219+
}
1220+
}
1221+
},
11701222
"/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default": {
11711223
"get": {
11721224
"tags": [
@@ -3327,8 +3379,156 @@
33273379
}
33283380
}
33293381
},
3330-
"ReservationTransactionProperties": {
3331-
"default": "The properties of the reservation transaction.",
3382+
"ModernReservationTransactionProperties": {
3383+
"description": "The properties of a modern reservation transaction.",
3384+
"properties": {
3385+
"amount": {
3386+
"description": "The charge of the transaction.",
3387+
"type": "number",
3388+
"format": "decimal",
3389+
"readOnly": true
3390+
},
3391+
"armSkuName": {
3392+
"description": "This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.",
3393+
"type": "string",
3394+
"readOnly": true
3395+
},
3396+
"billingFrequency": {
3397+
"description": "The billing frequency, which can be either one-time or recurring.",
3398+
"type": "string",
3399+
"readOnly": true
3400+
},
3401+
"billingProfileId": {
3402+
"description": "Billing profile Id.",
3403+
"type": "string",
3404+
"readOnly": true
3405+
},
3406+
"billingProfileName": {
3407+
"description": "Billing profile name.",
3408+
"type": "string",
3409+
"readOnly": true
3410+
},
3411+
"currency": {
3412+
"description": "The ISO currency in which the transaction is charged, for example, USD.",
3413+
"type": "string",
3414+
"readOnly": true
3415+
},
3416+
"description": {
3417+
"description": "The description of the transaction.",
3418+
"type": "string",
3419+
"readOnly": true
3420+
},
3421+
"eventDate": {
3422+
"description": "The date of the transaction",
3423+
"type": "string",
3424+
"format": "date-time",
3425+
"readOnly": true
3426+
},
3427+
"eventType": {
3428+
"description": "The type of the transaction (Purchase, Cancel, etc.)",
3429+
"type": "string",
3430+
"readOnly": true
3431+
},
3432+
"invoice": {
3433+
"description": "Invoice Number",
3434+
"type": "string",
3435+
"readOnly": true
3436+
},
3437+
"invoiceId": {
3438+
"description": "Invoice Id as on the invoice where the specific transaction appears.",
3439+
"type": "string",
3440+
"readOnly": true
3441+
},
3442+
"invoiceSectionId": {
3443+
"description": "Invoice Section Id",
3444+
"type": "string",
3445+
"readOnly": true
3446+
},
3447+
"invoiceSectionName": {
3448+
"description": "Invoice Section Name.",
3449+
"type": "string",
3450+
"readOnly": true
3451+
},
3452+
"purchasingSubscriptionGuid": {
3453+
"description": "The subscription guid that makes the transaction.",
3454+
"type": "string",
3455+
"format": "uuid",
3456+
"readOnly": true
3457+
},
3458+
"purchasingSubscriptionName": {
3459+
"description": "The subscription name that makes the transaction.",
3460+
"type": "string",
3461+
"readOnly": true
3462+
},
3463+
"quantity": {
3464+
"description": "The quantity of the transaction.",
3465+
"type": "number",
3466+
"format": "decimal",
3467+
"readOnly": true
3468+
},
3469+
"region": {
3470+
"description": "The region of the transaction.",
3471+
"type": "string",
3472+
"readOnly": true
3473+
},
3474+
"reservationOrderId": {
3475+
"description": "The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.",
3476+
"type": "string",
3477+
"readOnly": true
3478+
},
3479+
"reservationOrderName": {
3480+
"description": "The name of the reservation order.",
3481+
"type": "string",
3482+
"readOnly": true
3483+
},
3484+
"term": {
3485+
"description": "This is the term of the transaction.",
3486+
"type": "string",
3487+
"readOnly": true
3488+
}
3489+
}
3490+
},
3491+
"ModernReservationTransaction": {
3492+
"description": "Modern Reservation transaction resource.",
3493+
"type": "object",
3494+
"x-ms-discriminator-value": "Modern",
3495+
"allOf": [
3496+
{
3497+
"$ref": "#/definitions/Resource"
3498+
}
3499+
],
3500+
"properties": {
3501+
"properties": {
3502+
"x-ms-client-flatten": true,
3503+
"$ref": "#/definitions/ModernReservationTransactionProperties",
3504+
"title": "Reservation Transaction properties"
3505+
}
3506+
},
3507+
"required": [
3508+
"properties"
3509+
]
3510+
},
3511+
"LegacyReservationTransaction": {
3512+
"description": "Legacy Reservation transaction resource.",
3513+
"type": "object",
3514+
"allOf": [
3515+
{
3516+
"$ref": "#/definitions/ReservationTransaction"
3517+
}
3518+
],
3519+
"properties": {
3520+
"properties": {
3521+
"x-ms-client-flatten": true,
3522+
"$ref": "#/definitions/LegacyReservationTransactionProperties",
3523+
"title": "Reservation Transaction properties"
3524+
}
3525+
},
3526+
"required": [
3527+
"properties"
3528+
]
3529+
},
3530+
"LegacyReservationTransactionProperties": {
3531+
"description": "The properties of a legacy reservation transaction.",
33323532
"properties": {
33333533
"eventDate": {
33343534
"description": "The date of the transaction",
@@ -3447,16 +3647,16 @@
34473647
"properties": {
34483648
"properties": {
34493649
"x-ms-client-flatten": true,
3450-
"$ref": "#/definitions/ReservationTransactionProperties",
3650+
"$ref": "#/definitions/LegacyReservationTransactionProperties",
34513651
"title": "Reservation Transaction properties"
34523652
}
34533653
}
34543654
},
34553655
"ReservationTransactionsListResult": {
3456-
"description": "Result of listing reservation transactions",
3656+
"description": "Result of listing reservation recommendations.",
34573657
"properties": {
34583658
"value": {
3459-
"description": "The list of reservation transactions.",
3659+
"description": "The list of reservation recommendations.",
34603660
"type": "array",
34613661
"readOnly": true,
34623662
"items": {
@@ -3470,6 +3670,24 @@
34703670
}
34713671
}
34723672
},
3673+
"ModernReservationTransactionsListResult": {
3674+
"description": "Result of listing reservation recommendations.",
3675+
"properties": {
3676+
"value": {
3677+
"description": "The list of reservation recommendations.",
3678+
"type": "array",
3679+
"readOnly": true,
3680+
"items": {
3681+
"$ref": "#/definitions/ModernReservationTransaction"
3682+
}
3683+
},
3684+
"nextLink": {
3685+
"description": "The link (url) to the next page of results.",
3686+
"type": "string",
3687+
"readOnly": true
3688+
}
3689+
}
3690+
},
34733691
"TagsResult": {
34743692
"description": "A resource listing all tags.",
34753693
"type": "object",
@@ -4739,6 +4957,15 @@
47394957
"x-ms-parameter-location": "method",
47404958
"x-ms-skip-url-encoding": true
47414959
},
4960+
"scopeReservationTransactionsParameter": {
4961+
"name": "scope",
4962+
"in": "path",
4963+
"required": true,
4964+
"type": "string",
4965+
"description": "The scope associated with reservation transactions operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount/Enrollment scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope",
4966+
"x-ms-parameter-location": "method",
4967+
"x-ms-skip-url-encoding": true
4968+
},
47424969
"apiVersionParameter": {
47434970
"name": "api-version",
47444971
"in": "query",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"parameters": {
3+
"api-version": "2019-10-01",
4+
"$filter": "properties/eventDate+ge+2020-05-20+AND+properties/eventDate+le+2020-05-30",
5+
"billingAccountId": "fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30",
6+
"billingProfileId": "Z76D-SGAF-BG7-TGB"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "/providers/Microsoft.Billing/billingAccounts/fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30/billingProfiles/Z76D-SGAF-BG7-TGB/providers/Microsoft.Consumption/reservationTransactions",
14+
"name": "a838a8c3-a408-49e1-ac90-42cb95bff9b2",
15+
"type": "Microsoft.Consumption/reservationTransactions",
16+
"properties": {
17+
"eventDate": "2020-04-25T21:21:38Z",
18+
"reservationOrderId": "a838a8c3-a408-49e1-ac90-42cb95bff9b2",
19+
"description": "Reserved VM Instance, Standard_B1ls, US East, 3 Years",
20+
"eventType": "Purchase",
21+
"quantity": 1,
22+
"amount": 1.44,
23+
"currency": "USD",
24+
"reservationOrderName": "VM_RI_03-25-2020_14-18",
25+
"armSkuName": "Standard_B1ls",
26+
"billingFrequency": "Recurring",
27+
"billingProfileId": "/providers/Microsoft.Billing/billingAccounts/fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30/billingProfiles/Z76D-SGAF-BG7-TGB",
28+
"billingProfileName": "IT Department*",
29+
"invoice": "T000456437",
30+
"invoiceId": "/providers/Microsoft.Billing/billingAccounts/fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30/billingProfiles/Z76D-SGAF-BG7-TGB/invoices/T000456437",
31+
"invoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30/invoiceSections/QBTB-EYAK-PJA-TGB",
32+
"invoiceSectionName": "IT Department",
33+
"purchasingSubscriptionGuid": "d924ad15-4a3d-4047-971d-c8b1b300a97b",
34+
"purchasingSubscriptionName": "contoso",
35+
"region": "eastus",
36+
"term": "P3Y"
37+
}
38+
}
39+
]
40+
}
41+
}
42+
}
43+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"parameters": {
33
"api-version": "2019-10-01",
4-
"billingAccountId": "123456",
5-
"$filter": "properties/eventDate ge 2019-09-09 AND properties/eventDate le 2019-09-10"
4+
"$filter": "properties/eventDate+ge+2020-05-20+AND+properties/eventDate+le+2020-05-30",
5+
"billingAccountId": "123456"
66
},
77
"responses": {
88
"200": {

0 commit comments

Comments
 (0)