create-allocation
restish dci create-allocation
Creates a new allocation.
Request
Content-Type: application/json
Schema
{
"required": [
"name",
"description"
],
"type": "object",
"description": "Request body for creating an allocation.",
"properties": {
"name": {
"type": "string",
"description": "Allocation name."
},
"description": {
"type": "string",
"description": "Allocation description."
},
"rule": {
"required": [
"components",
"formula"
],
"type": "object",
"description": "Single allocation rule.",
"nullable": true,
"properties": {
"components": {
"type": "array",
"description": "List of allocation filter components.",
"items": {
"required": [
"key",
"type",
"values",
"mode"
],
"type": "object",
"description": "A filter component used inside allocation rules.",
"properties": {
"key": {
"type": "string",
"description": "Key of an existing dimension. Examples: \"billing_account_id\", \"country\"."
},
"type": {
"description": "Enumeration of supported dimension/filter types.",
"type": "string",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label"
]
},
"values": {
"type": "array",
"items": {
"type": "string",
"description": "Values to filter on."
}
},
"inverse_selection": {
"type": "boolean",
"description": "If true, all selected values will be excluded.",
"default": false
},
"include_null": {
"type": "boolean",
"description": "Include null values.",
"default": false
},
"mode": {
"type": "string",
"description": "Filter mode to apply.",
"enum": [
"is",
"starts_with",
"ends_with",
"contains",
"regexp"
]
}
}
}
},
"formula": {
"type": "string",
"description": "Formula for combining components (A is the first component, B is the second one, etc.).",
"example": "A AND B"
}
}
},
"rules": {
"type": "array",
"items": {
"required": [
"action"
],
"type": "object",
"nullable": true,
"description": "Allocation rule for a group type allocation.",
"properties": {
"name": {
"type": "string",
"description": "Name of the allocation rule."
},
"description": {
"type": "string",
"description": "Description of the allocation rule."
},
"action": {
"type": "string",
"description": "Action to perform with this rule.",
"enum": [
"create",
"update",
"select"
]
},
"id": {
"type": "string",
"description": "ID of existing allocation (required for 'update' or 'select' action)."
},
"components": {
"type": "array",
"description": "List of allocation filter components (required for 'create' or 'update' action).",
"items": {
"required": [
"key",
"type",
"values",
"mode"
],
"type": "object",
"description": "A filter component used inside allocation rules.",
"properties": {
"key": {
"type": "string",
"description": "Key of an existing dimension. Examples: \"billing_account_id\", \"country\"."
},
"type": {
"description": "Enumeration of supported dimension/filter types.",
"type": "string",
"enum": [
"datetime",
"fixed",
"optional",
"label",
"tag",
"project_label",
"system_label",
"attribution",
"attribution_group",
"gke",
"gke_label"
]
},
"values": {
"type": "array",
"items": {
"type": "string",
"description": "Values to filter on."
}
},
"inverse_selection": {
"type": "boolean",
"description": "If true, all selected values will be excluded.",
"default": false
},
"include_null": {
"type": "boolean",
"description": "Include null values.",
"default": false
},
"mode": {
"type": "string",
"description": "Filter mode to apply.",
"enum": [
"is",
"starts_with",
"ends_with",
"contains",
"regexp"
]
}
}
}
},
"formula": {
"type": "string",
"description": "Formula for combining components (A is the first component, B is the second one, etc.)",
"example": "A AND B"
}
}
}
},
"unallocatedCosts": {
"type": "string",
"description": "Custom label for values that do not fit into allocation (required for group type allocation).",
"nullable": true
}
}
}
Responses
200 (application/json)
OK - The request succeeded.
{
"type": "object",
"description": "Response returned after creating a new allocation.",
"properties": {
"id": {
"type": "string",
"description": "ID of the new allocation."
},
"type": {
"type": "string",
"description": "Type of the new allocation.",
"enum": [
"single",
"group"
]
}
}
}
400 (application/json)
Bad Request - The server cannot process the request, often due to a malformed request.
{
"type": "object",
"description": "Standard error response structure.",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}
401 (application/json)
Unauthorized - Invalid API key.
{
"type": "object",
"description": "Standard error response structure.",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}
403 (application/json)
Forbidden - The client is not authorized to perform the request.
{
"type": "object",
"description": "Standard error response structure.",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}
404 (application/json)
Not Found - The requested resource does not exist.
{
"type": "object",
"description": "Standard error response structure.",
"properties": {
"error": {
"type": "string",
"description": "Detailed error message."
}
}
}
Aliases: create-allocation, createallocation