Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTM billing api for getting reservation Transactions by invoice section. #5475

Merged
merged 8 commits into from
Apr 3, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,72 @@
}
}
},
"/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transactions": {
Copy link
Member

@majastrz majastrz Mar 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transactions [](start = 108, length = 12)

I noticed that this doesn't have a corresponding GET for a single transaction. I'm also noticing the same pattern on all the other ones that was already approved, so I can't really block based on that.

However, this is a violation of the Resource Provider Contract. Can we get that fixed?

"get": {
"tags": [
"Transactions"
],
"operationId": "TransactionsByInvoiceSection",
msft-adrianma marked this conversation as resolved.
Show resolved Hide resolved
"description": "Lists the transactions by invoiceSectionName for given start date and end date.",
"externalDocs": {
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/"
},
"x-ms-examples": {
"TransactionsListByInvoiceSection": {
"$ref": "./examples/TransactionsListByInvoiceSection.json"
},
"ReservationTransactionsListByInvoiceSection": {
"$ref": "./examples/ReservationTransactionsListByInvoiceSection.json"
}
},
"parameters": [
{
"$ref": "#/parameters/billingAccountNameParameter"
},
{
"$ref": "#/parameters/invoiceSectionNameParameter"
},
{
"$ref": "#/parameters/apiVersionParameter"
},
{
"name": "startDate",
"in": "query",
"description": "Start date",
"required": true,
"type": "string"
},
{
"name": "endDate",
"in": "query",
"description": "End date",
"required": true,
"type": "string"
},
{
"name": "$filter",
"description": "May be used to filter by transaction kind. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).",
"in": "query",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/TransactionsListResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default": {
"get": {
"tags": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
"body": {
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/BillingProfiles/42425/transactions/transactionSummaryId1",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/transactions/transactionSummaryId1",
"name": "transactionSummaryId1",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "all",
"kind": "reservation",
"date": "2018-04-23T00:00:00Z",
"invoice": "2344233",
"orderName": "Contoso Reserved",
"orderId": "6d8e7ed9-d3be-48b0-8c7a-e19246a6d30c",
"productDescription": "Standard D1, US West 3",
"transactionType": "Cancel",
"transactionAmount":
"transactionAmount":
{
"currency": "USD",
"value": 5000.00
Expand All @@ -38,18 +38,18 @@
}
},
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/BillingProfiles/42425/transactions/transactionSummaryId2",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/transactions/transactionSummaryId2",
"name": "transactionSummaryId2",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "all",
"kind": "reservation",
"date": "2018-05-05T00:00:00Z",
"invoice": "Pending",
"orderName": "MSFT Reserved",
"orderId": "1c24006f-8350-4315-ad8f-6d11180448f9",
"productDescription": "Standard D1, US West 3",
"transactionType": "Purchase",
"transactionAmount":
"transactionAmount":
{
"currency": "USD",
"value": 6000.00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"name": "transactionSummaryId1",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "all",
"kind": "reservation",
"date": "2018-04-23T00:00:00Z",
"invoice": "2344233",
"orderName": "Contoso Reserved",
Expand All @@ -30,7 +30,7 @@
"quantity": 4,
"invoiceSectionId": "123456",
"invoiceSectionName": "Contoso operations invoiceSection",
"billingProfileId": "789456",
"billingProfileId": "42425",
"billingProfileName": "Contoso operations billing",
"subscriptionId": "789456",
"subscriptionName": "Contoso operations billing"
Expand All @@ -41,7 +41,7 @@
"name": "transactionSummaryId2",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "all",
"kind": "reservation",
"date": "2018-05-05T00:00:00Z",
"invoice": "Pending",
"orderName": "MSFT Reserved",
Expand All @@ -55,7 +55,7 @@
"quantity": 5,
"invoiceSectionId": "123456",
"invoiceSectionName": "Contoso operations invoiceSection",
"billingProfileId": "789456",
"billingProfileId": "42425",
"billingProfileName": "Contoso operations billing",
"subscriptionId": "789456",
"subscriptionName": "Contoso operations billing"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"parameters": {
"api-version": "2018-11-01-preview",
"billingAccountId": "1234",
"invoiceSectionId": "42425",
"startDate": "2018-04-01",
"endDate": "2018-05-30",
"$filter": "properties/kind eq 'Reservation'"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/InvoiceSection/42425/transactions/transactionSummaryId1",
"name": "transactionSummaryId1",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "reservation",
"date": "2018-04-23T00:00:00Z",
"invoice": "2344233",
"orderName": "Contoso Reserved",
"orderId": "6d8e7ed9-d3be-48b0-8c7a-e19246a6d30c",
"productDescription": "Standard D1, US West 3",
"transactionType": "Cancel",
"transactionAmount": {
"currency": "USD",
"value": 5000.00
},
"quantity": 4,
"invoiceSectionId": "42425",
"invoiceSectionName": "Contoso operations invoiceSection",
"billingProfileId": "789456",
"billingProfileName": "Contoso operations billing",
"subscriptionId": "789456",
"subscriptionName": "Contoso operations billing"
}
},
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/InvoiceSection/42425/transactions/transactionSummaryId2",
"name": "transactionSummaryId2",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "reservation",
"date": "2018-05-05T00:00:00Z",
"invoice": "Pending",
"orderName": "MSFT Reserved",
"orderId": "1c24006f-8350-4315-ad8f-6d11180448f9",
"productDescription": "Standard D1, US West 3",
"transactionType": "Purchase",
"transactionAmount": {
"currency": "USD",
"value": 6000.00
},
"quantity": 5,
"invoiceSectionId": "42425",
"invoiceSectionName": "Contoso operations invoiceSection",
"billingProfileId": "789456",
"billingProfileName": "Contoso operations billing",
"subscriptionId": "789456",
"subscriptionName": "Contoso operations billing"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"body": {
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/BillingProfiles/42425/transactions/transactionSummaryId1",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/transactions/transactionSummaryId1",
"name": "transactionSummaryId1",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "reservation",
"kind": "all",
"date": "2018-05-01T00:00:00Z",
"invoice": "2344233",
"displayName": "afweaf",
Expand All @@ -33,11 +33,11 @@
}
},
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/BillingProfiles/42425/transactions/transactionSummaryId2",
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/transactions/transactionSummaryId2",
"name": "transactionSummaryId2",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "reservation",
"kind": "all",
"date": "2018-04-01T00:00:00Z",
"invoice": "pending",
"displayName": "afweaf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"name": "transactionSummaryId1",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "reservation",
"kind": "all",
"date": "2018-05-01T00:00:00Z",
"invoice": "2344233",
"productTypeId": "A12345",
"productType": "Reservered VM Instance",
"productType": "VM Instance",
"productDescription": "Standard D1, US West 3",
"transactionType": "Purchase",
"transactionAmount": {
Expand All @@ -28,7 +28,7 @@
},
"invoiceSectionId": "123456",
"invoiceSectionName": "Contoso operations invoiceSection",
"billingProfileId": "789456",
"billingProfileId": "42425",
"billingProfileName": "Contoso operations billing"
}
},
Expand All @@ -37,11 +37,11 @@
"name": "transactionSummaryId2",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "reservation",
"kind": "all",
"date": "2018-04-01T00:00:00Z",
"invoice": "pending",
"productTypeId": "A12345",
"productType": "Reservered VM Instance",
"productType": "VM Instance",
"productDescription": "Standard Support",
"transactionType": "Cancel",
"transactionAmount": {
Expand All @@ -50,7 +50,7 @@
},
"invoiceSectionId": "123456",
"invoiceSectionName": "Contoso operations invoiceSection",
"billingProfileId": "789456",
"billingProfileId": "42425",
"billingProfileName": "Contoso operations billing"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"parameters": {
"api-version": "2018-11-01-preview",
"billingAccountId": "1234",
"invoiceSectionId": "42425",
"startDate": "2018-04-01",
"endDate": "2018-05-30"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/InvoiceSection/42425/transactions/transactionSummaryId1",
"name": "transactionSummaryId1",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "all",
"date": "2018-05-01T00:00:00Z",
"invoice": "2344233",
"productTypeId": "A12345",
"productType": "Reserved VM Instance",
"productDescription": "Standard D1, US West 3",
"transactionType": "Purchase",
"transactionAmount": {
"currency": "USD",
"value": 5000.00
},
"invoiceSectionId": "42425",
"invoiceSectionName": "Contoso operations invoiceSection",
"billingProfileId": "789456",
"billingProfileName": "Contoso operations billing"
}
},
{
"id": "/providers/Microsoft.Billing/BillingAccounts/1234/InvoiceSection/42425/transactions/transactionSummaryId2",
"name": "transactionSummaryId2",
"type": "Microsoft.Billing/transactions",
"properties": {
"kind": "all",
"date": "2018-04-01T00:00:00Z",
"invoice": "pending",
"productTypeId": "A12345",
"productType": "VM Instance",
"productDescription": "Standard Support",
"transactionType": "Cancel",
"transactionAmount": {
"currency": "USD",
"value": 50.00
},
"invoiceSectionId": "42425",
"invoiceSectionName": "Contoso operations invoiceSection",
"billingProfileId": "789456",
"billingProfileName": "Contoso operations billing"
}
}
]
}
}
}
}