diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/consumption.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/consumption.json index 90c09061afad..bb438a777076 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/consumption.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/consumption.json @@ -517,7 +517,7 @@ "nextLinkName": "nextLink" } } - }, + }, "/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Consumption/usageDetails": { "get": { "tags": [ @@ -688,7 +688,7 @@ "nextLinkName": "nextLink" } } - }, + }, "/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.Consumption/usageDetails": { "get": { "tags": [ @@ -859,7 +859,7 @@ "nextLinkName": "nextLink" } } - }, + }, "/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts": { "get": { "tags": [ @@ -946,114 +946,856 @@ "nextLinkName": "nextLink" } } - } - }, - "definitions": { - "ErrorDetails": { - "description": "The details of the error.", - "properties": { - "code": { - "description": "Error code.", - "type": "string", - "readOnly": true + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/reportconfigs": { + "get": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_List", + "description": "Lists all report configs for a subscription.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" }, - "message": { - "description": "Error message indicating why the operation failed.", - "type": "string", - "readOnly": true + "x-ms-examples": { + "ReportConfigList": { + "$ref": "./examples/ReportConfigList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfigListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } } } }, - "ErrorResponse": { - "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.", - "type": "object", - "properties": { - "error": { - "description": "The details of the error.", - "$ref": "#/definitions/ErrorDetails" + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/reportconfigs": { + "get": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_ListByResourceGroupName", + "description": "Lists all report configs for a resource group under a subscription.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "ReportConfigList": { + "$ref": "./examples/ReportConfigList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfigListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } } } }, - "Operation": { - "description": "A Consumption REST API operation.", - "type": "object", - "properties": { - "name": { - "description": "Operation name: {provider}/{resource}/{operation}.", - "type": "string", - "readOnly": true + "/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/reportconfigs/{reportConfigName}": { + "get": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_Get", + "description": "Gets the report config for a subscription by report config name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" }, - "display": { - "description": "The object that represents the operation.", - "properties": { - "provider": { - "description": "Service provider: Microsoft.Consumption.", - "type": "string", - "readOnly": true - }, - "resource": { - "description": "Resource on which the operation is performed: UsageDetail, etc.", - "type": "string", - "readOnly": true + "x-ms-examples": { + "Report": { + "$ref": "./examples/ReportConfig.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_CreateOrUpdate", + "description": "The operation to create or update a report config. Update operation requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "CreateOrUpdateReport": { + "$ref": "./examples/ReportConfigCreateOrUpdate.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfig" }, - "operation": { - "description": "Operation type: Read, write, delete, etc.", - "type": "string", - "readOnly": true + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" } } } - } - }, - "OperationListResult": { - "description": "Result of listing consumption operations. It contains a list of operations and a URL link to get the next set of results.", - "properties": { - "value": { - "description": "List of consumption operations supported by the Microsoft.Consumption resource provider.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Operation" + }, + "delete": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_Delete", + "description": "The operation to delete a report.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "DeleteReport": { + "$ref": "./examples/ReportConfigDelete.json" } }, - "nextLink": { - "description": "URL to get the next set of operation list results if there are any.", - "type": "string", - "readOnly": true + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } } } }, - "Resource": { - "description": "The Resource model definition.", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Resource Id." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name." + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/reportconfigs/{reportConfigName}": { + "get": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_GetByResourceGroupName", + "description": "Gets the report config for a resource group under a subscription by report config name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type." + "x-ms-examples": { + "ReportConfig": { + "$ref": "./examples/ReportConfig.json" + } }, - "tags": { - "readOnly": true, - "type": "object", - "additionalProperties": { - "type": "string" + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" }, - "description": "Resource tags." - } - }, - "x-ms-azure-resource": true - }, - "PriceSheetResult": { - "description": "An pricesheet resource.", + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_CreateOrUpdateByResourceGroupName", + "description": "The operation to create or update a report config. Update operation requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "CreateOrUpdateReport": { + "$ref": "./examples/ReportConfigCreateOrUpdate.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfig" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_DeleteByResourceGroupName", + "description": "The operation to delete a report config.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "DeleteReport": { + "$ref": "./examples/ReportConfigDelete.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/dimensions": { + "get": { + "tags": [ + "Dimensions" + ], + "x-ms-odata": "#/definitions/Dimension", + "operationId": "BillingAccountDimensions_List", + "description": "Lists the dimensions by billingAccount Id.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "BillingAccountDimensionsList": { + "$ref": "./examples/BillingAccountDimensionsList.json" + }, + "BillingAccountDimensionsListExpandAndTop": { + "$ref": "./examples/BillingAccountDimensionsListExpandAndTop.json" + }, + "BillingAccountDimensionsListWithFilter": { + "$ref": "./examples/BillingAccountDimensionsListWithFilter.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "name": "$filter", + "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "description": "May be used to expand the properties/data within a dimension dategory. By default, data is not included when listing dimensions.", + "in": "query", + "required": false, + "type": "string" + }, + { + "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.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N dimension data.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DimensionsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/dimensions": { + "get": { + "tags": [ + "Dimensions" + ], + "x-ms-odata": "#/definitions/Dimension", + "operationId": "SubscriptionDimensions_List", + "description": "Lists the dimensions by subscription Id.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "SubscriptionDimensionsList": { + "$ref": "./examples/SubscriptionDimensionsList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "name": "$filter", + "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "description": "May be used to expand the properties/data within a dimension dategory. By default, data is not included when listing dimensions.", + "in": "query", + "required": false, + "type": "string" + }, + { + "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.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N dimension data.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DimensionsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/dimensions": { + "get": { + "tags": [ + "Dimensions" + ], + "x-ms-odata": "#/definitions/Dimension", + "operationId": "ResourceGroupDimensions_List", + "description": "Lists the dimensions by resource group Id.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "ResourceGroupDimensionsList": { + "$ref": "./examples/ResourceGroupDimensionsList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "name": "$filter", + "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "description": "May be used to expand the properties/data within a dimension dategory. By default, data is not included when listing dimensions.", + "in": "query", + "required": false, + "type": "string" + }, + { + "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.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N dimension data.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DimensionsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/AnalyzeUsage": { + "post": { + "tags": [ + "UsageAnalysis" + ], + "operationId": "AnalyzeSubscriptionUsage", + "description": "Lists the usage data for subscriptionId.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "SubscriptionUsage": { + "$ref": "./examples/SubscriptionUsage.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfigDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/UsageAnalysisResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Consumption/AnalyzeUsage": { + "post": { + "tags": [ + "UsageAnalysis" + ], + "operationId": "AnalyzeResourceGroupUsage", + "description": "Lists the usage data for subscriptionId and resource group.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "ResourceGroupUsage": { + "$ref": "./examples/ResourceGroupUsage.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfigDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/UsageAnalysisResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/AnalyzeUsage": { + "post": { + "tags": [ + "UsageAnalysis" + ], + "operationId": "AnalyzeBillingAccountUsage", + "description": "Lists the usage data for billing account.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "BillingAccountUsage": { + "$ref": "./examples/BillingAccountUsage.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfigDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/UsageAnalysisResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + } + }, + "definitions": { + "ErrorDetails": { + "description": "The details of the error.", + "properties": { + "code": { + "description": "Error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string", + "readOnly": true + } + } + }, + "ErrorResponse": { + "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "Operation": { + "description": "A Consumption REST API operation.", + "type": "object", + "properties": { + "name": { + "description": "Operation name: {provider}/{resource}/{operation}.", + "type": "string", + "readOnly": true + }, + "display": { + "description": "The object that represents the operation.", + "properties": { + "provider": { + "description": "Service provider: Microsoft.Consumption.", + "type": "string", + "readOnly": true + }, + "resource": { + "description": "Resource on which the operation is performed: UsageDetail, etc.", + "type": "string", + "readOnly": true + }, + "operation": { + "description": "Operation type: Read, write, delete, etc.", + "type": "string", + "readOnly": true + } + } + } + } + }, + "OperationListResult": { + "description": "Result of listing consumption operations. It contains a list of operations and a URL link to get the next set of results.", + "properties": { + "value": { + "description": "List of consumption operations supported by the Microsoft.Consumption resource provider.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Operation" + } + }, + "nextLink": { + "description": "URL to get the next set of operation list results if there are any.", + "type": "string", + "readOnly": true + } + } + }, + "Resource": { + "description": "The Resource model definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource Id." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + }, + "tags": { + "readOnly": true, + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags." + } + }, + "x-ms-azure-resource": true + }, + "PriceSheetResult": { + "description": "An pricesheet resource.", "type": "object", "allOf": [ { @@ -1324,148 +2066,653 @@ "accountName": { "description": "Account name.", "type": "string", - "readOnly": true + "readOnly": true + }, + "departmentName": { + "description": "Department name.", + "type": "string", + "readOnly": true + }, + "product": { + "description": "Product name.", + "type": "string", + "readOnly": true + }, + "consumedService": { + "description": "Consumed service name.", + "type": "string", + "readOnly": true + }, + "costCenter": { + "description": "The cost center of this department if it is a department and a costcenter exists", + "type": "string", + "readOnly": true + }, + "partNumber": { + "description": "Part Number", + "type": "string", + "readOnly": true + }, + "resourceGuid": { + "description": "Resource Guid", + "type": "string", + "readOnly": true + }, + "offerId": { + "description": "Offer Id", + "type": "string", + "readOnly": true + }, + "chargesBilledSeparately": { + "description": "Charges billed separately", + "type": "boolean", + "readOnly": true + }, + "additionalProperties": { + "description": "Additional details of this usage item. By default this is not populated, unless it's specified in $expand.", + "type": "string", + "readOnly": true + } + } + }, + "ForecastsListResult": { + "description": "Result of listing forecasts. It contains a list of available forecasts.", + "type": "object", + "properties": { + "value": { + "description": "The list of forecasts.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Forecast" + } + } + } + }, + "ForecastProperties": { + "description": "The properties of the forecast charge.", + "type": "object", + "properties": { + "usageDate": { + "description": "The usage date of the forecast.", + "type": "string", + "readOnly": true + }, + "grain": { + "description": "The granularity of forecast.", + "type": "string", + "enum": [ + "Daily", + "Monthly", + "Yearly" + ], + "x-ms-enum": { + "name": "Grain", + "modelAsString": true + } + }, + "charge": { + "description": "The amount of charge", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "currency": { + "description": "The ISO currency in which the meter is charged, for example, USD.", + "type": "string", + "readOnly": true + }, + "chargeType": { + "description": "The type of the charge. Could be actual or forecast", + "type": "string", + "enum": [ + "Actual", + "Forecast" + ], + "x-ms-enum": { + "name": "ChargeType", + "modelAsString": true + } + }, + "confidenceLevels": { + "description": "The details about the forecast confidence levels. This is populated only when chargeType is Forecast.", + "type": "array", + "items": { + "type": "object", + "properties": { + "percentage": { + "description": "The percentage level of the confidence", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "bound": { + "description": "The boundary of the percentage, values could be 'Upper' or 'Lower'", + "type": "string", + "enum": [ + "Upper", + "Lower" + ], + "x-ms-enum": { + "name": "Bound", + "modelAsString": true + } + }, + "value": { + "description": "The amount of forecast within the percentage level", + "type": "number", + "format": "decimal", + "readOnly": true + } + } + }, + + "readOnly": true + } + } + }, + "ReportConfigListResult": { + "description": "Result of listing report configs. It contains a list of available report configurations in the scope provided.", + "properties": { + "value": { + "description": "The list of report configs.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/ReportConfig" + } + } + } + }, + "ReportConfig": { + "description": "A report config resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ReportConfigProperties", + "title": "Report config properties" + } + } + }, + "ReportConfigProperties": { + "description": "The properties of the report config.", + "properties": { + "schedule": { + "description": "Has schedule information for the report config.", + "$ref": "#/definitions/ReportConfigSchedule" + }, + "format": { + "description": "The format of the report being delivered.", + "type": "string", + "enum": [ + "Csv" + ], + "x-ms-enum": { + "name": "FormatType", + "modelAsString": true + } + }, + "deliveryInfo": { + "description": "Has delivery information for the report config.", + "$ref": "#/definitions/ReportConfigDeliveryInfo" + }, + "definition": { + "description": "Has definition for the report config.", + "$ref": "#/definitions/ReportConfigDefinition" + } + }, + "required": [ + "deliveryInfo", + "definition" + ] + }, + "ReportConfigSchedule": { + "description": "The schedule associated with a report config.", + "properties": { + "status": { + "description": "The status of the schedule. Whether active or not. If inactive, the report's scheduled execution is paused.", + "type": "string", + "enum": [ + "Active", + "Inactive" + ], + "x-ms-enum": { + "name": "StatusType", + "modelAsString": true + } + }, + "recurrence": { + "description": "The schedule recurrence.", + "type": "string", + "enum": [ + "Daily", + "Weekly", + "Monthly", + "Annually" + ], + "x-ms-enum": { + "name": "RecurrenceType", + "modelAsString": true + } + }, + "recurrencePeriod": { + "description": "Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date.", + "$ref": "#/definitions/ReportConfigRecurrencePeriod" + } + }, + "required": [ + "recurrence", + "recurrencePeriod" + ] + }, + "ReportConfigDeliveryInfo": { + "description": "The delivery information associated with a report config.", + "properties": { + "destination": { + "description": "Has destination for the report being delivered.", + "$ref": "#/definitions/ReportConfigDeliveryDestination" + } + }, + "required": [ + "destination" + ] + }, + "ReportConfigDefinition":{ + "description": "The definition of a report config.", + "properties": { + "type": { + "description": "The type of the report.", + "type": "string", + "enum": [ + "Usage" + ], + "x-ms-enum": { + "name": "ReportType", + "modelAsString": true + } + }, + "timeframe": { + "description": "The time frame for pulling data for the report. If custom, then a specific time period must be provided.", + "type": "string", + "enum": [ + "WeekToDate", + "MonthToDate", + "YearToDate", + "Custom" + ], + "x-ms-enum": { + "name": "TimeframeType", + "modelAsString": true + } + }, + "timePeriod": { + "description": "Has time period for pulling data for the report.", + "$ref": "#/definitions/ReportConfigTimePeriod" + }, + "dataset": { + "description": "Has definition for data in this report config.", + "$ref": "#/definitions/ReportConfigDataset" + } + }, + "required": [ + "type", + "timeframe" + ] + }, + "ReportConfigRecurrencePeriod": { + "description": "The start and end date for recurrence schedule.", + "properties": { + "from": { + "description": "The start date of recurrence.", + "type": "string", + "format": "date-time" }, - "departmentName": { - "description": "Department name.", + "to": { + "description": "The end date of recurrence. If not provided, we default this to 10 years from the start date.", "type": "string", - "readOnly": true + "format": "date-time" + } + }, + "required": [ + "from" + ] + }, + "ReportConfigDeliveryDestination": { + "description": "The destination information for the delivery of the report.", + "properties": { + "resourceId": { + "description": "The resource id of the storage account where reports will be delivered.", + "type": "string" }, - "product": { - "description": "Product name.", - "type": "string", - "readOnly": true + "container": { + "description": "The name of the container where reports will be uploaded.", + "type": "string" }, - "consumedService": { - "description": "Consumed service name.", + "rootFolderPath": { + "description": "The name of the directory where reports will be uploaded.", + "type": "string" + } + }, + "required": [ + "resourceId", + "container" + ] + }, + "ReportConfigTimePeriod": { + "description": "The start and end date for pulling data for the report.", + "properties": { + "from": { + "description": "The start date to pull data from.", "type": "string", - "readOnly": true + "format": "date-time" }, - "costCenter": { - "description": "The cost center of this department if it is a department and a costcenter exists", + "to": { + "description": "The end date to pull data to.", "type": "string", - "readOnly": true - }, - "partNumber": { - "description": "Part Number", + "format": "date-time" + } + }, + "required": [ + "from", + "to" + ] + }, + "ReportConfigDataset": { + "description": "The definition of data present in the report.", + "properties": { + "granularity": { + "description": "The granularity of rows in the report.", "type": "string", - "readOnly": true + "enum": [ + "Daily" + ], + "x-ms-enum": { + "name": "GranularityType", + "modelAsString": true + } }, - "resourceGuid": { - "description": "Resource Guid", - "type": "string", - "readOnly": true + "configuration": { + "description": "Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided.", + "$ref": "#/definitions/ReportConfigDatasetConfiguration" }, - "offerId": { - "description": "Offer Id", - "type": "string", - "readOnly": true + "aggregation": { + "type": "object", + "description": "Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have upto 2 aggregation clauses.", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/ReportConfigAggregation" + }, + "maxItems": 2 }, - "chargesBilledSeparately": { - "description": "Charges billed separately", - "type": "boolean", - "readOnly": true + "grouping": { + "description": "Array of group by expression to use in the report. Report can have upto 2 group by clauses.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigGrouping" + }, + "maxItems": 2 }, - "additionalProperties": { - "description": "Additional details of this usage item. By default this is not populated, unless it's specified in $expand.", - "type": "string", - "readOnly": true + "filter": { + "type": "object", + "description": "Has filter expression to use in the report.", + "$ref": "#/definitions/ReportConfigFilter" } } }, - "ForecastsListResult": { - "description": "Result of listing forecasts. It contains a list of available forecasts.", - "type": "object", + "ReportConfigDatasetConfiguration": { + "description": "The configuration of dataset in the report.", "properties": { - "value": { - "description": "The list of forecasts.", + "columns": { + "description": "Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.", "type": "array", - "readOnly": true, "items": { - "$ref": "#/definitions/Forecast" + "type": "string" } } } }, - "ForecastProperties": { - "description": "The properties of the forecast charge.", - "type": "object", - "properties": { - "usageDate": { - "description": "The usage date of the forecast.", - "type": "string", - "readOnly": true + "ReportConfigAggregation": { + "description": "The aggregation expression to be used in the report.", + "properties":{ + "name": { + "description": "The name of the column to aggregate.", + "type": "string" }, - "grain": { - "description": "The granularity of forecast.", + "function": { + "description": "The name of the aggregation function to use.", "type": "string", "enum": [ - "Daily", - "Monthly", - "Yearly" + "Sum" ], "x-ms-enum": { - "name": "Grain", + "name": "FunctionType", "modelAsString": true } + } + }, + "required": [ + "name", + "function" + ] + }, + "ReportConfigGrouping": { + "description": "The group by expression to be used in the report.", + "properties":{ + "columnType": { + "description": "Has type of the column to group.", + "$ref": "#/definitions/ReportConfigColumnType" }, - "charge": { - "description": "The amount of charge", - "type": "number", - "format": "decimal", - "readOnly": true + "name": { + "description": "The name of the column to group.", + "type": "string" + } + }, + "required": [ + "columnType", + "name" + ] + }, + "ReportConfigFilter": { + "description": "The filter expression to be used in the report.", + "properties": { + "and": { + "description": "The logical \"AND\" expression. Must have atleast 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 }, - "currency": { - "description": "The ISO currency in which the meter is charged, for example, USD.", - "type": "string", - "readOnly": true + "or": { + "description": "The logical \"OR\" expression. Must have atleast 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 }, - "chargeType": { - "description": "The type of the charge. Could be actual or forecast", + "not": { + "description": "The logical \"NOT\" expression.", + "$ref": "#/definitions/ReportConfigFilter" + }, + "dimension": { + "description": "Has comparison expression for a dimension", + "$ref": "#/definitions/ReportConfigComparisonExpression" + }, + "tag": { + "description": "Has comparison expression for a tag", + "$ref": "#/definitions/ReportConfigComparisonExpression" + } + } + }, + "ReportConfigColumnType": { + "description": "The type of the column in the report.", + "type": "string", + "enum": [ + "Tag", + "Dimension" + ], + "x-ms-enum": { + "name": "ReportConfigColumnType", + "modelAsString": true + } + }, + "ReportConfigComparisonExpression": { + "description": "The comparison expression to be used in the report.", + "properties":{ + "name": { + "description": "The name of the column to use in comaprison.", + "type": "string" + }, + "operator": { + "description": "The operator to use for comparison.", "type": "string", "enum": [ - "Actual", - "Forecast" + "In" ], "x-ms-enum": { - "name": "ChargeType", - "modelAsString": true + "name": "OperatorType", + "modelAsString": true } }, - "confidenceLevels": { - "description": "The details about the forecast confidence levels. This is populated only when chargeType is Forecast.", + "values": { + "description": "Array of values to use for comparison", "type": "array", "items": { - "type": "object", - "properties": { - "percentage": { - "description": "The percentage level of the confidence", - "type": "number", - "format": "decimal", - "readOnly": true - }, - "bound": { - "description": "The boundary of the percentage, values could be 'Upper' or 'Lower'", - "type": "string", - "enum": [ - "Upper", - "Lower" - ], - "x-ms-enum": { - "name": "Bound", - "modelAsString": true - } - }, - "value": { - "description": "The amount of forecast within the percentage level", - "type": "number", - "format": "decimal", - "readOnly": true - } - } + "type": "string" }, - - "readOnly": true + "minItems": 1 + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, + "DimensionsListResult": { + "description": "Result of listing dimensions. It contains a list of available dimensions.", + "type": "object", + "properties": { + "value": { + "description": "The list of dimensions.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Dimension" + } + } + } + }, + "Dimension": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/DimensionProperties", + "title": "Dimension properties" + } + } + }, + "DimensionProperties": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "total": { + "format": "int32", + "type": "integer" + }, + "category": { + "type": "string" + }, + "usageStart": { + "format": "date-time", + "type": "string" + }, + "usageEnd": { + "format": "date-time", + "type": "string" + }, + "nextLink": { + "type": "string" + } + } + }, + "UsageAnalysisResult": { + "description": "Result of listing usages. It contains all columns listed under groupings and aggregation.", + "type": "object", + "properties": { + "value": { + "description": "The list of usage data.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/UsageAnalysis" + } + } + } + }, + "UsageAnalysis": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/UsageAnalysisProperties", + "title": "Usage analysis properties" + } + } + }, + "UsageAnalysisProperties": { + "type": "object", + "properties": { + "nextLink": { + "type": "string" + }, + "columns": { + "description": "Array of columns", + "type": "array", + "items": { + "$ref": "#/definitions/UsageAnalysisColumn" + } + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": {} + } + } + } + }, + "UsageAnalysisColumn":{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" } } } @@ -1485,6 +2732,14 @@ "required": true, "type": "string" }, + "resourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "description": "Azure Resource Group Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, "billingPeriodNameParameter": { "name": "billingPeriodName", "in": "path", @@ -1516,6 +2771,14 @@ "required": true, "type": "string", "x-ms-parameter-location": "method" + }, + "reportConfigNameParameter": { + "name": "reportConfigName", + "in": "path", + "description": "Report Config Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" } } -} +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountDimensionsList.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountDimensionsList.json new file mode 100644 index 000000000000..23a7b5d6e43a --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountDimensionsList.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "billingAccountId": "100" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_ResourceGroup_2018-05-01_2018-05-31", + "name": "dimensions_ResourceGroup_2018-05-01_2018-05-31", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [], + "total": 377, + "category": "ResourceGroup", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_ResourceType_2018-05-01_2018-05-31", + "name": "dimensions_ResourceType_2018-05-01_2018-05-31", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [], + "total": 37, + "category": "ResourceType", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountDimensionsListExpandAndTop.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountDimensionsListExpandAndTop.json new file mode 100644 index 000000000000..87d9d31d7bc9 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountDimensionsListExpandAndTop.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "billingAccountId": "100", + "$expand": "properties/data", + "$top": "5" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_ResourceGroup_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceGroup_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "thoroetrg01", + "default-notificationhubs-westus", + "jedikeyvaultrg", + "contosocodeflow8d4a", + "noobaa" + ], + "total": 377, + "category": "ResourceGroup", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_ResourceType_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceType_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "microsoft.automation/automationaccounts", + "microsoft.databricks/workspaces", + "microsoft.dbformysql/servers", + "microsoft.containerregistry/registries", + "microsoft.search/searchservices" + ], + "total": 37, + "category": "ResourceType", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountDimensionsListWithFilter.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountDimensionsListWithFilter.json new file mode 100644 index 000000000000..db8aab50eec2 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountDimensionsListWithFilter.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "billingAccountId": "100", + "$expand": "properties/data", + "$top": "5", + "$filter": "properties/category eq 'instanceId'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_InstanceId_2018-05-01_2018-05-31_5", + "name": "dimensions_InstanceId_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount", + "/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1", + "/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume" + ], + "total": 1409, + "category": "InstanceId", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00", + "nextLink": "http://management.azure.com/ccmapi/providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.Consumption/Dimensions?$filter=properties/category eq 'instanceId'&$top=5&api-version=2018-05-31&$expand=properties/data&$skiptoken=AQAAAA%3D%3D" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountUsage.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountUsage.json new file mode 100644 index 000000000000..efe0eefcf05d --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/BillingAccountUsage.json @@ -0,0 +1,109 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "billingAccountId": "70664866", + "parameters":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "PreTaxCost", + "ResourceGroup", + "UsageDate" + ] + }, + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.Consumption/AnalyzeUsage/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "microsoft.consumption/AnalyzeUsage", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.Consumption/AnalyzeUsage?api-version=2018-05-31&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "ResourceGroup", + "type": "String" + }, + { + "name": "UsageDate", + "type": "Number" + } + ], + "rows": [ + [ + 19.545363672276512, + "JapanUnifia-Trial", + 20180331 + ], + [ + 173.41979241290323, + "RVIIOT-TRIAL", + 20180331 + ], + [ + 20.359416562625452, + "VSTSHOL-1595322048000", + 20180331 + ], + [ + 0.16677720329728665, + "gs-stms-dev", + 20180331 + ] + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfig.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfig.json new file mode 100644 index 000000000000..4e247bd74fc9 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfig.json @@ -0,0 +1,87 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG", + "reportConfigName": "TestReportConfig" + }, + "responses": { + "200": { + "body": { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig", + "name": "TestReportConfig", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2018-06-01T00:00:00Z", + "to": "2018-10-31T00:00:00Z" + }, + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "UsageDate", + "MeterId", + "InstanceId", + "ResourceLocation", + "UsageQuantity" + ] + }, + "aggregation": { + "usageSum": { + "name": "UsageQuantity", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + }, + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "Contains", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfigCreateOrUpdate.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfigCreateOrUpdate.json new file mode 100644 index 000000000000..2125aa4fd520 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfigCreateOrUpdate.json @@ -0,0 +1,287 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG", + "reportConfigName": "TestReportConfig", + "parameters": { + "properties": { + "schedule":{ + "status": "Active", + "recurrence": "Weekly", + "recurrencePeriod": { + "from":"2018-06-01T00:00:00Z", + "to":"2018-10-31T00:00:00Z" + } + }, + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "PreTaxCost" + ] + }, + "aggregation": { + "costSum": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + }, + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig", + "name": "TestReportConfig", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "schedule":{ + "status": "Active", + "recurrence": "Weekly", + "recurrencePeriod": { + "from":"2018-06-01T00:00:00Z", + "to":"2018-10-31T00:00:00Z" + } + }, + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "PreTaxCost" + ] + }, + "aggregation": { + "costSum": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + }, + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + } + } + }, + "200": { + "body": { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig", + "name": "TestReportConfig", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "schedule":{ + "status": "Active", + "recurrence": "Weekly", + "recurrencePeriod": { + "from":"2018-06-01T00:00:00Z", + "to":"2018-10-31T00:00:00Z" + } + }, + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "PreTaxCost" + ] + }, + "aggregation": { + "costSum": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + }, + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfigDelete.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfigDelete.json new file mode 100644 index 000000000000..0a47186446a0 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfigDelete.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG", + "reportConfigName": "TestReport" + }, + "responses": { + "200": { + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfigList.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfigList.json new file mode 100644 index 000000000000..6988b522bdb3 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ReportConfigList.json @@ -0,0 +1,174 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig1", + "name": "TestReportConfig1", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2018-06-01T00:00:00Z", + "to": "2018-10-31T00:00:00Z" + }, + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "PreTaxCost" + ] + }, + "aggregation": { + "costSum": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + } + ], + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + } + }, + { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig2", + "name": "TestReportConfig2", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "schedule":{ + "status": "Active", + "recurrence": "Weekly", + "recurrencePeriod": { + "from":"2018-06-01T00:00:00Z", + "to":"2018-10-31T00:00:00Z" + } + }, + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "WeekToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "UsageQuantity" + ] + }, + "aggregation": { + "usageSum": { + "name": "UsageQuantity", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + } + } + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ResourceGroupDimensionsList.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ResourceGroupDimensionsList.json new file mode 100644 index 000000000000..6bd76a0a90b9 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ResourceGroupDimensionsList.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "subscriptionId": "39ae8bea-c3fd-4e24-8936-7c34974326ce", + "resourceGroupName": "system.orlando", + "$expand": "properties/data", + "$top": "5" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourceGroups/system.orlando/providers/microsoft.consumption/dimensions_ResourceType_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceType_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "microsoft.storage/storageaccounts" + ], + "total": 1, + "category": "ResourceType", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + }, + { + "id": "subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourceGroups/system.orlando/providers/microsoft.consumption/dimensions_InstanceId_2018-05-01_2018-05-31_5", + "name": "dimensions_InstanceId_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/authprod", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/systemevents", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/armadminprod", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/publicsystemportal" + ], + "total": 27, + "category": "InstanceId", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ResourceGroupUsage.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ResourceGroupUsage.json new file mode 100644 index 000000000000..ee432bd674a7 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/ResourceGroupUsage.json @@ -0,0 +1,100 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "subscriptionId": "55312978-ba1b-415c-9304-c4b9c43c0481", + "resourceGroupName": "ScreenSharingTest-peer", + "parameters":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "PreTaxCost", + "ResourceGroup", + "UsageDate" + ] + }, + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/55312978-ba1b-415c-9304-c4b9c43c0481/resourcegroups/ScreenSharingTest-peer/providers/Microsoft.Consumption/AnalyzeUsage/9af9459d-441d-4055-9ed0-83d4c4a363fb", + "name": "9af9459d-441d-4055-9ed0-83d4c4a363fb", + "type": "microsoft.consumption/AnalyzeUsage", + "properties": { + "nextLink": null, + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "ResourceGroup", + "type": "String" + }, + { + "name": "UsageDate", + "type": "Number" + } + ], + "rows": [ + [ + 2.10333307059661, + "ScreenSharingTest-peer", + 20180417 + ], + [ + 20.10333307059661, + "ScreenSharingTest-peer", + 20180418 + ] + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/SubscriptionDimensionsList.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/SubscriptionDimensionsList.json new file mode 100644 index 000000000000..a1bf887e7aeb --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/SubscriptionDimensionsList.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "subscriptionId": "39ae8bea-c3fd-4e24-8936-7c34974326ce", + "$top": "5", + "$expand": "properties/data" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/providers/Microsoft.Consumption/dimensions_ResourceGroup_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceGroup_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "dcrg", + "rg", + "offlinegalleryrg", + "system.orlando.adminkeyvault", + "system.orlando.keyvault" + ], + "total": 68, + "category": "ResourceGroup", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + }, + { + "id": "subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/providers/Microsoft.Consumption/dimensions_ResourceType_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceType_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "microsoft.storage/storageaccounts", + "microsoft.web.admin/role", + "microsoft.sql/servers", + "microsoft.compute/virtualmachines" + ], + "total": 4, + "category": "ResourceType", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/SubscriptionUsage.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/SubscriptionUsage.json new file mode 100644 index 000000000000..4a953f3a8a84 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/examples/SubscriptionUsage.json @@ -0,0 +1,109 @@ +{ + "parameters": { + "api-version": "2018-05-31", + "subscriptionId": "55312978-ba1b-415c-9304-c6b9c43c0481", + "parameters":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "PreTaxCost", + "ResourceGroup", + "UsageDate" + ] + }, + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/55312978-ba1b-415c-9304-c6b9c43c0481/providers/Microsoft.Consumption/AnalyzeUsage/55312978-ba1b-415c-9304-c6b9c43c0481", + "name": "55312978-ba1b-415c-9304-cfd9c43c0481", + "type": "microsoft.consumption/AnalyzeUsage", + "properties": { + "nextLink": null, + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "ResourceGroup", + "type": "String" + }, + { + "name": "UsageDate", + "type": "Number" + } + ], + "rows": [ + [ + 2.10333307059661, + "ScreenSharingTest-peer", + 20180417 + ], + [ + 218.68795741935486, + "Ict_StratAndPlan_GoldSprova_Prod", + 20180331 + ], + [ + 0.14384913581657052, + "ssbciotelement01", + 20180331 + ], + [ + 0.009865586851323632, + "ict_stratandplan_goldsprova_prod", + 20180331 + ] + ] + } + } + ] + } + } + } +} \ No newline at end of file