From 71d612e7a3bcca7483a1e7f42d26cc4d93ac00cb Mon Sep 17 00:00:00 2001 From: Patricia Ornelas Jauregui Date: Tue, 8 Sep 2020 09:46:47 -0700 Subject: [PATCH 1/8] Creating separate swagger file for exports --- .../2020-06-01/costmanagement.exports.json | 1139 +++++++++++++++++ .../stable/2020-06-01/costmanagement.json | 740 ----------- 2 files changed, 1139 insertions(+), 740 deletions(-) create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json new file mode 100644 index 000000000000..87bcf6e2aa0c --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json @@ -0,0 +1,1139 @@ +{ + "swagger": "2.0", + "info": { + "version": "2020-06-01", + "title": "CostManagementClient" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow.", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/{scope}/providers/Microsoft.CostManagement/exports": { + "get": { + "tags": [ + "Exports" + ], + "operationId": "Exports_List", + "description": "The operation to list all exports at the given scope.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportsGetBySubscription": { + "$ref": "./examples/ExportsGetBySubscription.json" + }, + "ExportsGetByResourceGroup": { + "$ref": "./examples/ExportsGetByResourceGroup.json" + }, + "ExportsGetByBillingAccount": { + "$ref": "./examples/ExportsGetByBillingAccount.json" + }, + "ExportsGetByDepartment": { + "$ref": "./examples/ExportsGetByDepartment.json" + }, + "ExportsGetByEnrollmentAccount": { + "$ref": "./examples/ExportsGetByEnrollmentAccount.json" + }, + "ExportsGetByManagementGroup": { + "$ref": "./examples/ExportsGetByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "$expand", + "description": "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last execution of each export.", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ExportListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}": { + "get": { + "tags": [ + "Exports" + ], + "operationId": "Exports_Get", + "description": "The operation to get the export for the defined scope by export name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportGetBySubscription": { + "$ref": "./examples/ExportGetBySubscription.json" + }, + "ExportGetByResourceGroup": { + "$ref": "./examples/ExportGetByResourceGroup.json" + }, + "ExportGetByBillingAccount": { + "$ref": "./examples/ExportGetByBillingAccount.json" + }, + "ExportGetByDepartment": { + "$ref": "./examples/ExportGetByDepartment.json" + }, + "ExportGetByEnrollmentAccount": { + "$ref": "./examples/ExportGetByEnrollmentAccount.json" + }, + "ExportGetByManagementGroup": { + "$ref": "./examples/ExportGetByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + }, + { + "name": "$expand", + "description": "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 executions of the export.", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Export" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Exports" + ], + "operationId": "Exports_CreateOrUpdate", + "description": "The operation to create or update a export. Update operation requires latest eTag to be set in the request. 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/costmanagement/" + }, + "x-ms-examples": { + "ExportCreateOrUpdateBySubscription": { + "$ref": "./examples/ExportCreateOrUpdateBySubscription.json" + }, + "ExportCreateOrUpdateByResourceGroup": { + "$ref": "./examples/ExportCreateOrUpdateByResourceGroup.json" + }, + "ExportCreateOrUpdateByBillingAccount": { + "$ref": "./examples/ExportCreateOrUpdateByBillingAccount.json" + }, + "ExportCreateOrUpdateByDepartment": { + "$ref": "./examples/ExportCreateOrUpdateByDepartment.json" + }, + "ExportCreateOrUpdateByEnrollmentAccount": { + "$ref": "./examples/ExportCreateOrUpdateByEnrollmentAccount.json" + }, + "ExportCreateOrUpdateByManagementGroup": { + "$ref": "./examples/ExportCreateOrUpdateByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Export" + }, + "description": "Parameters supplied to the CreateOrUpdate Export operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Export" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/Export" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Exports" + ], + "operationId": "Exports_Delete", + "description": "The operation to delete a export.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportDeleteBySubscription": { + "$ref": "./examples/ExportDeleteBySubscription.json" + }, + "ExportDeleteByResourceGroup": { + "$ref": "./examples/ExportDeleteByResourceGroup.json" + }, + "ExportDeleteByBillingAccount": { + "$ref": "./examples/ExportDeleteByBillingAccount.json" + }, + "ExportDeleteByEnrollmentAccount": { + "$ref": "./examples/ExportDeleteByEnrollmentAccount.json" + }, + "ExportDeleteByDepartment": { + "$ref": "./examples/ExportDeleteByDepartment.json" + }, + "ExportDeleteByManagementGroup": { + "$ref": "./examples/ExportDeleteByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run": { + "post": { + "tags": [ + "Exports" + ], + "operationId": "Exports_Execute", + "description": "The operation to execute an export.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportRunBySubscription": { + "$ref": "./examples/ExportRunBySubscription.json" + }, + "ExportRunByResourceGroup": { + "$ref": "./examples/ExportRunByResourceGroup.json" + }, + "ExportRunByBillingAccount": { + "$ref": "./examples/ExportRunByBillingAccount.json" + }, + "ExportRunByDepartment": { + "$ref": "./examples/ExportRunByDepartment.json" + }, + "ExportRunByEnrollmentAccount": { + "$ref": "./examples/ExportRunByEnrollmentAccount.json" + }, + "ExportRunByManagementGroup": { + "$ref": "./examples/ExportRunByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory": { + "get": { + "tags": [ + "Exports" + ], + "operationId": "Exports_GetExecutionHistory", + "description": "The operation to get the execution history of an export for the defined scope and export name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportRunHistoryGetBySubscription": { + "$ref": "./examples/ExportRunHistoryGetBySubscription.json" + }, + "ExportRunHistoryGetByResourceGroup": { + "$ref": "./examples/ExportRunHistoryGetByResourceGroup.json" + }, + "ExportRunHistoryGetByBillingAccount": { + "$ref": "./examples/ExportRunHistoryGetByBillingAccount.json" + }, + "ExportRunHistoryGetByDepartment": { + "$ref": "./examples/ExportRunHistoryGetByDepartment.json" + }, + "ExportRunHistoryGetByEnrollmentAccount": { + "$ref": "./examples/ExportRunHistoryGetByEnrollmentAccount.json" + }, + "ExportRunHistoryGetByManagementGroup": { + "$ref": "./examples/ExportRunHistoryGetByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ExportExecutionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "ReportConfigDefinition": { + "description": "The definition of a report config.", + "properties": { + "type": { + "description": "The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.", + "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": "ReportTimeframeType", + "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" + ] + }, + "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", + "format": "date-time" + }, + "to": { + "description": "The end date to pull data to.", + "type": "string", + "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", + "enum": [ + "Daily", + "Monthly" + ], + "x-ms-enum": { + "name": "ReportGranularityType", + "modelAsString": 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" + }, + "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 up to 2 aggregation clauses.", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/ReportConfigAggregation" + }, + "maxItems": 2 + }, + "grouping": { + "description": "Array of group by expression to use in the report. Report can have up to 2 group by clauses.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigGrouping" + }, + "maxItems": 2 + }, + "sorting": { + "description": "Array of order by expression to use in the report.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigSorting" + } + }, + "filter": { + "type": "object", + "description": "Has filter expression to use in the report.", + "$ref": "#/definitions/ReportConfigFilter" + } + } + }, + "ReportConfigDatasetConfiguration": { + "description": "The configuration of dataset in the report.", + "properties": { + "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", + "items": { + "type": "string" + } + } + } + }, + "ReportConfigAggregation": { + "description": "The aggregation expression to be used in the report.", + "properties": { + "name": { + "description": "The name of the column to aggregate.", + "type": "string" + }, + "function": { + "description": "The name of the aggregation function to use.", + "type": "string", + "enum": [ + "Sum" + ], + "x-ms-enum": { + "name": "FunctionType", + "modelAsString": true + } + } + }, + "required": [ + "name", + "function" + ] + }, + "ReportConfigSorting": { + "description": "The order by expression to be used in the report.", + "properties": { + "direction": { + "description": "Direction of sort.", + "type": "string", + "enum": [ + "Ascending", + "Descending" + ] + }, + "name": { + "description": "The name of the column to sort.", + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "ReportConfigGrouping": { + "description": "The group by expression to be used in the report.", + "properties": { + "type": { + "description": "Has type of the column to group.", + "$ref": "#/definitions/ReportConfigColumnType" + }, + "name": { + "description": "The name of the column to group. This version supports subscription lowest possible grain.", + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + }, + "ReportConfigFilter": { + "description": "The filter expression to be used in the report.", + "properties": { + "and": { + "description": "The logical \"AND\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 + }, + "or": { + "description": "The logical \"OR\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 + }, + "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 comparison.", + "type": "string" + }, + "operator": { + "description": "The operator to use for comparison.", + "type": "string", + "enum": [ + "In", + "Contains" + ], + "x-ms-enum": { + "name": "OperatorType", + "modelAsString": true + } + }, + "values": { + "description": "Array of values to use for comparison", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, + "ErrorResponse": { + "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "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 + } + } + }, + "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 + }, + "ProxyResource": { + "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." + }, + "eTag": { + "type": "string", + "description": "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not." + } + }, + "x-ms-azure-resource": true + }, + "ExportListResult": { + "description": "Result of listing exports. It contains a list of available exports in the scope provided.", + "type": "object", + "properties": { + "value": { + "description": "The list of exports.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Export" + } + } + } + }, + "Export": { + "description": "An export resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ExportProperties", + "title": "Export properties" + } + } + }, + "ExportProperties": { + "description": "The properties of the export.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CommonExportProperties" + } + ], + "properties": { + "schedule": { + "description": "Has schedule information for the export.", + "$ref": "#/definitions/ExportSchedule" + } + } + }, + "CommonExportProperties": { + "description": "The common properties of the export.", + "type": "object", + "properties": { + "format": { + "description": "The format of the export being delivered. Currently only 'Csv' is supported.", + "type": "string", + "enum": [ + "Csv" + ], + "x-ms-enum": { + "name": "FormatType", + "modelAsString": true + } + }, + "deliveryInfo": { + "description": "Has delivery information for the export.", + "$ref": "#/definitions/ExportDeliveryInfo" + }, + "definition": { + "description": "Has the definition for the export.", + "$ref": "#/definitions/ExportDefinition" + }, + "runHistory": { + "description": "If requested, has the most recent execution history for the export.", + "$ref": "#/definitions/ExportExecutionListResult" + }, + "nextRunTimeEstimate": { + "description": "If the export has an active schedule, provides an estimate of the next execution time.", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "required": [ + "deliveryInfo", + "definition" + ] + }, + "ExportSchedule": { + "description": "The schedule associated with the export.", + "type": "object", + "properties": { + "status": { + "description": "The status of the export's schedule. If 'Inactive', the export's schedule 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/ExportRecurrencePeriod" + } + }, + "required": [ + "recurrence" + ] + }, + "ExportDeliveryInfo": { + "description": "The delivery information associated with a export.", + "type": "object", + "properties": { + "destination": { + "description": "Has destination for the export being delivered.", + "$ref": "#/definitions/ExportDeliveryDestination" + } + }, + "required": [ + "destination" + ] + }, + "ExportRecurrencePeriod": { + "description": "The start and end date for recurrence schedule.", + "type": "object", + "properties": { + "from": { + "description": "The start date of recurrence.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date of recurrence.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from" + ] + }, + "ExportDeliveryDestination": { + "description": "The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services .", + "type": "object", + "properties": { + "resourceId": { + "description": "The resource id of the storage account where exports will be delivered.", + "type": "string" + }, + "container": { + "description": "The name of the container where exports will be uploaded.", + "type": "string" + }, + "rootFolderPath": { + "description": "The name of the directory where exports will be uploaded.", + "type": "string" + } + }, + "required": [ + "resourceId", + "container" + ] + }, + "ExportDefinition": { + "description": "The definition of an export.", + "type": "object", + "properties": { + "type": { + "description": "The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations.", + "type": "string", + "enum": [ + "Usage", + "ActualCost", + "AmortizedCost" + ], + "x-ms-enum": { + "name": "ExportType", + "modelAsString": true + } + }, + "timeframe": { + "description": "The time frame for pulling data for the export. If custom, then a specific time period must be provided.", + "type": "string", + "enum": [ + "MonthToDate", + "BillingMonthToDate", + "TheLastMonth", + "TheLastBillingMonth", + "WeekToDate", + "Custom" + ], + "x-ms-enum": { + "name": "TimeframeType", + "modelAsString": true + } + }, + "timePeriod": { + "description": "Has time period for pulling data for the export.", + "$ref": "#/definitions/ExportTimePeriod" + }, + "dataSet": { + "description": "The definition for data in the export.", + "$ref": "#/definitions/ExportDataset" + } + }, + "required": [ + "type", + "timeframe" + ] + }, + "ExportDataset": { + "description": "The definition for data in the export.", + "type": "object", + "properties": { + "granularity": { + "description": "The granularity of rows in the export. Currently only 'Daily' is supported.", + "type": "string", + "enum": [ + "Daily" + ], + "x-ms-enum": { + "name": "GranularityType", + "modelAsString": true + } + }, + "configuration": { + "description": "The export dataset configuration.", + "$ref": "#/definitions/ExportDatasetConfiguration" + } + } + }, + "ExportDatasetConfiguration": { + "description": "The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns.", + "type": "object", + "properties": { + "columns": { + "description": "Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ExportTimePeriod": { + "description": "The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months.", + "type": "object", + "properties": { + "from": { + "description": "The start date for export data.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date for export data.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from", + "to" + ] + }, + "ExportExecutionListResult": { + "description": "Result of listing the execution history of an export.", + "type": "object", + "properties": { + "value": { + "description": "A list of export executions.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/ExportExecution" + } + } + } + }, + "ExportExecution": { + "description": "An export execution.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ExportExecutionProperties", + "title": "Export execution properties" + } + } + }, + "ExportExecutionProperties": { + "description": "The properties of the export execution.", + "type": "object", + "properties": { + "executionType": { + "description": "The type of the export execution.", + "type": "string", + "enum": [ + "OnDemand", + "Scheduled" + ], + "x-ms-enum": { + "name": "ExecutionType", + "modelAsString": true + } + }, + "status": { + "description": "The last known status of the export execution.", + "type": "string", + "enum": [ + "Queued", + "InProgress", + "Completed", + "Failed", + "Timeout", + "NewDataNotAvailable", + "DataNotAvailable" + ], + "x-ms-enum": { + "name": "ExecutionStatus", + "modelAsString": true + } + }, + "submittedBy": { + "description": "The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions it is 'System'.", + "type": "string" + }, + "submittedTime": { + "description": "The time when export was queued to be executed.", + "type": "string", + "format": "date-time" + }, + "processingStartTime": { + "description": "The time when export was picked up to be executed.", + "type": "string", + "format": "date-time" + }, + "processingEndTime": { + "description": "The time when the export execution finished.", + "type": "string", + "format": "date-time" + }, + "fileName": { + "description": "The name of the exported file.", + "type": "string" + }, + "runSettings": { + "description": "The export settings that were in effect for this execution.", + "$ref": "#/definitions/CommonExportProperties" + }, + "error": { + "description": "The details of any error.", + "$ref": "#/definitions/ErrorDetails" + } + } + } + }, + "parameters": { + "apiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request. The current version is 2020-06-01." + }, + "scopeExportParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "exportNameParameter": { + "name": "exportName", + "in": "path", + "description": "Export Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json index b08ae42f80d7..b5108415fa73 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json @@ -1098,364 +1098,6 @@ } } }, - "/{scope}/providers/Microsoft.CostManagement/exports": { - "get": { - "tags": [ - "Exports" - ], - "operationId": "Exports_List", - "description": "The operation to list all exports at the given scope.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportsGetBySubscription": { - "$ref": "./examples/ExportsGetBySubscription.json" - }, - "ExportsGetByResourceGroup": { - "$ref": "./examples/ExportsGetByResourceGroup.json" - }, - "ExportsGetByBillingAccount": { - "$ref": "./examples/ExportsGetByBillingAccount.json" - }, - "ExportsGetByDepartment": { - "$ref": "./examples/ExportsGetByDepartment.json" - }, - "ExportsGetByEnrollmentAccount": { - "$ref": "./examples/ExportsGetByEnrollmentAccount.json" - }, - "ExportsGetByManagementGroup": { - "$ref": "./examples/ExportsGetByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersion20200601Parameter" - }, - { - "name": "$expand", - "description": "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last execution of each export.", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/ExportListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}": { - "get": { - "tags": [ - "Exports" - ], - "operationId": "Exports_Get", - "description": "The operation to get the export for the defined scope by export name.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportGetBySubscription": { - "$ref": "./examples/ExportGetBySubscription.json" - }, - "ExportGetByResourceGroup": { - "$ref": "./examples/ExportGetByResourceGroup.json" - }, - "ExportGetByBillingAccount": { - "$ref": "./examples/ExportGetByBillingAccount.json" - }, - "ExportGetByDepartment": { - "$ref": "./examples/ExportGetByDepartment.json" - }, - "ExportGetByEnrollmentAccount": { - "$ref": "./examples/ExportGetByEnrollmentAccount.json" - }, - "ExportGetByManagementGroup": { - "$ref": "./examples/ExportGetByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersion20200601Parameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - }, - { - "name": "$expand", - "description": "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 executions of the export.", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/Export" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "Exports" - ], - "operationId": "Exports_CreateOrUpdate", - "description": "The operation to create or update a export. Update operation requires latest eTag to be set in the request. 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/costmanagement/" - }, - "x-ms-examples": { - "ExportCreateOrUpdateBySubscription": { - "$ref": "./examples/ExportCreateOrUpdateBySubscription.json" - }, - "ExportCreateOrUpdateByResourceGroup": { - "$ref": "./examples/ExportCreateOrUpdateByResourceGroup.json" - }, - "ExportCreateOrUpdateByBillingAccount": { - "$ref": "./examples/ExportCreateOrUpdateByBillingAccount.json" - }, - "ExportCreateOrUpdateByDepartment": { - "$ref": "./examples/ExportCreateOrUpdateByDepartment.json" - }, - "ExportCreateOrUpdateByEnrollmentAccount": { - "$ref": "./examples/ExportCreateOrUpdateByEnrollmentAccount.json" - }, - "ExportCreateOrUpdateByManagementGroup": { - "$ref": "./examples/ExportCreateOrUpdateByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersion20200601Parameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Export" - }, - "description": "Parameters supplied to the CreateOrUpdate Export operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/Export" - } - }, - "201": { - "description": "Created.", - "schema": { - "$ref": "#/definitions/Export" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "Exports" - ], - "operationId": "Exports_Delete", - "description": "The operation to delete a export.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportDeleteBySubscription": { - "$ref": "./examples/ExportDeleteBySubscription.json" - }, - "ExportDeleteByResourceGroup": { - "$ref": "./examples/ExportDeleteByResourceGroup.json" - }, - "ExportDeleteByBillingAccount": { - "$ref": "./examples/ExportDeleteByBillingAccount.json" - }, - "ExportDeleteByEnrollmentAccount": { - "$ref": "./examples/ExportDeleteByEnrollmentAccount.json" - }, - "ExportDeleteByDepartment": { - "$ref": "./examples/ExportDeleteByDepartment.json" - }, - "ExportDeleteByManagementGroup": { - "$ref": "./examples/ExportDeleteByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersion20200601Parameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run": { - "post": { - "tags": [ - "Exports" - ], - "operationId": "Exports_Execute", - "description": "The operation to execute an export.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportRunBySubscription": { - "$ref": "./examples/ExportRunBySubscription.json" - }, - "ExportRunByResourceGroup": { - "$ref": "./examples/ExportRunByResourceGroup.json" - }, - "ExportRunByBillingAccount": { - "$ref": "./examples/ExportRunByBillingAccount.json" - }, - "ExportRunByDepartment": { - "$ref": "./examples/ExportRunByDepartment.json" - }, - "ExportRunByEnrollmentAccount": { - "$ref": "./examples/ExportRunByEnrollmentAccount.json" - }, - "ExportRunByManagementGroup": { - "$ref": "./examples/ExportRunByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersion20200601Parameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory": { - "get": { - "tags": [ - "Exports" - ], - "operationId": "Exports_GetExecutionHistory", - "description": "The operation to get the execution history of an export for the defined scope and export name.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportRunHistoryGetBySubscription": { - "$ref": "./examples/ExportRunHistoryGetBySubscription.json" - }, - "ExportRunHistoryGetByResourceGroup": { - "$ref": "./examples/ExportRunHistoryGetByResourceGroup.json" - }, - "ExportRunHistoryGetByBillingAccount": { - "$ref": "./examples/ExportRunHistoryGetByBillingAccount.json" - }, - "ExportRunHistoryGetByDepartment": { - "$ref": "./examples/ExportRunHistoryGetByDepartment.json" - }, - "ExportRunHistoryGetByEnrollmentAccount": { - "$ref": "./examples/ExportRunHistoryGetByEnrollmentAccount.json" - }, - "ExportRunHistoryGetByManagementGroup": { - "$ref": "./examples/ExportRunHistoryGetByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersion20200601Parameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/ExportExecutionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, "/providers/Microsoft.CostManagement/operations": { "get": { "tags": [ @@ -2789,380 +2431,6 @@ "operator", "values" ] - }, - "ExportListResult": { - "description": "Result of listing exports. It contains a list of available exports in the scope provided.", - "type": "object", - "properties": { - "value": { - "description": "The list of exports.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Export" - } - } - } - }, - "Export": { - "description": "An export resource.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ExportProperties", - "title": "Export properties" - } - } - }, - "ExportProperties": { - "description": "The properties of the export.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/CommonExportProperties" - } - ], - "properties": { - "schedule": { - "description": "Has schedule information for the export.", - "$ref": "#/definitions/ExportSchedule" - } - } - }, - "CommonExportProperties": { - "description": "The common properties of the export.", - "type": "object", - "properties": { - "format": { - "description": "The format of the export being delivered. Currently only 'Csv' is supported.", - "type": "string", - "enum": [ - "Csv" - ], - "x-ms-enum": { - "name": "FormatType", - "modelAsString": true - } - }, - "deliveryInfo": { - "description": "Has delivery information for the export.", - "$ref": "#/definitions/ExportDeliveryInfo" - }, - "definition": { - "description": "Has the definition for the export.", - "$ref": "#/definitions/ExportDefinition" - }, - "runHistory": { - "description": "If requested, has the most recent execution history for the export.", - "$ref": "#/definitions/ExportExecutionListResult" - }, - "nextRunTimeEstimate": { - "description": "If the export has an active schedule, provides an estimate of the next execution time.", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "required": [ - "deliveryInfo", - "definition" - ] - }, - "ExportSchedule": { - "description": "The schedule associated with the export.", - "type": "object", - "properties": { - "status": { - "description": "The status of the export's schedule. If 'Inactive', the export's schedule 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/ExportRecurrencePeriod" - } - }, - "required": [ - "recurrence" - ] - }, - "ExportDeliveryInfo": { - "description": "The delivery information associated with a export.", - "type": "object", - "properties": { - "destination": { - "description": "Has destination for the export being delivered.", - "$ref": "#/definitions/ExportDeliveryDestination" - } - }, - "required": [ - "destination" - ] - }, - "ExportRecurrencePeriod": { - "description": "The start and end date for recurrence schedule.", - "type": "object", - "properties": { - "from": { - "description": "The start date of recurrence.", - "type": "string", - "format": "date-time" - }, - "to": { - "description": "The end date of recurrence.", - "type": "string", - "format": "date-time" - } - }, - "required": [ - "from" - ] - }, - "ExportDeliveryDestination": { - "description": "The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services .", - "type": "object", - "properties": { - "resourceId": { - "description": "The resource id of the storage account where exports will be delivered.", - "type": "string" - }, - "container": { - "description": "The name of the container where exports will be uploaded.", - "type": "string" - }, - "rootFolderPath": { - "description": "The name of the directory where exports will be uploaded.", - "type": "string" - } - }, - "required": [ - "resourceId", - "container" - ] - }, - "ExportDefinition": { - "description": "The definition of an export.", - "type": "object", - "properties": { - "type": { - "description": "The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations.", - "type": "string", - "enum": [ - "Usage", - "ActualCost", - "AmortizedCost" - ], - "x-ms-enum": { - "name": "ExportType", - "modelAsString": true - } - }, - "timeframe": { - "description": "The time frame for pulling data for the export. If custom, then a specific time period must be provided.", - "type": "string", - "enum": [ - "MonthToDate", - "BillingMonthToDate", - "TheLastMonth", - "TheLastBillingMonth", - "WeekToDate", - "Custom" - ], - "x-ms-enum": { - "name": "TimeframeType", - "modelAsString": true - } - }, - "timePeriod": { - "description": "Has time period for pulling data for the export.", - "$ref": "#/definitions/ExportTimePeriod" - }, - "dataSet": { - "description": "The definition for data in the export.", - "$ref": "#/definitions/ExportDataset" - } - }, - "required": [ - "type", - "timeframe" - ] - }, - "ExportDataset": { - "description": "The definition for data in the export.", - "type": "object", - "properties": { - "granularity": { - "description": "The granularity of rows in the export. Currently only 'Daily' is supported.", - "type": "string", - "enum": [ - "Daily" - ], - "x-ms-enum": { - "name": "GranularityType", - "modelAsString": true - } - }, - "configuration": { - "description": "The export dataset configuration.", - "$ref": "#/definitions/ExportDatasetConfiguration" - } - } - }, - "ExportDatasetConfiguration": { - "description": "The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns.", - "type": "object", - "properties": { - "columns": { - "description": "Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "ExportTimePeriod": { - "description": "The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months.", - "type": "object", - "properties": { - "from": { - "description": "The start date for export data.", - "type": "string", - "format": "date-time" - }, - "to": { - "description": "The end date for export data.", - "type": "string", - "format": "date-time" - } - }, - "required": [ - "from", - "to" - ] - }, - "ExportExecutionListResult": { - "description": "Result of listing the execution history of an export.", - "type": "object", - "properties": { - "value": { - "description": "A list of export executions.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/ExportExecution" - } - } - } - }, - "ExportExecution": { - "description": "An export execution.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ExportExecutionProperties", - "title": "Export execution properties" - } - } - }, - "ExportExecutionProperties": { - "description": "The properties of the export execution.", - "type": "object", - "properties": { - "executionType": { - "description": "The type of the export execution.", - "type": "string", - "enum": [ - "OnDemand", - "Scheduled" - ], - "x-ms-enum": { - "name": "ExecutionType", - "modelAsString": true - } - }, - "status": { - "description": "The last known status of the export execution.", - "type": "string", - "enum": [ - "Queued", - "InProgress", - "Completed", - "Failed", - "Timeout", - "NewDataNotAvailable", - "DataNotAvailable" - ], - "x-ms-enum": { - "name": "ExecutionStatus", - "modelAsString": true - } - }, - "submittedBy": { - "description": "The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions it is 'System'.", - "type": "string" - }, - "submittedTime": { - "description": "The time when export was queued to be executed.", - "type": "string", - "format": "date-time" - }, - "processingStartTime": { - "description": "The time when export was picked up to be executed.", - "type": "string", - "format": "date-time" - }, - "processingEndTime": { - "description": "The time when the export execution finished.", - "type": "string", - "format": "date-time" - }, - "fileName": { - "description": "The name of the exported file.", - "type": "string" - }, - "runSettings": { - "description": "The export settings that were in effect for this execution.", - "$ref": "#/definitions/CommonExportProperties" - }, - "error": { - "description": "The details of any error.", - "$ref": "#/definitions/ErrorDetails" - } - } } }, "parameters": { @@ -3279,14 +2547,6 @@ "type": "string", "x-ms-parameter-location": "method" }, - "exportNameParameter": { - "name": "exportName", - "in": "path", - "description": "Export Name.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, "externalCloudProviderTypeParameter": { "name": "externalCloudProviderType", "in": "path", From 346691927f7266149492556fe1c2a5b0732f8061 Mon Sep 17 00:00:00 2001 From: Patricia Ornelas Jauregui Date: Tue, 8 Sep 2020 10:12:27 -0700 Subject: [PATCH 2/8] add exports swagger to readme --- specification/cost-management/resource-manager/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index 26eb8c98ebb2..d1f0622a640e 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -50,6 +50,7 @@ These settings apply only when `--tag=package-2020-06` is specified on the comma ```yaml $(tag) == 'package-2020-06' input-file: - Microsoft.CostManagement/stable/2020-06-01/costmanagement.json + - Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json ``` From 0ed8147311303adaef090ebf93f80cf55a20bc1d Mon Sep 17 00:00:00 2001 From: Patricia Ornelas Jauregui Date: Tue, 8 Sep 2020 10:38:58 -0700 Subject: [PATCH 3/8] edit api version --- .../stable/2020-06-01/costmanagement.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json index b5108415fa73..1bf76b2ce885 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json @@ -2435,13 +2435,6 @@ }, "parameters": { "apiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Version of the API to be used with the client request. The current version is 2019-11-01." - }, - "apiVersion20200601Parameter": { "name": "api-version", "in": "query", "required": true, From 36730f5c0dff40790d8f7a0ceed63fd7c411f4f5 Mon Sep 17 00:00:00 2001 From: Patricia Ornelas Jauregui Date: Tue, 8 Sep 2020 13:44:46 -0700 Subject: [PATCH 4/8] add "TheLast7Days" to exports timeframes --- .../stable/2020-06-01/costmanagement.exports.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json index 87bcf6e2aa0c..a35e91f6596e 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json @@ -936,7 +936,8 @@ "MonthToDate", "BillingMonthToDate", "TheLastMonth", - "TheLastBillingMonth", + "TheLastBillingMonth", + "TheLast7Days", "WeekToDate", "Custom" ], From a90f8790fe79245799115a69bfceb3d5a2e69053 Mon Sep 17 00:00:00 2001 From: Patricia Ornelas Jauregui Date: Thu, 17 Sep 2020 20:09:55 -0700 Subject: [PATCH 5/8] remove 'TheLast7Days' from export timeframes --- .../stable/2020-06-01/costmanagement.exports.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json index a35e91f6596e..5c3aa78b8b90 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json @@ -937,7 +937,6 @@ "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", - "TheLast7Days", "WeekToDate", "Custom" ], From 29b0358bbc18919cc5a754dc9ea1dba687a113f7 Mon Sep 17 00:00:00 2001 From: Patricia Ornelas Jauregui Date: Fri, 18 Sep 2020 13:25:20 -0700 Subject: [PATCH 6/8] prettier fix --- .../stable/2020-06-01/costmanagement.exports.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json index 5c3aa78b8b90..87bcf6e2aa0c 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json @@ -936,7 +936,7 @@ "MonthToDate", "BillingMonthToDate", "TheLastMonth", - "TheLastBillingMonth", + "TheLastBillingMonth", "WeekToDate", "Custom" ], From db98160d5bcbde03e9bba94ca5f6ebfc31b41aa7 Mon Sep 17 00:00:00 2001 From: Patricia Ornelas Jauregui Date: Fri, 18 Sep 2020 16:06:09 -0700 Subject: [PATCH 7/8] prettier fix 2 --- .../2020-06-01/costmanagement.exports.json | 2274 ++++++++--------- 1 file changed, 1137 insertions(+), 1137 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json index 87bcf6e2aa0c..6f5153b995a9 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json @@ -1,1139 +1,1139 @@ { - "swagger": "2.0", - "info": { - "version": "2020-06-01", - "title": "CostManagementClient" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{scope}/providers/Microsoft.CostManagement/exports": { - "get": { - "tags": [ - "Exports" - ], - "operationId": "Exports_List", - "description": "The operation to list all exports at the given scope.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportsGetBySubscription": { - "$ref": "./examples/ExportsGetBySubscription.json" - }, - "ExportsGetByResourceGroup": { - "$ref": "./examples/ExportsGetByResourceGroup.json" - }, - "ExportsGetByBillingAccount": { - "$ref": "./examples/ExportsGetByBillingAccount.json" - }, - "ExportsGetByDepartment": { - "$ref": "./examples/ExportsGetByDepartment.json" - }, - "ExportsGetByEnrollmentAccount": { - "$ref": "./examples/ExportsGetByEnrollmentAccount.json" - }, - "ExportsGetByManagementGroup": { - "$ref": "./examples/ExportsGetByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeExportParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "$expand", - "description": "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last execution of each export.", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/ExportListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}": { - "get": { - "tags": [ - "Exports" - ], - "operationId": "Exports_Get", - "description": "The operation to get the export for the defined scope by export name.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportGetBySubscription": { - "$ref": "./examples/ExportGetBySubscription.json" - }, - "ExportGetByResourceGroup": { - "$ref": "./examples/ExportGetByResourceGroup.json" - }, - "ExportGetByBillingAccount": { - "$ref": "./examples/ExportGetByBillingAccount.json" - }, - "ExportGetByDepartment": { - "$ref": "./examples/ExportGetByDepartment.json" - }, - "ExportGetByEnrollmentAccount": { - "$ref": "./examples/ExportGetByEnrollmentAccount.json" - }, - "ExportGetByManagementGroup": { - "$ref": "./examples/ExportGetByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeExportParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - }, - { - "name": "$expand", - "description": "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 executions of the export.", - "in": "query", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/Export" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "Exports" - ], - "operationId": "Exports_CreateOrUpdate", - "description": "The operation to create or update a export. Update operation requires latest eTag to be set in the request. 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/costmanagement/" - }, - "x-ms-examples": { - "ExportCreateOrUpdateBySubscription": { - "$ref": "./examples/ExportCreateOrUpdateBySubscription.json" - }, - "ExportCreateOrUpdateByResourceGroup": { - "$ref": "./examples/ExportCreateOrUpdateByResourceGroup.json" - }, - "ExportCreateOrUpdateByBillingAccount": { - "$ref": "./examples/ExportCreateOrUpdateByBillingAccount.json" - }, - "ExportCreateOrUpdateByDepartment": { - "$ref": "./examples/ExportCreateOrUpdateByDepartment.json" - }, - "ExportCreateOrUpdateByEnrollmentAccount": { - "$ref": "./examples/ExportCreateOrUpdateByEnrollmentAccount.json" - }, - "ExportCreateOrUpdateByManagementGroup": { - "$ref": "./examples/ExportCreateOrUpdateByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeExportParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Export" - }, - "description": "Parameters supplied to the CreateOrUpdate Export operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/Export" - } - }, - "201": { - "description": "Created.", - "schema": { - "$ref": "#/definitions/Export" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "Exports" - ], - "operationId": "Exports_Delete", - "description": "The operation to delete a export.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportDeleteBySubscription": { - "$ref": "./examples/ExportDeleteBySubscription.json" - }, - "ExportDeleteByResourceGroup": { - "$ref": "./examples/ExportDeleteByResourceGroup.json" - }, - "ExportDeleteByBillingAccount": { - "$ref": "./examples/ExportDeleteByBillingAccount.json" - }, - "ExportDeleteByEnrollmentAccount": { - "$ref": "./examples/ExportDeleteByEnrollmentAccount.json" - }, - "ExportDeleteByDepartment": { - "$ref": "./examples/ExportDeleteByDepartment.json" - }, - "ExportDeleteByManagementGroup": { - "$ref": "./examples/ExportDeleteByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeExportParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run": { - "post": { - "tags": [ - "Exports" - ], - "operationId": "Exports_Execute", - "description": "The operation to execute an export.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportRunBySubscription": { - "$ref": "./examples/ExportRunBySubscription.json" - }, - "ExportRunByResourceGroup": { - "$ref": "./examples/ExportRunByResourceGroup.json" - }, - "ExportRunByBillingAccount": { - "$ref": "./examples/ExportRunByBillingAccount.json" - }, - "ExportRunByDepartment": { - "$ref": "./examples/ExportRunByDepartment.json" - }, - "ExportRunByEnrollmentAccount": { - "$ref": "./examples/ExportRunByEnrollmentAccount.json" - }, - "ExportRunByManagementGroup": { - "$ref": "./examples/ExportRunByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeExportParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory": { - "get": { - "tags": [ - "Exports" - ], - "operationId": "Exports_GetExecutionHistory", - "description": "The operation to get the execution history of an export for the defined scope and export name.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExportRunHistoryGetBySubscription": { - "$ref": "./examples/ExportRunHistoryGetBySubscription.json" - }, - "ExportRunHistoryGetByResourceGroup": { - "$ref": "./examples/ExportRunHistoryGetByResourceGroup.json" - }, - "ExportRunHistoryGetByBillingAccount": { - "$ref": "./examples/ExportRunHistoryGetByBillingAccount.json" - }, - "ExportRunHistoryGetByDepartment": { - "$ref": "./examples/ExportRunHistoryGetByDepartment.json" - }, - "ExportRunHistoryGetByEnrollmentAccount": { - "$ref": "./examples/ExportRunHistoryGetByEnrollmentAccount.json" - }, - "ExportRunHistoryGetByManagementGroup": { - "$ref": "./examples/ExportRunHistoryGetByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeExportParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/ExportExecutionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "ReportConfigDefinition": { - "description": "The definition of a report config.", - "properties": { - "type": { - "description": "The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.", - "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": "ReportTimeframeType", - "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" - ] - }, - "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", - "format": "date-time" - }, - "to": { - "description": "The end date to pull data to.", - "type": "string", - "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", - "enum": [ - "Daily", - "Monthly" - ], - "x-ms-enum": { - "name": "ReportGranularityType", - "modelAsString": 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" - }, - "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 up to 2 aggregation clauses.", - "additionalProperties": { - "type": "object", - "$ref": "#/definitions/ReportConfigAggregation" - }, - "maxItems": 2 - }, - "grouping": { - "description": "Array of group by expression to use in the report. Report can have up to 2 group by clauses.", - "type": "array", - "items": { - "$ref": "#/definitions/ReportConfigGrouping" - }, - "maxItems": 2 - }, - "sorting": { - "description": "Array of order by expression to use in the report.", - "type": "array", - "items": { - "$ref": "#/definitions/ReportConfigSorting" - } - }, - "filter": { - "type": "object", - "description": "Has filter expression to use in the report.", - "$ref": "#/definitions/ReportConfigFilter" - } - } - }, - "ReportConfigDatasetConfiguration": { - "description": "The configuration of dataset in the report.", - "properties": { - "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", - "items": { - "type": "string" - } - } - } - }, - "ReportConfigAggregation": { - "description": "The aggregation expression to be used in the report.", - "properties": { - "name": { - "description": "The name of the column to aggregate.", - "type": "string" - }, - "function": { - "description": "The name of the aggregation function to use.", - "type": "string", - "enum": [ - "Sum" - ], - "x-ms-enum": { - "name": "FunctionType", - "modelAsString": true - } - } - }, - "required": [ - "name", - "function" - ] - }, - "ReportConfigSorting": { - "description": "The order by expression to be used in the report.", - "properties": { - "direction": { - "description": "Direction of sort.", - "type": "string", - "enum": [ - "Ascending", - "Descending" - ] - }, - "name": { - "description": "The name of the column to sort.", - "type": "string" - } - }, - "required": [ - "name" - ] - }, - "ReportConfigGrouping": { - "description": "The group by expression to be used in the report.", - "properties": { - "type": { - "description": "Has type of the column to group.", - "$ref": "#/definitions/ReportConfigColumnType" - }, - "name": { - "description": "The name of the column to group. This version supports subscription lowest possible grain.", - "type": "string" - } - }, - "required": [ - "type", - "name" - ] - }, - "ReportConfigFilter": { - "description": "The filter expression to be used in the report.", - "properties": { - "and": { - "description": "The logical \"AND\" expression. Must have at least 2 items.", - "type": "array", - "items": { - "$ref": "#/definitions/ReportConfigFilter" - }, - "minItems": 2 - }, - "or": { - "description": "The logical \"OR\" expression. Must have at least 2 items.", - "type": "array", - "items": { - "$ref": "#/definitions/ReportConfigFilter" - }, - "minItems": 2 - }, - "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 comparison.", - "type": "string" - }, - "operator": { - "description": "The operator to use for comparison.", - "type": "string", - "enum": [ - "In", - "Contains" - ], - "x-ms-enum": { - "name": "OperatorType", - "modelAsString": true - } - }, - "values": { - "description": "Array of values to use for comparison", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - } - }, - "required": [ - "name", - "operator", - "values" - ] - }, - "ErrorResponse": { - "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.", - "type": "object", - "properties": { - "error": { - "description": "The details of the error.", - "$ref": "#/definitions/ErrorDetails" - } - } - }, - "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 - } - } - }, - "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 - }, - "ProxyResource": { - "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." - }, - "eTag": { - "type": "string", - "description": "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not." - } - }, - "x-ms-azure-resource": true - }, - "ExportListResult": { - "description": "Result of listing exports. It contains a list of available exports in the scope provided.", - "type": "object", - "properties": { - "value": { - "description": "The list of exports.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Export" - } - } - } - }, - "Export": { - "description": "An export resource.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ExportProperties", - "title": "Export properties" - } - } - }, - "ExportProperties": { - "description": "The properties of the export.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/CommonExportProperties" - } - ], - "properties": { - "schedule": { - "description": "Has schedule information for the export.", - "$ref": "#/definitions/ExportSchedule" - } - } - }, - "CommonExportProperties": { - "description": "The common properties of the export.", - "type": "object", - "properties": { - "format": { - "description": "The format of the export being delivered. Currently only 'Csv' is supported.", - "type": "string", - "enum": [ - "Csv" - ], - "x-ms-enum": { - "name": "FormatType", - "modelAsString": true - } - }, - "deliveryInfo": { - "description": "Has delivery information for the export.", - "$ref": "#/definitions/ExportDeliveryInfo" - }, - "definition": { - "description": "Has the definition for the export.", - "$ref": "#/definitions/ExportDefinition" - }, - "runHistory": { - "description": "If requested, has the most recent execution history for the export.", - "$ref": "#/definitions/ExportExecutionListResult" - }, - "nextRunTimeEstimate": { - "description": "If the export has an active schedule, provides an estimate of the next execution time.", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "required": [ - "deliveryInfo", - "definition" - ] - }, - "ExportSchedule": { - "description": "The schedule associated with the export.", - "type": "object", - "properties": { - "status": { - "description": "The status of the export's schedule. If 'Inactive', the export's schedule 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/ExportRecurrencePeriod" - } - }, - "required": [ - "recurrence" - ] - }, - "ExportDeliveryInfo": { - "description": "The delivery information associated with a export.", - "type": "object", - "properties": { - "destination": { - "description": "Has destination for the export being delivered.", - "$ref": "#/definitions/ExportDeliveryDestination" - } - }, - "required": [ - "destination" - ] - }, - "ExportRecurrencePeriod": { - "description": "The start and end date for recurrence schedule.", - "type": "object", - "properties": { - "from": { - "description": "The start date of recurrence.", - "type": "string", - "format": "date-time" - }, - "to": { - "description": "The end date of recurrence.", - "type": "string", - "format": "date-time" - } - }, - "required": [ - "from" - ] - }, - "ExportDeliveryDestination": { - "description": "The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services .", - "type": "object", - "properties": { - "resourceId": { - "description": "The resource id of the storage account where exports will be delivered.", - "type": "string" - }, - "container": { - "description": "The name of the container where exports will be uploaded.", - "type": "string" - }, - "rootFolderPath": { - "description": "The name of the directory where exports will be uploaded.", - "type": "string" - } - }, - "required": [ - "resourceId", - "container" - ] - }, - "ExportDefinition": { - "description": "The definition of an export.", - "type": "object", - "properties": { - "type": { - "description": "The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations.", - "type": "string", - "enum": [ - "Usage", - "ActualCost", - "AmortizedCost" - ], - "x-ms-enum": { - "name": "ExportType", - "modelAsString": true - } - }, - "timeframe": { - "description": "The time frame for pulling data for the export. If custom, then a specific time period must be provided.", - "type": "string", - "enum": [ - "MonthToDate", - "BillingMonthToDate", - "TheLastMonth", - "TheLastBillingMonth", - "WeekToDate", - "Custom" - ], - "x-ms-enum": { - "name": "TimeframeType", - "modelAsString": true - } - }, - "timePeriod": { - "description": "Has time period for pulling data for the export.", - "$ref": "#/definitions/ExportTimePeriod" - }, - "dataSet": { - "description": "The definition for data in the export.", - "$ref": "#/definitions/ExportDataset" - } - }, - "required": [ - "type", - "timeframe" - ] - }, - "ExportDataset": { - "description": "The definition for data in the export.", - "type": "object", - "properties": { - "granularity": { - "description": "The granularity of rows in the export. Currently only 'Daily' is supported.", - "type": "string", - "enum": [ - "Daily" - ], - "x-ms-enum": { - "name": "GranularityType", - "modelAsString": true - } - }, - "configuration": { - "description": "The export dataset configuration.", - "$ref": "#/definitions/ExportDatasetConfiguration" - } - } - }, - "ExportDatasetConfiguration": { - "description": "The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns.", - "type": "object", - "properties": { - "columns": { - "description": "Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "ExportTimePeriod": { - "description": "The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months.", - "type": "object", - "properties": { - "from": { - "description": "The start date for export data.", - "type": "string", - "format": "date-time" - }, - "to": { - "description": "The end date for export data.", - "type": "string", - "format": "date-time" - } - }, - "required": [ - "from", - "to" - ] - }, - "ExportExecutionListResult": { - "description": "Result of listing the execution history of an export.", - "type": "object", - "properties": { - "value": { - "description": "A list of export executions.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/ExportExecution" - } - } - } - }, - "ExportExecution": { - "description": "An export execution.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ExportExecutionProperties", - "title": "Export execution properties" - } - } - }, - "ExportExecutionProperties": { - "description": "The properties of the export execution.", - "type": "object", - "properties": { - "executionType": { - "description": "The type of the export execution.", - "type": "string", - "enum": [ - "OnDemand", - "Scheduled" - ], - "x-ms-enum": { - "name": "ExecutionType", - "modelAsString": true - } - }, - "status": { - "description": "The last known status of the export execution.", - "type": "string", - "enum": [ - "Queued", - "InProgress", - "Completed", - "Failed", - "Timeout", - "NewDataNotAvailable", - "DataNotAvailable" - ], - "x-ms-enum": { - "name": "ExecutionStatus", - "modelAsString": true - } - }, - "submittedBy": { - "description": "The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions it is 'System'.", - "type": "string" - }, - "submittedTime": { - "description": "The time when export was queued to be executed.", - "type": "string", - "format": "date-time" - }, - "processingStartTime": { - "description": "The time when export was picked up to be executed.", - "type": "string", - "format": "date-time" - }, - "processingEndTime": { - "description": "The time when the export execution finished.", - "type": "string", - "format": "date-time" - }, - "fileName": { - "description": "The name of the exported file.", - "type": "string" - }, - "runSettings": { - "description": "The export settings that were in effect for this execution.", - "$ref": "#/definitions/CommonExportProperties" - }, - "error": { - "description": "The details of any error.", - "$ref": "#/definitions/ErrorDetails" - } - } - } - }, - "parameters": { - "apiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Version of the API to be used with the client request. The current version is 2020-06-01." - }, - "scopeExportParameter": { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true - }, - "exportNameParameter": { - "name": "exportName", - "in": "path", - "description": "Export Name.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - } - } + "swagger": "2.0", + "info": { + "version": "2020-06-01", + "title": "CostManagementClient" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow.", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/{scope}/providers/Microsoft.CostManagement/exports": { + "get": { + "tags": [ + "Exports" + ], + "operationId": "Exports_List", + "description": "The operation to list all exports at the given scope.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportsGetBySubscription": { + "$ref": "./examples/ExportsGetBySubscription.json" + }, + "ExportsGetByResourceGroup": { + "$ref": "./examples/ExportsGetByResourceGroup.json" + }, + "ExportsGetByBillingAccount": { + "$ref": "./examples/ExportsGetByBillingAccount.json" + }, + "ExportsGetByDepartment": { + "$ref": "./examples/ExportsGetByDepartment.json" + }, + "ExportsGetByEnrollmentAccount": { + "$ref": "./examples/ExportsGetByEnrollmentAccount.json" + }, + "ExportsGetByManagementGroup": { + "$ref": "./examples/ExportsGetByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "$expand", + "description": "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last execution of each export.", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ExportListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}": { + "get": { + "tags": [ + "Exports" + ], + "operationId": "Exports_Get", + "description": "The operation to get the export for the defined scope by export name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportGetBySubscription": { + "$ref": "./examples/ExportGetBySubscription.json" + }, + "ExportGetByResourceGroup": { + "$ref": "./examples/ExportGetByResourceGroup.json" + }, + "ExportGetByBillingAccount": { + "$ref": "./examples/ExportGetByBillingAccount.json" + }, + "ExportGetByDepartment": { + "$ref": "./examples/ExportGetByDepartment.json" + }, + "ExportGetByEnrollmentAccount": { + "$ref": "./examples/ExportGetByEnrollmentAccount.json" + }, + "ExportGetByManagementGroup": { + "$ref": "./examples/ExportGetByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + }, + { + "name": "$expand", + "description": "May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last 10 executions of the export.", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Export" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Exports" + ], + "operationId": "Exports_CreateOrUpdate", + "description": "The operation to create or update a export. Update operation requires latest eTag to be set in the request. 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/costmanagement/" + }, + "x-ms-examples": { + "ExportCreateOrUpdateBySubscription": { + "$ref": "./examples/ExportCreateOrUpdateBySubscription.json" + }, + "ExportCreateOrUpdateByResourceGroup": { + "$ref": "./examples/ExportCreateOrUpdateByResourceGroup.json" + }, + "ExportCreateOrUpdateByBillingAccount": { + "$ref": "./examples/ExportCreateOrUpdateByBillingAccount.json" + }, + "ExportCreateOrUpdateByDepartment": { + "$ref": "./examples/ExportCreateOrUpdateByDepartment.json" + }, + "ExportCreateOrUpdateByEnrollmentAccount": { + "$ref": "./examples/ExportCreateOrUpdateByEnrollmentAccount.json" + }, + "ExportCreateOrUpdateByManagementGroup": { + "$ref": "./examples/ExportCreateOrUpdateByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Export" + }, + "description": "Parameters supplied to the CreateOrUpdate Export operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Export" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/Export" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Exports" + ], + "operationId": "Exports_Delete", + "description": "The operation to delete a export.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportDeleteBySubscription": { + "$ref": "./examples/ExportDeleteBySubscription.json" + }, + "ExportDeleteByResourceGroup": { + "$ref": "./examples/ExportDeleteByResourceGroup.json" + }, + "ExportDeleteByBillingAccount": { + "$ref": "./examples/ExportDeleteByBillingAccount.json" + }, + "ExportDeleteByEnrollmentAccount": { + "$ref": "./examples/ExportDeleteByEnrollmentAccount.json" + }, + "ExportDeleteByDepartment": { + "$ref": "./examples/ExportDeleteByDepartment.json" + }, + "ExportDeleteByManagementGroup": { + "$ref": "./examples/ExportDeleteByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run": { + "post": { + "tags": [ + "Exports" + ], + "operationId": "Exports_Execute", + "description": "The operation to execute an export.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportRunBySubscription": { + "$ref": "./examples/ExportRunBySubscription.json" + }, + "ExportRunByResourceGroup": { + "$ref": "./examples/ExportRunByResourceGroup.json" + }, + "ExportRunByBillingAccount": { + "$ref": "./examples/ExportRunByBillingAccount.json" + }, + "ExportRunByDepartment": { + "$ref": "./examples/ExportRunByDepartment.json" + }, + "ExportRunByEnrollmentAccount": { + "$ref": "./examples/ExportRunByEnrollmentAccount.json" + }, + "ExportRunByManagementGroup": { + "$ref": "./examples/ExportRunByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory": { + "get": { + "tags": [ + "Exports" + ], + "operationId": "Exports_GetExecutionHistory", + "description": "The operation to get the execution history of an export for the defined scope and export name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExportRunHistoryGetBySubscription": { + "$ref": "./examples/ExportRunHistoryGetBySubscription.json" + }, + "ExportRunHistoryGetByResourceGroup": { + "$ref": "./examples/ExportRunHistoryGetByResourceGroup.json" + }, + "ExportRunHistoryGetByBillingAccount": { + "$ref": "./examples/ExportRunHistoryGetByBillingAccount.json" + }, + "ExportRunHistoryGetByDepartment": { + "$ref": "./examples/ExportRunHistoryGetByDepartment.json" + }, + "ExportRunHistoryGetByEnrollmentAccount": { + "$ref": "./examples/ExportRunHistoryGetByEnrollmentAccount.json" + }, + "ExportRunHistoryGetByManagementGroup": { + "$ref": "./examples/ExportRunHistoryGetByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeExportParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ExportExecutionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "ReportConfigDefinition": { + "description": "The definition of a report config.", + "properties": { + "type": { + "description": "The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.", + "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": "ReportTimeframeType", + "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" + ] + }, + "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", + "format": "date-time" + }, + "to": { + "description": "The end date to pull data to.", + "type": "string", + "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", + "enum": [ + "Daily", + "Monthly" + ], + "x-ms-enum": { + "name": "ReportGranularityType", + "modelAsString": 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" + }, + "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 up to 2 aggregation clauses.", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/ReportConfigAggregation" + }, + "maxItems": 2 + }, + "grouping": { + "description": "Array of group by expression to use in the report. Report can have up to 2 group by clauses.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigGrouping" + }, + "maxItems": 2 + }, + "sorting": { + "description": "Array of order by expression to use in the report.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigSorting" + } + }, + "filter": { + "type": "object", + "description": "Has filter expression to use in the report.", + "$ref": "#/definitions/ReportConfigFilter" + } + } + }, + "ReportConfigDatasetConfiguration": { + "description": "The configuration of dataset in the report.", + "properties": { + "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", + "items": { + "type": "string" + } + } + } + }, + "ReportConfigAggregation": { + "description": "The aggregation expression to be used in the report.", + "properties": { + "name": { + "description": "The name of the column to aggregate.", + "type": "string" + }, + "function": { + "description": "The name of the aggregation function to use.", + "type": "string", + "enum": [ + "Sum" + ], + "x-ms-enum": { + "name": "FunctionType", + "modelAsString": true + } + } + }, + "required": [ + "name", + "function" + ] + }, + "ReportConfigSorting": { + "description": "The order by expression to be used in the report.", + "properties": { + "direction": { + "description": "Direction of sort.", + "type": "string", + "enum": [ + "Ascending", + "Descending" + ] + }, + "name": { + "description": "The name of the column to sort.", + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "ReportConfigGrouping": { + "description": "The group by expression to be used in the report.", + "properties": { + "type": { + "description": "Has type of the column to group.", + "$ref": "#/definitions/ReportConfigColumnType" + }, + "name": { + "description": "The name of the column to group. This version supports subscription lowest possible grain.", + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + }, + "ReportConfigFilter": { + "description": "The filter expression to be used in the report.", + "properties": { + "and": { + "description": "The logical \"AND\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 + }, + "or": { + "description": "The logical \"OR\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 + }, + "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 comparison.", + "type": "string" + }, + "operator": { + "description": "The operator to use for comparison.", + "type": "string", + "enum": [ + "In", + "Contains" + ], + "x-ms-enum": { + "name": "OperatorType", + "modelAsString": true + } + }, + "values": { + "description": "Array of values to use for comparison", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, + "ErrorResponse": { + "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "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 + } + } + }, + "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 + }, + "ProxyResource": { + "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." + }, + "eTag": { + "type": "string", + "description": "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not." + } + }, + "x-ms-azure-resource": true + }, + "ExportListResult": { + "description": "Result of listing exports. It contains a list of available exports in the scope provided.", + "type": "object", + "properties": { + "value": { + "description": "The list of exports.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Export" + } + } + } + }, + "Export": { + "description": "An export resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ExportProperties", + "title": "Export properties" + } + } + }, + "ExportProperties": { + "description": "The properties of the export.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CommonExportProperties" + } + ], + "properties": { + "schedule": { + "description": "Has schedule information for the export.", + "$ref": "#/definitions/ExportSchedule" + } + } + }, + "CommonExportProperties": { + "description": "The common properties of the export.", + "type": "object", + "properties": { + "format": { + "description": "The format of the export being delivered. Currently only 'Csv' is supported.", + "type": "string", + "enum": [ + "Csv" + ], + "x-ms-enum": { + "name": "FormatType", + "modelAsString": true + } + }, + "deliveryInfo": { + "description": "Has delivery information for the export.", + "$ref": "#/definitions/ExportDeliveryInfo" + }, + "definition": { + "description": "Has the definition for the export.", + "$ref": "#/definitions/ExportDefinition" + }, + "runHistory": { + "description": "If requested, has the most recent execution history for the export.", + "$ref": "#/definitions/ExportExecutionListResult" + }, + "nextRunTimeEstimate": { + "description": "If the export has an active schedule, provides an estimate of the next execution time.", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "required": [ + "deliveryInfo", + "definition" + ] + }, + "ExportSchedule": { + "description": "The schedule associated with the export.", + "type": "object", + "properties": { + "status": { + "description": "The status of the export's schedule. If 'Inactive', the export's schedule 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/ExportRecurrencePeriod" + } + }, + "required": [ + "recurrence" + ] + }, + "ExportDeliveryInfo": { + "description": "The delivery information associated with a export.", + "type": "object", + "properties": { + "destination": { + "description": "Has destination for the export being delivered.", + "$ref": "#/definitions/ExportDeliveryDestination" + } + }, + "required": [ + "destination" + ] + }, + "ExportRecurrencePeriod": { + "description": "The start and end date for recurrence schedule.", + "type": "object", + "properties": { + "from": { + "description": "The start date of recurrence.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date of recurrence.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from" + ] + }, + "ExportDeliveryDestination": { + "description": "The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services .", + "type": "object", + "properties": { + "resourceId": { + "description": "The resource id of the storage account where exports will be delivered.", + "type": "string" + }, + "container": { + "description": "The name of the container where exports will be uploaded.", + "type": "string" + }, + "rootFolderPath": { + "description": "The name of the directory where exports will be uploaded.", + "type": "string" + } + }, + "required": [ + "resourceId", + "container" + ] + }, + "ExportDefinition": { + "description": "The definition of an export.", + "type": "object", + "properties": { + "type": { + "description": "The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations.", + "type": "string", + "enum": [ + "Usage", + "ActualCost", + "AmortizedCost" + ], + "x-ms-enum": { + "name": "ExportType", + "modelAsString": true + } + }, + "timeframe": { + "description": "The time frame for pulling data for the export. If custom, then a specific time period must be provided.", + "type": "string", + "enum": [ + "MonthToDate", + "BillingMonthToDate", + "TheLastMonth", + "TheLastBillingMonth", + "WeekToDate", + "Custom" + ], + "x-ms-enum": { + "name": "TimeframeType", + "modelAsString": true + } + }, + "timePeriod": { + "description": "Has time period for pulling data for the export.", + "$ref": "#/definitions/ExportTimePeriod" + }, + "dataSet": { + "description": "The definition for data in the export.", + "$ref": "#/definitions/ExportDataset" + } + }, + "required": [ + "type", + "timeframe" + ] + }, + "ExportDataset": { + "description": "The definition for data in the export.", + "type": "object", + "properties": { + "granularity": { + "description": "The granularity of rows in the export. Currently only 'Daily' is supported.", + "type": "string", + "enum": [ + "Daily" + ], + "x-ms-enum": { + "name": "GranularityType", + "modelAsString": true + } + }, + "configuration": { + "description": "The export dataset configuration.", + "$ref": "#/definitions/ExportDatasetConfiguration" + } + } + }, + "ExportDatasetConfiguration": { + "description": "The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns.", + "type": "object", + "properties": { + "columns": { + "description": "Array of column names to be included in the export. If not provided then the export will include all available columns. The available columns can vary by customer channel (see examples).", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ExportTimePeriod": { + "description": "The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months.", + "type": "object", + "properties": { + "from": { + "description": "The start date for export data.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date for export data.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from", + "to" + ] + }, + "ExportExecutionListResult": { + "description": "Result of listing the execution history of an export.", + "type": "object", + "properties": { + "value": { + "description": "A list of export executions.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/ExportExecution" + } + } + } + }, + "ExportExecution": { + "description": "An export execution.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ExportExecutionProperties", + "title": "Export execution properties" + } + } + }, + "ExportExecutionProperties": { + "description": "The properties of the export execution.", + "type": "object", + "properties": { + "executionType": { + "description": "The type of the export execution.", + "type": "string", + "enum": [ + "OnDemand", + "Scheduled" + ], + "x-ms-enum": { + "name": "ExecutionType", + "modelAsString": true + } + }, + "status": { + "description": "The last known status of the export execution.", + "type": "string", + "enum": [ + "Queued", + "InProgress", + "Completed", + "Failed", + "Timeout", + "NewDataNotAvailable", + "DataNotAvailable" + ], + "x-ms-enum": { + "name": "ExecutionStatus", + "modelAsString": true + } + }, + "submittedBy": { + "description": "The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions it is 'System'.", + "type": "string" + }, + "submittedTime": { + "description": "The time when export was queued to be executed.", + "type": "string", + "format": "date-time" + }, + "processingStartTime": { + "description": "The time when export was picked up to be executed.", + "type": "string", + "format": "date-time" + }, + "processingEndTime": { + "description": "The time when the export execution finished.", + "type": "string", + "format": "date-time" + }, + "fileName": { + "description": "The name of the exported file.", + "type": "string" + }, + "runSettings": { + "description": "The export settings that were in effect for this execution.", + "$ref": "#/definitions/CommonExportProperties" + }, + "error": { + "description": "The details of any error.", + "$ref": "#/definitions/ErrorDetails" + } + } + } + }, + "parameters": { + "apiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request. The current version is 2020-06-01." + }, + "scopeExportParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "exportNameParameter": { + "name": "exportName", + "in": "path", + "description": "Export Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } } From e11b9ff5d410be339db602230428d26e83e82fcf Mon Sep 17 00:00:00 2001 From: paornela Date: Thu, 19 Nov 2020 09:12:42 -0800 Subject: [PATCH 8/8] Fix for swagger correctness: eTag property missing and recurrence not required --- .../stable/2020-06-01/costmanagement.exports.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json index 6f5153b995a9..7ebb8bafcf47 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json @@ -853,10 +853,7 @@ "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/ExportRecurrencePeriod" } - }, - "required": [ - "recurrence" - ] + } }, "ExportDeliveryInfo": { "description": "The delivery information associated with a export.", @@ -1032,7 +1029,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "#/definitions/ProxyResource" } ], "properties": {