From 0eb80ea94e0e3f966c6653563d4b45eaaec0e9dc Mon Sep 17 00:00:00 2001 From: Elie Abi Chahine Date: Mon, 19 Oct 2020 00:22:18 -0700 Subject: [PATCH 1/8] Adding render api swagger --- .../stable/2019-11-01/costmanagement.json | 78 +++++++++++++++++++ .../2019-11-01/examples/ViewRender.json | 76 ++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json index 16f9d8c22663..bc5ddee29392 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json @@ -379,6 +379,54 @@ } } }, + "/{scope}/providers/Microsoft.CostManagement/views/render": { + "post": { + "tags": [ + "Views" + ], + "operationId": "Views_Render", + "description": "Renders the view at the given scope and returns the result as a downloadable PNG link.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ResourceGroupViewList": { + "$ref": "./examples/ViewRender.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeViewParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/View" + }, + "description": "Parameters supplied to the Render View operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ViewRenderResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/{scope}/providers/Microsoft.CostManagement/alerts": { "get": { "tags": [ @@ -1394,6 +1442,36 @@ "values" ] }, + "ViewRenderResult": { + "description": "Result of rendering a view.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ViewRenderProperties", + "title": "Render properties" + } + } + }, + "ViewRenderProperties": { + "description": "Contains the PNG image url, and the error mesage in case of failure.", + "type": "object", + "properties": { + "imageUrl": { + "description": "Image url for the PNG download.", + "type": "string" + }, + "errorMessage": { + "description": "The error description in case of download failure.", + "type": "string" + } + } + }, "ViewListResult": { "description": "Result of listing views. It contains a list of available views.", "type": "object", diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json new file mode 100644 index 000000000000..b601babd3512 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "api-version": "2019-11-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", + "parameters": { + "eTag": "\"1d4ff9fe66f1d10\"", + "properties": { + "displayName": "swagger Example", + "query": { + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } + }, + "chart": "Table", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true + }, + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample", + "name": "swaggerExample", + "type": "donwloadlink", + "eTag": "\"1d4ffa5a9c2430c\"", + "properties": { + "imageUrl": "https://storagepilot.blob.core.windows.net/dashboardimage/2020/10/19/5/31/eff0d624-8630-4ced-bd9b-971df5878fcb?sv=2016-05-31", + "errorMessage": "" + } + } + } + } + } + \ No newline at end of file From 92eafbfb0df8b9c69309edd69fb137f7c4b5905c Mon Sep 17 00:00:00 2001 From: Elie Abi Chahine Date: Mon, 19 Oct 2020 01:00:12 -0700 Subject: [PATCH 2/8] add missing properties --- .../stable/2019-11-01/costmanagement.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json index bc5ddee29392..f493a5cca4eb 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json @@ -1531,6 +1531,16 @@ "format": "date-time", "readOnly": true }, + "dateRange": { + "description": "Selected date range for viewing cost in.", + "type": "string", + "readOnly": true + }, + "currency": { + "description": "Selected currency.", + "type": "string", + "readOnly": true + }, "query": { "description": "Query body configuration. Required.", "type": "object", From 88ec049defb87bc901934840f895fd405a7a2ff0 Mon Sep 17 00:00:00 2001 From: Elie Abi Chahine Date: Mon, 19 Oct 2020 12:47:59 -0700 Subject: [PATCH 3/8] changing view list schema to array --- .../stable/2019-11-01/costmanagement.json | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json index f493a5cca4eb..4e2800762ff7 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json @@ -1473,22 +1473,11 @@ } }, "ViewListResult": { - "description": "Result of listing views. It contains a list of available views.", - "type": "object", - "properties": { - "value": { - "description": "The list of views.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/View" - } - }, - "nextLink": { - "description": "The link (url) to the next page of results.", - "type": "string", - "readOnly": true - } + "description": "The list of views.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/View" } }, "View": { From e8fbce9e8413d61ec6479e59fc1ff1300318538e Mon Sep 17 00:00:00 2001 From: Elie Abi Chahine Date: Mon, 19 Oct 2020 13:11:55 -0700 Subject: [PATCH 4/8] Fix get view list examples --- .../2019-11-01/examples/PrivateViewList.json | 234 +++++++++--------- .../examples/ViewListByResourceGroup.json | 234 +++++++++--------- 2 files changed, 232 insertions(+), 236 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/PrivateViewList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/PrivateViewList.json index fa4fa0e07de5..60226b0124f0 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/PrivateViewList.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/PrivateViewList.json @@ -4,128 +4,126 @@ }, "responses": { "200": { - "body": { - "value": [ - { - "id": "/providers/Microsoft.CostManagement/views/swaggerExample", - "name": "swaggerExample", - "type": "Microsoft.CostManagement/Views", - "eTag": "\"1d4ff9fe66f1d10\"", - "properties": { - "displayName": "swagger Example", - "scope": "", - "query": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } - }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } - }, - "chart": "Table", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" + "body": [ + { + "id": "/providers/Microsoft.CostManagement/views/swaggerExample", + "name": "swaggerExample", + "type": "Microsoft.CostManagement/Views", + "eTag": "\"1d4ff9fe66f1d10\"", + "properties": { + "displayName": "swagger Example", + "scope": "", + "query": { + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] - } - }, - { - "id": "/providers/Microsoft.CostManagement/views/swaggerExample2", - "name": "swaggerExample2", - "type": "Microsoft.CostManagement/Views", - "eTag": "\"1d4ffa5a9c2430c\"", - "properties": { - "displayName": "swagger Example 2", - "scope": "", - "query": { - "type": "Usage", - "timeframe": "LastMonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } - }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } + }, + "chart": "Table", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true }, - "chart": "GroupedColumn", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" + } + ] + } + }, + { + "id": "/providers/Microsoft.CostManagement/views/swaggerExample2", + "name": "swaggerExample2", + "type": "Microsoft.CostManagement/Views", + "eTag": "\"1d4ffa5a9c2430c\"", + "properties": { + "displayName": "swagger Example 2", + "scope": "", + "query": { + "type": "Usage", + "timeframe": "LastMonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] - } + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } + }, + "chart": "GroupedColumn", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true + }, + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" + } + ] } - ] - } + } + ] } } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewListByResourceGroup.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewListByResourceGroup.json index efbfa5040ac6..500700d6fda5 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewListByResourceGroup.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewListByResourceGroup.json @@ -5,128 +5,126 @@ }, "responses": { "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample", - "name": "swaggerExample", - "type": "Microsoft.CostManagement/Views", - "eTag": "\"1d4ff9fe66f1d10\"", - "properties": { - "displayName": "swagger Example", - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", - "query": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } - }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } - }, - "chart": "Table", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" + "body": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample", + "name": "swaggerExample", + "type": "Microsoft.CostManagement/Views", + "eTag": "\"1d4ff9fe66f1d10\"", + "properties": { + "displayName": "swagger Example", + "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", + "query": { + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample2", - "name": "swaggerExample2", - "type": "Microsoft.CostManagement/Views", - "eTag": "\"1d4ffa5a9c2430c\"", - "properties": { - "displayName": "swagger Example 2", - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", - "query": { - "type": "Usage", - "timeframe": "LastMonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } - }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } + }, + "chart": "Table", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true }, - "chart": "GroupedColumn", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" + } + ] + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample2", + "name": "swaggerExample2", + "type": "Microsoft.CostManagement/Views", + "eTag": "\"1d4ffa5a9c2430c\"", + "properties": { + "displayName": "swagger Example 2", + "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", + "query": { + "type": "Usage", + "timeframe": "LastMonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] - } + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } + }, + "chart": "GroupedColumn", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true + }, + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" + } + ] } - ] - } + } + ] } } } From 24086d359f1896ae9bac58139e93fdf63b1fecd3 Mon Sep 17 00:00:00 2001 From: Elie Abi Chahine Date: Mon, 19 Oct 2020 16:40:50 -0700 Subject: [PATCH 5/8] revert view list changes --- .../stable/2019-11-01/costmanagement.json | 21 +- .../2019-11-01/examples/PrivateViewList.json | 234 +++++++++--------- .../examples/ViewListByResourceGroup.json | 234 +++++++++--------- 3 files changed, 252 insertions(+), 237 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json index 4e2800762ff7..f493a5cca4eb 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json @@ -1473,11 +1473,22 @@ } }, "ViewListResult": { - "description": "The list of views.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/View" + "description": "Result of listing views. It contains a list of available views.", + "type": "object", + "properties": { + "value": { + "description": "The list of views.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/View" + } + }, + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string", + "readOnly": true + } } }, "View": { diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/PrivateViewList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/PrivateViewList.json index 60226b0124f0..fa4fa0e07de5 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/PrivateViewList.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/PrivateViewList.json @@ -4,126 +4,128 @@ }, "responses": { "200": { - "body": [ - { - "id": "/providers/Microsoft.CostManagement/views/swaggerExample", - "name": "swaggerExample", - "type": "Microsoft.CostManagement/Views", - "eTag": "\"1d4ff9fe66f1d10\"", - "properties": { - "displayName": "swagger Example", - "scope": "", - "query": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } - }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } - }, - "chart": "Table", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" + "body": { + "value": [ + { + "id": "/providers/Microsoft.CostManagement/views/swaggerExample", + "name": "swaggerExample", + "type": "Microsoft.CostManagement/Views", + "eTag": "\"1d4ff9fe66f1d10\"", + "properties": { + "displayName": "swagger Example", + "scope": "", + "query": { + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] - } - }, - { - "id": "/providers/Microsoft.CostManagement/views/swaggerExample2", - "name": "swaggerExample2", - "type": "Microsoft.CostManagement/Views", - "eTag": "\"1d4ffa5a9c2430c\"", - "properties": { - "displayName": "swagger Example 2", - "scope": "", - "query": { - "type": "Usage", - "timeframe": "LastMonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } + "chart": "Table", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } - }, - "chart": "GroupedColumn", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" + } + ] + } + }, + { + "id": "/providers/Microsoft.CostManagement/views/swaggerExample2", + "name": "swaggerExample2", + "type": "Microsoft.CostManagement/Views", + "eTag": "\"1d4ffa5a9c2430c\"", + "properties": { + "displayName": "swagger Example 2", + "scope": "", + "query": { + "type": "Usage", + "timeframe": "LastMonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] + "chart": "GroupedColumn", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true + }, + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" + } + ] + } } - } - ] + ] + } } } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewListByResourceGroup.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewListByResourceGroup.json index 500700d6fda5..efbfa5040ac6 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewListByResourceGroup.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewListByResourceGroup.json @@ -5,126 +5,128 @@ }, "responses": { "200": { - "body": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample", - "name": "swaggerExample", - "type": "Microsoft.CostManagement/Views", - "eTag": "\"1d4ff9fe66f1d10\"", - "properties": { - "displayName": "swagger Example", - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", - "query": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } - }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } - }, - "chart": "Table", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" + "body": { + "value": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample", + "name": "swaggerExample", + "type": "Microsoft.CostManagement/Views", + "eTag": "\"1d4ff9fe66f1d10\"", + "properties": { + "displayName": "swagger Example", + "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", + "query": { + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample2", - "name": "swaggerExample2", - "type": "Microsoft.CostManagement/Views", - "eTag": "\"1d4ffa5a9c2430c\"", - "properties": { - "displayName": "swagger Example 2", - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", - "query": { - "type": "Usage", - "timeframe": "LastMonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } + "chart": "Table", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } - }, - "chart": "GroupedColumn", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" + } + ] + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample2", + "name": "swaggerExample2", + "type": "Microsoft.CostManagement/Views", + "eTag": "\"1d4ffa5a9c2430c\"", + "properties": { + "displayName": "swagger Example 2", + "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", + "query": { + "type": "Usage", + "timeframe": "LastMonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] + "chart": "GroupedColumn", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true + }, + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" + } + ] + } } - } - ] + ] + } } } } From 131363b9528ea284033f71b439bf107aaf1bbc84 Mon Sep 17 00:00:00 2001 From: Elie Abi Chahine Date: Tue, 20 Oct 2020 23:49:00 -0700 Subject: [PATCH 6/8] fix prettier --- .../2019-11-01/examples/ViewRender.json | 135 +++++++++--------- 1 file changed, 67 insertions(+), 68 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json index b601babd3512..f9405f210762 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json @@ -1,76 +1,75 @@ { + "parameters": { + "api-version": "2019-11-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "parameters": { - "api-version": "2019-11-01", - "scope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", - "parameters": { - "eTag": "\"1d4ff9fe66f1d10\"", - "properties": { - "displayName": "swagger Example", - "query": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } - }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } - }, - "chart": "Table", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" + "eTag": "\"1d4ff9fe66f1d10\"", + "properties": { + "displayName": "swagger Example", + "query": { + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "PreTaxCost", + "function": "Sum" + } }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample", - "name": "swaggerExample", - "type": "donwloadlink", - "eTag": "\"1d4ffa5a9c2430c\"", - "properties": { - "imageUrl": "https://storagepilot.blob.core.windows.net/dashboardimage/2020/10/19/5/31/eff0d624-8630-4ced-bd9b-971df5878fcb?sv=2016-05-31", - "errorMessage": "" + "grouping": [], + "sorting": [ + { + "direction": "Ascending", + "name": "UsageDate" + } + ] + } + }, + "chart": "Table", + "accumulated": "true", + "metric": "ActualCost", + "kpis": [ + { + "type": "Forecast", + "id": null, + "enabled": true + }, + { + "type": "Budget", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", + "enabled": true + } + ], + "pivots": [ + { + "type": "Dimension", + "name": "ServiceName" + }, + { + "type": "Dimension", + "name": "MeterCategory" + }, + { + "type": "TagKey", + "name": "swaggerTagKey" } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample", + "name": "swaggerExample", + "type": "donwloadlink", + "eTag": "\"1d4ffa5a9c2430c\"", + "properties": { + "imageUrl": "https://storagepilot.blob.core.windows.net/dashboardimage/2020/10/19/5/31/eff0d624-8630-4ced-bd9b-971df5878fcb?sv=2016-05-31", + "errorMessage": "" } } } } - \ No newline at end of file +} From d30cf1c5388870be45000980f1f8bd9a2f977a4f Mon Sep 17 00:00:00 2001 From: Elie Abi Chahine Date: Tue, 20 Oct 2020 23:51:07 -0700 Subject: [PATCH 7/8] fix spell check --- .../stable/2019-11-01/costmanagement.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json index f493a5cca4eb..c2c872ce34b2 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json @@ -1459,7 +1459,7 @@ } }, "ViewRenderProperties": { - "description": "Contains the PNG image url, and the error mesage in case of failure.", + "description": "Contains the PNG image url, and the error message in case of failure.", "type": "object", "properties": { "imageUrl": { From d638ddcc8b6a49d1b623a9be19d3bcad01661ee0 Mon Sep 17 00:00:00 2001 From: Elie Abi Chahine Date: Thu, 29 Oct 2020 22:04:47 -0700 Subject: [PATCH 8/8] undo render api swagger changes --- .../stable/2019-11-01/costmanagement.json | 78 ------------------- .../2019-11-01/examples/ViewRender.json | 75 ------------------ 2 files changed, 153 deletions(-) delete mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json index c2c872ce34b2..99b601773b8a 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json @@ -379,54 +379,6 @@ } } }, - "/{scope}/providers/Microsoft.CostManagement/views/render": { - "post": { - "tags": [ - "Views" - ], - "operationId": "Views_Render", - "description": "Renders the view at the given scope and returns the result as a downloadable PNG link.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ResourceGroupViewList": { - "$ref": "./examples/ViewRender.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeViewParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/View" - }, - "description": "Parameters supplied to the Render View operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/ViewRenderResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, "/{scope}/providers/Microsoft.CostManagement/alerts": { "get": { "tags": [ @@ -1442,36 +1394,6 @@ "values" ] }, - "ViewRenderResult": { - "description": "Result of rendering a view.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ViewRenderProperties", - "title": "Render properties" - } - } - }, - "ViewRenderProperties": { - "description": "Contains the PNG image url, and the error message in case of failure.", - "type": "object", - "properties": { - "imageUrl": { - "description": "Image url for the PNG download.", - "type": "string" - }, - "errorMessage": { - "description": "The error description in case of download failure.", - "type": "string" - } - } - }, "ViewListResult": { "description": "Result of listing views. It contains a list of available views.", "type": "object", diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json deleted file mode 100644 index f9405f210762..000000000000 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/examples/ViewRender.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "parameters": { - "api-version": "2019-11-01", - "scope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", - "parameters": { - "eTag": "\"1d4ff9fe66f1d10\"", - "properties": { - "displayName": "swagger Example", - "query": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "PreTaxCost", - "function": "Sum" - } - }, - "grouping": [], - "sorting": [ - { - "direction": "Ascending", - "name": "UsageDate" - } - ] - } - }, - "chart": "Table", - "accumulated": "true", - "metric": "ActualCost", - "kpis": [ - { - "type": "Forecast", - "id": null, - "enabled": true - }, - { - "type": "Budget", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo", - "enabled": true - } - ], - "pivots": [ - { - "type": "Dimension", - "name": "ServiceName" - }, - { - "type": "Dimension", - "name": "MeterCategory" - }, - { - "type": "TagKey", - "name": "swaggerTagKey" - } - ] - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample", - "name": "swaggerExample", - "type": "donwloadlink", - "eTag": "\"1d4ffa5a9c2430c\"", - "properties": { - "imageUrl": "https://storagepilot.blob.core.windows.net/dashboardimage/2020/10/19/5/31/eff0d624-8630-4ced-bd9b-971df5878fcb?sv=2016-05-31", - "errorMessage": "" - } - } - } - } -}