Skip to main content

update-report

restish dci update-report id

Updates a report with the specified configuration.

Only specified fields will be updated.

Request

Content-Type: application/json

Example

{
"config": {
"timeRange": {
"amount": 1,
"includeCurrent": false,
"mode": "last",
"unit": "month"
},
"timeInterval": "week"
},
"description": "An update via API",
"name": "A new name"
}

Schema

{
"type": "object",
"properties": {
"config": {
"type": "object",
"properties": {
"metric": {
"description": "The metric to apply.",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"basic",
"custom",
"extended"
]
},
"value": {
"type": "string",
"description": "For basic metrics, the value can be one of: [\"cost\", \"usage\", \"savings\"]\nIf using custom metrics, the value must refer to an existing custom id."
}
},
"example": {
"type": "basic",
"value": "cost"
}
},
"metricFilter": {
"description": "The metric filter to limit the report results by value",
"type": "object",
"properties": {
"metric": {
"description": "The metric to apply.",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"basic",
"custom",
"extended"
]
},
"value": {
"type": "string",
"description": "For basic metrics, the value can be one of: [\"cost\", \"usage\", \"savings\"]\nIf using custom metrics, the value must refer to an existing custom id."
}
},
"example": {
"type": "basic",
"value": "cost"
}
},
"operator": {
"type": "string",
"enum": [
"gt",
"lt",
"lte",
"gte",
"b",
"nb",
"e",
"ne"
]
},
"values": {
"type": "array",
"items": {
"type": "number",
"format": "double"
}
}
},
"example": {
"metric": {
"type": "basic",
"value": "cost"
},
"operator": "gt",
"values": [
50
]
}
},
"aggregation": {
"type": "string",
"enum": [
"total",
"percent_total",
"percent_col",
"percent_row"
]
},
"advancedAnalysis": {
"type": "object",
"properties": {
"forecast": {
"type": "boolean"
},
"notTrending": {
"type": "boolean"
},
"trendingDown": {
"type": "boolean"
},
"trendingUp": {
"type": "boolean"
}
},
"description": "Advanced analysis options. Each of these can be set independently"
},
"timeInterval": {
"type": "string",
"enum": [
"hour",
"day",
"dayCumSum",
"week",
"isoweek",
"month",
"quarter",
"year",
"week_day"
]
},
"dimensions": {
"description": "See [Dimensions](https://help.doit.com/docs/cloud-analytics/reports/editing-your-cloud-report#dimensions).",
"type": "array",
"items": {
"description": "A dimension to apply to the report.",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The field to apply to the dimension."
},
"type": {
"type": "string",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label"
]
}
},
"example": {
"id": "sku_description",
"type": "fixed"
}
}
},
"timeRange": {
"type": "object",
"properties": {
"amount": {
"maximum": 5000,
"minimum": 0,
"type": "integer",
"format": "int64"
},
"includeCurrent": {
"type": "boolean"
},
"mode": {
"type": "string",
"enum": [
"last",
"current",
"custom"
]
},
"unit": {
"type": "string",
"enum": [
"day",
"week",
"month",
"quarter",
"year"
]
}
},
"description": "Specify a predefined or custom time range for the report.\nFor example, to specify a custom time range of \"last 2 days\", set the mode to `last`, the amount to `2`, and the unit to `day`. If `includeCurrent` is `true`, the range will be yesterday and today; otherwise, the range will be yesterday and the day before yesterday.\nIf \"custom\" type is specified, you need to provide a custom time range in the `customTimeRange` field.",
"example": {
"amount": 3,
"includeCurrent": false,
"mode": "last",
"unit": "month"
}
},
"includePromotionalCredits": {
"type": "boolean",
"description": "Whether to include [promotional credits](https://help.doit.com/docs/cloud-analytics/reports/editing-your-cloud-report#promotional-credits).\nIf set to **true**, the report must use time interval `month`, `quarter`, or `year`."
},
"includeSubtotals": {
"type": "boolean",
"description": "Whether to include subgroup totals in the report. This option has no impact when reading a report via API.",
"default": false
},
"filters": {
"type": "array",
"description": "The filters to apply to the report.",
"items": {
"description": "To filter or exclude certain values by type.\nWhen using attributions as a filter, both the type and the ID must be \"attribution\", and the values array contains the attribution IDs.",
"type": "object",
"required": [
"id",
"type",
"mode"
],
"properties": {
"id": {
"type": "string",
"description": "The field to filter on"
},
"type": {
"type": "string",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label"
]
},
"mode": {
"type": "string",
"description": "Filter mode to apply",
"enum": [
"is",
"starts_with",
"ends_with",
"contains",
"regexp"
]
},
"inverse": {
"type": "boolean",
"description": "Set to `true` to exclude the values."
},
"values": {
"type": "array",
"description": "Values to filter on",
"items": {
"type": "string"
}
}
},
"example": {
"id": "cloud_provider",
"type": "fixed",
"inverse": false,
"values": [
"google-cloud"
]
}
}
},
"group": {
"type": "array",
"description": "The rows that appear in the tabular format of the report. See [Group by](https://help.doit.com/docs/cloud-analytics/reports/editing-your-cloud-report#group-by).",
"items": {
"description": "The dimension that defines a row in the report.",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Dimension ID.",
"example": "service_description"
},
"limit": {
"type": "object",
"description": "To limit the number of results based on ranking. See [Limit by top/bottom](https://help.doit.com/docs/cloud-analytics/reports/editing-your-cloud-report#limit-by-topbottom).",
"properties": {
"metric": {
"description": "The metric to apply.",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"basic",
"custom",
"extended"
]
},
"value": {
"type": "string",
"description": "For basic metrics, the value can be one of: [\"cost\", \"usage\", \"savings\"]\nIf using custom metrics, the value must refer to an existing custom id."
}
},
"example": {
"type": "basic",
"value": "cost"
}
},
"sort": {
"type": "string",
"enum": [
"a_to_z",
"asc",
"desc"
]
},
"value": {
"type": "integer",
"description": "The number of items to show",
"format": "int64"
}
},
"example": {
"value": 3,
"sort": "desc",
"metric": {
"type": "basic",
"value": "cost"
}
}
},
"type": {
"type": "string",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label"
]
}
},
"example": {
"id": "service_description",
"type": "fixed",
"limit": {
"value": 3,
"sort": "desc",
"metric": {
"type": "basic",
"value": "cost"
}
}
}
}
},
"layout": {
"type": "string",
"description": "The visualization of the report.",
"enum": [
"column_chart",
"stacked_column_chart",
"bar_chart",
"stacked_bar_chart",
"line_chart",
"spline_chart",
"area_chart",
"area_spline_chart",
"stacked_area_chart",
"treemap_chart",
"table",
"table_heatmap",
"table_row_heatmap",
"table_col_heatmap",
"csv_export",
"sheets_export"
]
},
"displayValues": {
"type": "string",
"description": "See [View data as (Comparative report)](https://help.doit.com/docs/cloud-analytics/reports/editing-your-cloud-report#view-as).",
"enum": [
"actuals_only",
"absolute_change",
"percentage_change",
"absolute_and_percentage"
]
},
"currency": {
"type": "string",
"enum": [
"USD",
"ILS",
"EUR",
"AUD",
"CAD",
"GBP",
"DKK",
"NOK",
"SEK",
"BRL",
"SGD",
"MXN",
"CHF",
"MYR",
"TWD",
"EGP",
"ZAR",
"JPY",
"IDR",
"AED",
"THB",
"COP"
]
},
"sortGroups": {
"type": "string",
"default": "asc",
"enum": [
"asc",
"desc",
"a_to_z"
],
"description": "This option has no impact when reading reports via API."
},
"sortDimensions": {
"type": "string",
"default": "desc",
"enum": [
"asc",
"desc",
"a_to_z"
],
"description": "This option has no impact when reading reports via API."
},
"dataSource": {
"type": "string",
"description": "Data source of the report.",
"enum": [
"billing",
"bqlens",
"billing_datahub",
"kubernetes_utilization"
]
},
"splits": {
"type": "array",
"description": "The splits to use in the report.",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the field to split"
},
"includeOrigin": {
"type": "boolean",
"description": "if set, include the origin"
},
"mode": {
"type": "string",
"enum": [
"even",
"custom",
"proportional"
]
},
"origin": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the origin"
},
"type": {
"type": "string",
"description": "Type of the origin.\nThe only supported values at the moment: \"attribution\", \"unallocated\"",
"example": "attribution",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label",
"unallocated"
]
}
}
},
"targets": {
"type": "array",
"description": "Targets for the split",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the target"
},
"type": {
"type": "string",
"description": "Type of the target.\nThe only supported value at the moment: \"attribution\"",
"example": "attribution",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label"
]
},
"value": {
"type": "number",
"description": "Percent of the target, represented in float format. E.g. 30% is 0.3. Must be set only if Split Mode is custom.",
"format": "double"
}
}
}
},
"type": {
"type": "string",
"description": "Type of the split.\nThe only supported value at the moment: \"attribution_group\"",
"example": "attribution_group",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label"
]
}
},
"description": "A cost split to apply to the report"
}
},
"customTimeRange": {
"description": "Required when the time range is set to \"custom\".",
"type": "object",
"properties": {
"from": {
"type": "string",
"format": "date-time",
"description": "The start timestamp of the time range in RFC3339 format.",
"example": "2024-03-10T23:00:00Z"
},
"to": {
"type": "string",
"format": "date-time",
"description": "The end timestamp of the time range in RFC3339 format.",
"example": "2024-03-12T23:00:00Z"
}
}
}
},
"description": "Report configuration",
"example": {
"metric": {
"type": "basic",
"value": "cost"
},
"metricFilter": {
"metric": {
"type": "basic",
"value": "cost"
},
"operator": "nb",
"values": [
-1,
1
]
},
"aggregation": "total",
"advancedAnalysis": {
"forecast": false,
"notTrending": false,
"trendingDown": false,
"trendingUp": false
},
"timeInterval": "month",
"dimensions": [
{
"id": "year",
"type": "datetime"
},
{
"id": "month",
"type": "datetime"
}
],
"timeRange": {
"amount": 3,
"includeCurrent": false,
"mode": "last",
"unit": "month"
},
"includePromotionalCredits": false,
"includeSubtotals": false,
"filters": [
{
"id": "attribution",
"type": "attribution",
"values": [
"RB8DndcxODriK83IBXXf",
"D7r4znsTj2UC95zGnunW"
],
"inverse": true
},
{
"id": "cloud_provider",
"type": "fixed",
"values": [
"amazon-web-services",
"google-cloud",
"microsoft-azure"
]
}
],
"group": [
{
"id": "service_description",
"limit": {
"metric": {
"type": "basic",
"value": "cost"
},
"sort": "a_to_z",
"value": 0
},
"type": "fixed"
}
],
"layout": "table",
"displayValues": "actuals_only",
"currency": "USD",
"sortGroups": "a_to_z",
"sortDimensions": "a_to_z",
"dataSource": "billing"
}
},
"description": {
"type": "string",
"description": "Report description"
},
"name": {
"type": "string",
"description": "Report name"
}
},
"example": {
"config": {
"timeRange": {
"amount": 1,
"includeCurrent": false,
"mode": "last",
"unit": "month"
},
"timeInterval": "week"
},
"description": "An update via API",
"name": "A new name"
}
}

Responses

200 (application/json)

OK - Report updated.

{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the updated report."
}
}
}

400 (application/json)

Bad Request - The server cannot process the request, often due to a malformed request.

{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}

401 (application/json)

Unauthorized - Invalid API key.

{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}

403 (application/json)

Forbidden - The client is not authorized to perform the request.

{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}

500 (application/json)

Internal Server Error - Something went wrong with the DoiT API server.

{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}

Aliases: update-report, updatereport