update-budget
restish dci update-budget id
Updates the specified budget.
Request
Content-Type: application/json
Schema
{
"type": "object",
"properties": {
"alerts": {
"type": "array",
"description": "List of up to three thresholds defined as a percentage of the amount",
"items": {
"type": "object",
"properties": {
"percentage": {
"type": "number",
"format": "double"
}
}
}
},
"amount": {
"type": "number",
"description": "Budget period amount\nrequired: true(if usePrevSpend is false)",
"format": "double"
},
"seasonalAmounts": {
"type": "array",
"description": "List of seasonal amounts for recurring budgets with different amounts per period",
"items": {
"type": "number",
"format": "double"
}
},
"collaborators": {
"type": "array",
"description": "List of permitted users to view/edit the report",
"items": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"role": {
"type": "string",
"enum": [
"owner",
"editor",
"viewer"
]
}
}
}
},
"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"
]
},
"description": {
"type": "string",
"description": "Budget description",
"default": ""
},
"endPeriod": {
"type": "integer",
"description": "Fixed budget end date\nrequired: true(if budget type is fixed)",
"format": "int64"
},
"growthPerPeriod": {
"type": "number",
"description": "Periodical growth percentage in recurring budget",
"format": "double",
"default": 0
},
"metric": {
"type": "string",
"description": "Budget metric - currently fixed to \"cost\"",
"default": "cost"
},
"name": {
"type": "string",
"description": "Budget Name"
},
"public": {
"type": "string",
"enum": [
"owner",
"editor",
"viewer"
]
},
"recipients": {
"type": "array",
"description": "List of emails to notify when reaching alert threshold",
"items": {
"type": "string"
}
},
"recipientsSlackChannels": {
"type": "array",
"description": "List of Slack channels to notify when reaching alert threshold",
"items": {
"type": "object",
"properties": {
"customerId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"shared": {
"type": "boolean"
},
"type": {
"type": "string"
},
"workspace": {
"type": "string"
}
}
}
},
"scope": {
"type": "array",
"description": "List of attributions that define the budget scope.",
"items": {
"type": "string"
},
"deprecated": true
},
"scopes": {
"type": "array",
"description": "The filters selected define the scope of the budget.",
"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"
]
}
}
},
"startPeriod": {
"type": "integer",
"description": "Budget start Date",
"format": "int64"
},
"timeInterval": {
"type": "string",
"description": "Recurring budget interval can be one of: [\"day\", \"week\", \"month\", \"quarter\", \"year\"]"
},
"type": {
"type": "string",
"description": "budget type can be one of: [\"fixed\", \"recurring\"]"
},
"usePrevSpend": {
"type": "boolean",
"description": "Use the last period's spend as the target amount for recurring budgets",
"default": false
}
}
}
Responses
200 (application/json)
OK - Budget updated.
{
"required": [
"currency",
"name",
"scope",
"startPeriod",
"timeInterval",
"type"
],
"type": "object",
"properties": {
"alerts": {
"type": "array",
"description": "List of up to three thresholds defined as a percentage of amount",
"items": {
"type": "object",
"properties": {
"forecastedDate": {
"type": "integer",
"format": "int64"
},
"percentage": {
"type": "number",
"format": "double"
},
"triggered": {
"type": "boolean"
}
}
}
},
"amount": {
"type": "number",
"description": "Budget period amount\nrequired: true(if usePrevSpend is false)",
"format": "double"
},
"collaborators": {
"type": "array",
"description": "List of permitted users to view/edit the report",
"items": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"role": {
"type": "string",
"enum": [
"owner",
"editor",
"viewer"
]
}
}
}
},
"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"
]
},
"description": {
"type": "string",
"description": "Budget description",
"default": "\"\""
},
"endPeriod": {
"type": "integer",
"description": "Fixed budget end date\nrequired: true(if budget type is fixed), in milliseconds since the epoch.",
"format": "int64"
},
"growthPerPeriod": {
"type": "number",
"description": "Periodical growth percentage in recurring budget",
"format": "double",
"default": 0
},
"id": {
"type": "string",
"description": "budget ID, identifying the report\nin:path"
},
"metric": {
"type": "string",
"description": "Budget metric - currently fixed to \"cost\"",
"default": "cost"
},
"name": {
"type": "string",
"description": "Budget Name"
},
"public": {
"type": "string",
"enum": [
"owner",
"editor",
"viewer"
]
},
"recipients": {
"type": "array",
"description": "List of emails to notify when reaching alert threshold",
"items": {
"type": "string"
}
},
"recipientsSlackChannels": {
"type": "array",
"description": "List of slack channels to notify when reaching alert threshold",
"items": {
"type": "object",
"properties": {
"customerId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"shared": {
"type": "boolean"
},
"type": {
"type": "string"
},
"workspace": {
"type": "string"
}
}
}
},
"scope": {
"type": "array",
"description": "List of attributions that defines the budget scope",
"items": {
"type": "string"
}
},
"startPeriod": {
"type": "integer",
"description": "Budget start Date, in milliseconds since the epoch.",
"format": "int64"
},
"timeInterval": {
"type": "string",
"description": "Recurring budget interval can be one of: [\"day\", \"week\", \"month\", \"quarter\", \"year\"]"
},
"type": {
"type": "string",
"description": "budget type can be one of: [\"fixed\", \"recurring\"]"
},
"usePrevSpend": {
"type": "boolean",
"description": "Use the last period's spend as the target amount for recurring budgets",
"default": false
}
}
}
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."
}
}
}
404 (application/json)
Not Found - The requested resource does not exist.
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}
Aliases: update-budget, updatebudget