-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Added reservation recommendations and tags #2679
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
Changes from all commits
7b927cf
c641158
0e276b2
7be4364
bff7aa7
011c9f0
002a6db
020911c
502d70e
b41bd12
7956270
346ce83
a0072f9
ee9bfc3
6df7a9e
7a5eab1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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,58 @@ | |
| } | ||
| } | ||
| }, | ||
| "/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/ReservationRecommendationsList.json" | ||
| }, | ||
| "ReservationRecommendationsFilterByScopeLookBackPeriod": { | ||
| "$ref": "./examples/ReservationRecommendationsFilterByScopeLookBackPeriod.json" | ||
| } | ||
| }, | ||
| "parameters": [ | ||
| { | ||
| "name": "$filter", | ||
| "description": "May be used to filter reservationRecommendations by properties/scope and properties/lookBackPeriod.", | ||
| "in": "query", | ||
| "required": false, | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/apiVersionParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/subscriptionIdParameter" | ||
| } | ||
| ], | ||
| "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 +1635,99 @@ | |
| } | ||
| } | ||
| }, | ||
| "ReservationRecommendationsProperties": { | ||
| "description": "The properties of the reservation recommendations.", | ||
| "properties": { | ||
| "lookBackPeriod": { | ||
| "description": "The number of days of usage to look back for recommendations.", | ||
| "type": "string", | ||
| "readOnly": true | ||
| }, | ||
| "meterId": { | ||
| "description": "The meter id (GUID)", | ||
| "type": "string", | ||
| "format":"uuid", | ||
| "readOnly": true | ||
| }, | ||
| "term": { | ||
| "description": "RI recommendations in one or three year terms.", | ||
| "type": "string", | ||
| "readOnly": true | ||
| }, | ||
| "costWithNoReservedInstances": { | ||
| "description": "The total amount of cost without reserved instances.", | ||
| "type": "number", | ||
| "format": "decimal", | ||
| "readOnly": true | ||
| }, | ||
| "recommendedQuantity": { | ||
| "description": "Recomended quality for reserved instances.", | ||
| "type": "number", | ||
| "format": "decimal", | ||
| "readOnly": true | ||
| }, | ||
| "totalCostWithReservedInstances": { | ||
| "description": "The total amount of cost with reserved instances.", | ||
| "type": "number", | ||
| "format": "decimal", | ||
| "readOnly": true | ||
| }, | ||
| "netSavings": { | ||
| "description": "Total estimated savings with reserved instances.", | ||
| "type": "number", | ||
| "format": "decimal", | ||
| "readOnly": true | ||
| }, | ||
| "firstUsageDate": { | ||
| "description": "The usage date for looking back.", | ||
| "type": "string", | ||
| "format": "date-time", | ||
|
Member
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. There are still model validation failure regarding this date-time, see the log. Is this supposed to be just date like the others you changed?
Contributor
Author
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. Sorry! Typo error. There was a space in the datetime string example. Just corrected it and waiting for build to complete. |
||
| "readOnly": true | ||
| }, | ||
| "scope": { | ||
| "description": "Shared or single recommendation.", | ||
| "type": "string", | ||
| "readOnly": true | ||
| } | ||
| } | ||
| }, | ||
| "ReservationRecommendations": { | ||
| "description": "Reservation recommendations resource.", | ||
| "type": "object", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/Resource" | ||
| }, | ||
| { | ||
| "$ref": "#/definitions/ResourceAttributes" | ||
| } | ||
| ], | ||
| "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": { | ||
|
|
@@ -1937,6 +2115,21 @@ | |
| }, | ||
| "x-ms-azure-resource": true | ||
| }, | ||
| "ResourceAttributes": { | ||
| "description": "The Resource model definition.", | ||
| "properties": { | ||
| "location": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "Resource location" | ||
| }, | ||
| "sku": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "Resource sku" | ||
| } | ||
| } | ||
| }, | ||
| "ProxyResource": { | ||
| "description": "The Resource model definition.", | ||
| "properties": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2018-03-31", | ||
| "subscriptionId": "00000000-0000-0000-0000-000000000000", | ||
| "$filter": "properties/scope eq 'Single' AND properties/lookBackPeriod eq 'Last7Days'" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "value": [ | ||
| { | ||
| "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/reservationRecommendations/reservationRecommendations1", | ||
| "name": "reservationRecommendations1", | ||
| "type": "Microsoft.Consumption/reservationRecommendations", | ||
| "sku": "Standard_DS1_v2", | ||
| "location": "northeurope", | ||
| "properties": { | ||
| "lookBackPeriod": "Last7Days", | ||
| "meterId": "00000000-0000-0000-0000-000000000000", | ||
| "term": "P1Y", | ||
| "costWithNoReservedInstances": 0.0, | ||
| "recommendedQuantity": 1, | ||
| "totalCostWithReservedInstances": 0.0, | ||
| "netSavings": 4.634521202630137, | ||
| "firstUsageDate": "2018-03-06T00:00:00Z", | ||
| "scope": "Single" | ||
| } | ||
| }, | ||
| { | ||
| "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/reservationRecommendations/reservationRecommendations2", | ||
| "name": "reservationRecommendations2", | ||
| "type": "Microsoft.Consumption/reservationRecommendations", | ||
| "sku": "Standard_DS1_v2", | ||
| "location": "northeurope", | ||
| "properties": { | ||
| "lookBackPeriod": "Last7Days", | ||
| "meterId": "00000000-0000-0000-0000-000000000000", | ||
| "term": "P3Y", | ||
| "costWithNoReservedInstances": 0.0, | ||
| "recommendedQuantity": 1, | ||
| "totalCostWithReservedInstances": 0.0, | ||
| "netSavings": 7.2893157231780812, | ||
| "firstUsageDate": "2018-03-06T00:00:00Z", | ||
| "scope": "Single" | ||
| } | ||
| } | ||
| ], | ||
| "nextLink" : "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/reservationRecommendations?api-version=2018-03-31&$filter=properties/scope+eq+'Single'+AND+properties/lookBackPeriod+eq+'Last7Days'&$skiptoken=AQAAAA%3D%3D&" | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2018-03-31", | ||
| "subscriptionId": "00000000-0000-0000-0000-000000000000" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "value": [ | ||
| { | ||
| "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/reservationRecommendations/reservationRecommendations1", | ||
| "name": "reservationRecommendations1", | ||
| "type": "Microsoft.Consumption/reservationRecommendations", | ||
| "sku": "Standard_DS1_v2", | ||
| "location": "northeurope", | ||
| "properties": { | ||
| "lookBackPeriod": "Last7Days", | ||
| "meterId": "00000000-0000-0000-0000-000000000000", | ||
| "term": "P1Y", | ||
| "costWithNoReservedInstances": 0.0, | ||
| "recommendedQuantity": 1, | ||
| "totalCostWithReservedInstances": 0.0, | ||
| "netSavings": 4.634521202630137, | ||
| "firstUsageDate": "2018-03-06T00:00:00Z", | ||
| "scope": "Single" | ||
| } | ||
| }, | ||
| { | ||
| "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/reservationRecommendations/reservationRecommendations2", | ||
| "name": "reservationRecommendations2", | ||
| "type": "Microsoft.Consumption/reservationRecommendations", | ||
| "sku": "Standard_DS1_v2", | ||
| "location": "northeurope", | ||
| "properties": { | ||
| "lookBackPeriod": "Last7Days", | ||
| "meterId": "00000000-0000-0000-0000-000000000000", | ||
| "term": "P3Y", | ||
| "costWithNoReservedInstances": 0.0, | ||
| "recommendedQuantity": 1, | ||
| "totalCostWithReservedInstances": 0.0, | ||
| "netSavings": 7.2893157231780812, | ||
| "firstUsageDate": "2018-03-06T00:00:00Z", | ||
| "scope": "Single" | ||
| } | ||
| } | ||
| ], | ||
| "nextLink" : "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/reservationRecommendations?api-version=2018-03-31&$skiptoken=AQAAAA%3D%3D&" | ||
| } | ||
| } | ||
| } | ||
| } |
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.
The
subscriptionIdparameter is missing which is the cause of the travis failure, see the log.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! Just missed it. I have added it.