Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
"x-ms-examples": {
"UsageDetailsList": {
"$ref": "./examples/UsageDetailsList.json"
},
"UsageDetailsListFilterByTag": {
"$ref": "./examples/UsageDetailsListFilterByTag.json"
},
"UsageDetailsListGroupByTagDate": {
"$ref": "./examples/UsageDetailsListGroupByTagDate.json"
}
},
"parameters": [
Expand All @@ -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"
Expand All @@ -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"
}
Expand Down Expand Up @@ -122,6 +140,9 @@
},
"UsageDetailsExpand": {
"$ref": "./examples/UsageDetailsExpand.json"
},
"UsageDetailsListForBillingPeriodGroupByTag": {
"$ref": "./examples/UsageDetailsListForBillingPeriodGroupByTag.json"
}
},
"parameters": [
Expand All @@ -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.",
Expand Down Expand Up @@ -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": [
Copy link
Member

Choose a reason for hiding this comment

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

The subscriptionId parameter is missing which is the cause of the travis failure, see the log.

Copy link
Contributor Author

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.

{
"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": [
Expand Down Expand Up @@ -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",
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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": {
Expand Down Expand Up @@ -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": {
Expand Down
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&"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"billingPeriodName": "201702",
"$expand": "meterDetails,additionalProperties",
"$filter": "properties/usageEnd ge '2018-01-14' AND properties/usageEnd le '2018-02-14'",
"$filter": "properties/usageEnd ge '2018-01-14' AND properties/usageEnd le '2018-02-14' AND tags eq 'dev:tools'",
"$top": 1
},
"responses": {
Expand Down
Loading