Skip to content

Commit cd81045

Browse files
authored
Adding Lots by Customer (#17888)
* Adding Lots by Customer * Prettier fix * Fixing Semantic * Fixing Semantic * Fixing Semantic * Update consumption.json * Fixing PR comments * Deleting properties not allowed
1 parent b21e8f9 commit cd81045

File tree

4 files changed

+178
-1
lines changed

4 files changed

+178
-1
lines changed

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

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,11 @@
14251425
],
14261426
"operationId": "Operations_List",
14271427
"description": "Lists all of the available consumption REST API operations.",
1428+
"x-ms-examples": {
1429+
"PriceSheetForBillingPeriod": {
1430+
"$ref": "./examples/OperationList.json"
1431+
}
1432+
},
14281433
"parameters": [
14291434
{
14301435
"$ref": "#/parameters/apiVersionParameter"
@@ -1740,6 +1745,61 @@
17401745
}
17411746
}
17421747
},
1748+
"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}/providers/Microsoft.Consumption/lots": {
1749+
"get": {
1750+
"tags": [
1751+
"Lots"
1752+
],
1753+
"operationId": "Lots_ListByCustomer",
1754+
"description": "Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile and a customer. Microsoft Azure consumption commitments are only supported for the billing account scope.",
1755+
"externalDocs": {
1756+
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/"
1757+
},
1758+
"x-ms-examples": {
1759+
"LotsListByCustomer": {
1760+
"$ref": "./examples/LotsListByCustomer.json"
1761+
},
1762+
"LotsListByCustomerWithFilter": {
1763+
"$ref": "./examples/LotsListByCustomerWithFilters.json"
1764+
}
1765+
},
1766+
"parameters": [
1767+
{
1768+
"$ref": "#/parameters/billingAccountIdParameter"
1769+
},
1770+
{
1771+
"$ref": "#/parameters/customerIdParameter"
1772+
},
1773+
{
1774+
"$ref": "#/parameters/apiVersionParameter"
1775+
},
1776+
{
1777+
"name": "$filter",
1778+
"description": "May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. Tag filter is a key value pair string where key and value is separated by a colon (:).",
1779+
"in": "query",
1780+
"required": false,
1781+
"type": "string"
1782+
}
1783+
],
1784+
"responses": {
1785+
"200": {
1786+
"description": "OK. The request has succeeded.",
1787+
"schema": {
1788+
"$ref": "#/definitions/Lots"
1789+
}
1790+
},
1791+
"default": {
1792+
"description": "Error response describing why the operation failed.",
1793+
"schema": {
1794+
"$ref": "#/definitions/ErrorResponse"
1795+
}
1796+
}
1797+
},
1798+
"x-ms-pageable": {
1799+
"nextLinkName": "nextLink"
1800+
}
1801+
}
1802+
},
17431803
"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary": {
17441804
"get": {
17451805
"tags": [
@@ -3775,7 +3835,6 @@
37753835
"ModernReservationTransaction": {
37763836
"description": "Modern Reservation transaction resource.",
37773837
"type": "object",
3778-
"x-ms-discriminator-value": "Modern",
37793838
"allOf": [
37803839
{
37813840
"$ref": "#/definitions/ReservationTransactionResource"
@@ -5539,6 +5598,14 @@
55395598
"type": "string",
55405599
"x-ms-parameter-location": "method"
55415600
},
5601+
"customerIdParameter": {
5602+
"name": "customerId",
5603+
"in": "path",
5604+
"description": "Customer ID",
5605+
"required": true,
5606+
"type": "string",
5607+
"x-ms-parameter-location": "method"
5608+
},
55425609
"departmentIdParameter": {
55435610
"name": "departmentId",
55445611
"in": "path",
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"parameters": {
3+
"api-version": "2021-05-01",
4+
"billingAccountId": "1234:5678",
5+
"customerId": "1234:5678"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {
10+
"value": [
11+
{
12+
"id": "/providers/Microsoft.Billing/billingAccounts/1234/customers/456/providers/Microsoft.Consumption/lots/lot1",
13+
"name": "lot1",
14+
"type": "Microsoft.Consumption/lots",
15+
"properties": {
16+
"originalAmount": {
17+
"currency": "USD",
18+
"value": 5000.00
19+
},
20+
"closedBalance": {
21+
"currency": "USD",
22+
"value": 60.90
23+
},
24+
"source": "PurchasedCredit",
25+
"startDate": "2021-05-01T00:00:00Z",
26+
"expirationDate": "2021-05-01T00:00:00Z",
27+
"poNumber": "3524"
28+
}
29+
},
30+
{
31+
"id": "/providers/Microsoft.Billing/billingAccounts/1234/customers/456/providers/Microsoft.Consumption/lots/lot2",
32+
"name": "lot2",
33+
"type": "Microsoft.Consumption/lots",
34+
"properties": {
35+
"originalAmount": {
36+
"currency": "USD",
37+
"value": 6000.00
38+
},
39+
"closedBalance": {
40+
"currency": "USD",
41+
"value": 80.90
42+
},
43+
"source": "PurchasedCredit",
44+
"startDate": "2021-05-01T00:00:00Z",
45+
"expirationDate": "2019-12-31T00:00:00Z",
46+
"poNumber": "31224"
47+
}
48+
}
49+
]
50+
}
51+
}
52+
}
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parameters": {
3+
"api-version": "2021-05-01",
4+
"billingAccountId": "1234:5678",
5+
"customerId": "1234:5678",
6+
"$filter": "status eq 'active' AND source eq 'consumptioncommitment'"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "/providers/Microsoft.Billing/billingAccounts/1234/customers/456/providers/Microsoft.Consumption/lots/lot1",
14+
"name": "lot1",
15+
"type": "Microsoft.Consumption/lots",
16+
"properties": {
17+
"originalAmount": {
18+
"currency": "USD",
19+
"value": 5000.00
20+
},
21+
"closedBalance": {
22+
"currency": "USD",
23+
"value": 60.90
24+
},
25+
"source": "PurchasedCredit",
26+
"startDate": "2021-05-01T00:00:00Z",
27+
"expirationDate": "2021-05-01T00:00:00Z",
28+
"poNumber": "3524"
29+
}
30+
}
31+
]
32+
}
33+
}
34+
}
35+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"parameters": {
3+
"api-version": "2021-10-01"
4+
},
5+
"responses": {
6+
"200": {
7+
"body": {
8+
"value": [
9+
{
10+
"name": "Microsoft.Consumption/Operation",
11+
"display": {
12+
"provider": "Microsoft Azure Distributed Managed Service",
13+
"resource": "Managed Applications",
14+
"operation": "Create or Update Managed Applications",
15+
"description": "Create or Update Managed Applications"
16+
}
17+
}
18+
]
19+
}
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)