-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Added reservation recommendations and tags #2679
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7b927cf
Added Tags filter for budgets and updated the api version
asarkar84 c641158
Updated comments
asarkar84 0e276b2
Incorporated review comments
asarkar84 7be4364
Incorporated review comments
asarkar84 bff7aa7
Incorporated review comment
asarkar84 011c9f0
Merge remote-tracking branch 'upstream/master'
asarkar84 002a6db
Added Tags filter and grouping for UsageDetails
asarkar84 020911c
Merge remote-tracking branch 'upstream/master'
asarkar84 502d70e
Added reservation recommendations and tags
asarkar84 b41bd12
Merge remote-tracking branch 'upstream/master'
asarkar84 7956270
Incorporated review comments
asarkar84 346ce83
Incorporated review comments
asarkar84 a0072f9
Removed unwanted space
asarkar84 ee9bfc3
Removed extra whitespace
asarkar84 6df7a9e
add swagger->sdk config for go
jhendrixMSFT 7a5eab1
fix broken tags for go
jhendrixMSFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added Tags filter and grouping for UsageDetails
Added Tags filter and grouping for UsageDetails
- Loading branch information
commit 002a6dbdb5b9a98d96e17b04b0ce0163bfad8e30
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,12 @@ | |
"x-ms-examples": { | ||
"UsageDetailsList": { | ||
"$ref": "./examples/UsageDetailsList.json" | ||
}, | ||
"UsageDetailsListFilterByTag": { | ||
"$ref": "./examples/UsageDetailsListFilterByTag.json" | ||
}, | ||
"UsageDetailsListGroupByTagDate": { | ||
"$ref": "./examples/UsageDetailsListGroupByTagDate.json" | ||
} | ||
}, | ||
"parameters": [ | ||
|
@@ -62,7 +68,7 @@ | |
}, | ||
{ | ||
"name": "$filter", | ||
"description": "May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.", | ||
"description": "May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. 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" | ||
|
@@ -83,6 +89,18 @@ | |
"minimum": 1, | ||
"maximum": 1000 | ||
}, | ||
{ | ||
"name": "$apply", | ||
"description": "OData apply expression to aggregatie usageDetails by tags or (tags and properties/usageStart)", | ||
"in": "query", | ||
"required": false, | ||
"type": "string", | ||
"x-ms-parameter-location": "method", | ||
"x-ms-parameter-grouping": { | ||
"name": "QueryOptions" | ||
}, | ||
"x-ms-client-name": "Apply" | ||
}, | ||
{ | ||
"$ref": "#/parameters/apiVersionParameter" | ||
} | ||
|
@@ -122,6 +140,9 @@ | |
}, | ||
"UsageDetailsExpand": { | ||
"$ref": "./examples/UsageDetailsExpand.json" | ||
}, | ||
"UsageDetailsListForBillingPeriodGroupByTag": { | ||
"$ref": "./examples/UsageDetailsListForBillingPeriodGroupByTag.json" | ||
} | ||
}, | ||
"parameters": [ | ||
|
@@ -140,11 +161,23 @@ | |
}, | ||
{ | ||
"name": "$filter", | ||
"description": "May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.", | ||
"description": "May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. 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" | ||
}, | ||
{ | ||
"name": "$apply", | ||
"description": "OData apply expression to aggregatie usageDetails by tags or (tags and properties/usageStart) for specified billing period", | ||
"in": "query", | ||
"required": false, | ||
"type": "string", | ||
"x-ms-parameter-location": "method", | ||
"x-ms-parameter-grouping": { | ||
"name": "QueryOptions" | ||
}, | ||
"x-ms-client-name": "Apply" | ||
}, | ||
{ | ||
"name": "$skiptoken", | ||
"description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", | ||
|
@@ -533,6 +566,55 @@ | |
} | ||
} | ||
}, | ||
"/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/reservationRecommendations": { | ||
"get": { | ||
"tags": [ | ||
"ReservationRecommendations" | ||
], | ||
"operationId": "reservationRecommendations_List", | ||
"description": "List of recomendations for purchasing reserved instances.", | ||
"externalDocs": { | ||
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/" | ||
}, | ||
"x-ms-examples": { | ||
"ReservationRecommendations": { | ||
"$ref": "./examples/ReservationRecommendations.json" | ||
}, | ||
"ReservationRecommendationsFilterByScopeLookBackPeriod": { | ||
"$ref": "./examples/ReservationRecommendationsFilterByScopeLookBackPeriod.json" | ||
} | ||
}, | ||
"parameters": [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! Just missed it. I have added it. |
||
{ | ||
"name": "$filter", | ||
"description": "May be used to filter reservationRecommendations by properties/scope and properties/lookBackPeriod.", | ||
"in": "query", | ||
"required": false, | ||
"type": "string" | ||
}, | ||
{ | ||
"$ref": "#/parameters/apiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK. The request has succeeded.", | ||
"schema": { | ||
"$ref": "#/definitions/ReservationRecommendationsListResult" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "#/definitions/ErrorResponse" | ||
} | ||
} | ||
}, | ||
"x-ms-pageable": { | ||
"nextLinkName": "nextLink" | ||
} | ||
} | ||
}, | ||
"/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets": { | ||
"get": { | ||
"tags": [ | ||
|
@@ -1550,6 +1632,66 @@ | |
} | ||
} | ||
}, | ||
"ReservationRecommendationsProperties": { | ||
"description": "The properties of the reservation summaries.", | ||
"properties": { | ||
"reservationOrderId": { | ||
"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.", | ||
"type": "string", | ||
"readOnly": true | ||
}, | ||
"reservationId": { | ||
"description": "The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to which the reservation benefit can be applied to.", | ||
"type": "string", | ||
"readOnly": true | ||
}, | ||
"skuName": { | ||
"description": "This is the ARM Sku name. It can be used to join with the servicetype field in additoinalinfo in usage records.", | ||
"type": "string", | ||
"readOnly": true | ||
}, | ||
"reservedHours": { | ||
"description": "This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days", | ||
"type": "number", | ||
"format": "decimal", | ||
"readOnly": true | ||
} | ||
} | ||
}, | ||
"ReservationRecommendations": { | ||
"description": "reservation recommendations resource.", | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/Resource" | ||
} | ||
], | ||
"properties": { | ||
"properties": { | ||
"x-ms-client-flatten": true, | ||
"$ref": "#/definitions/ReservationRecommendationsProperties", | ||
"title": "Reservation Recommendations properties" | ||
} | ||
} | ||
}, | ||
"ReservationRecommendationsListResult": { | ||
"description": "Result of listing reservation recommendations.", | ||
"properties": { | ||
"value": { | ||
"description": "The list of reservation recommendations.", | ||
"type": "array", | ||
"readOnly": true, | ||
"items": { | ||
"$ref": "#/definitions/ReservationRecommendations" | ||
} | ||
}, | ||
"nextLink": { | ||
"description": "The link (url) to the next page of results.", | ||
"type": "string", | ||
"readOnly": true | ||
} | ||
} | ||
}, | ||
"ReservationDetailsProperties": { | ||
"description": "The properties of the reservation details.", | ||
"properties": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...manager/Microsoft.Consumption/stable/2018-03-31/examples/UsageDetailsListFilterByTag.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2018-03-31", | ||
"subscriptionId": "00000000-0000-0000-0000-000000000000", | ||
"$filter": "tags eq 'dev:tools'" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"value": [ | ||
{ | ||
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/usageDetails/usageDetailsId1", | ||
"name": "usageDetailsId1", | ||
"type": "Microsoft.Consumption/usageDetails", | ||
"tags": { | ||
"dev": "tools" | ||
}, | ||
"properties": { | ||
"billingPeriodId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201702", | ||
"invoiceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/invoices/201703-123456789", | ||
"usageStart": "2017-02-13T00:00:00Z", | ||
"usageEnd": "2017-02-13T23:59:59Z", | ||
"instanceName": "shared1", | ||
"instanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1", | ||
"instanceLocation": "eastasia", | ||
"currency": "USD", | ||
"usageQuantity": 0.00328, | ||
"billableQuantity": 0.00328, | ||
"pretaxCost": 0.67, | ||
"isEstimated": false, | ||
"meterId": "00000000-0000-0000-0000-000000000000" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...ft.Consumption/stable/2018-03-31/examples/UsageDetailsListForBillingPeriodGroupByTag.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2018-03-31", | ||
"subscriptionId": "00000000-0000-0000-0000-000000000000", | ||
"billingPeriodName": "201803", | ||
"$apply": "groupby((tags))" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"value": [ | ||
{ | ||
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/20180301/providers/Microsoft.Consumption/usageDetails/usageDetailsId1", | ||
"name": "usageDetailsId1", | ||
"type": "Microsoft.Consumption/usageDetails", | ||
"tags": { | ||
"description": "Azure VCAP STA - RDS Server" | ||
}, | ||
"properties": { | ||
"billingPeriodId": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/20180301", | ||
"usageQuantity": 11.11111, | ||
"pretaxCost": 0, | ||
"currency": "USD" | ||
} | ||
}, | ||
{ | ||
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/20180301/providers/Microsoft.Consumption/usageDetails/usageDetailsId1", | ||
"name": "usageDetailsId1", | ||
"type": "Microsoft.Consumption/usageDetails", | ||
"tags": { | ||
"description": "Domain controller - STA" | ||
}, | ||
"properties": { | ||
"billingPeriodId": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/20180301", | ||
"usageQuantity": 111.11111111111, | ||
"pretaxCost": 0, | ||
"currency": "USD" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...ager/Microsoft.Consumption/stable/2018-03-31/examples/UsageDetailsListGroupByTagDate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2018-03-31", | ||
"subscriptionId": "00000000-0000-0000-0000-000000000000", | ||
"$apply": "groupby((tags,properties/usageStart))" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"value": [ | ||
{ | ||
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/20180301/providers/Microsoft.Consumption/usageDetails/usageDetailsId1", | ||
"name": "usageDetailsId1", | ||
"type": "Microsoft.Consumption/usageDetails", | ||
"tags": { | ||
"description": "Azure VCAP STA - RDS Server" | ||
}, | ||
"properties": { | ||
"billingPeriodId": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/20180301", | ||
"usageStart": "2018-03-01T00:00:00.0000000Z", | ||
"usageEnd": "2018-03-01T23:59:59.0000000Z", | ||
"usageQuantity": 11.11111, | ||
"pretaxCost": 0, | ||
"currency": "USD" | ||
} | ||
}, | ||
{ | ||
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/20180301/providers/Microsoft.Consumption/usageDetails/usageDetailsId1", | ||
"name": "usageDetailsId1", | ||
"type": "Microsoft.Consumption/usageDetails", | ||
"tags": { | ||
"description": "Domain controller - STA" | ||
}, | ||
"properties": { | ||
"billingPeriodId": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/20180301", | ||
"usageStart": "2018-03-01T00:00:00.0000000Z", | ||
"usageEnd": "2018-03-01T23:59:59.0000000Z", | ||
"usageQuantity": 1.11111111111, | ||
"pretaxCost": 0, | ||
"currency": "USD" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be "ReservationRecommendations_List" (upper-case 'r').
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Corrected.