Read a Budget
const url = 'https://example.com/apis/nodus.dev/v1/budgets/example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/apis/nodus.dev/v1/budgets/exampleParameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The object’s name.
Responses
Section titled “ Responses ”OK
Budget is an enforced money limit over the org, a project or a label selector, per UTC calendar month or in total. Every hold and renewal of work in scope must fit a Block Budget: when it is used up, work in scope stops gracefully with Funded=False (BudgetExceeded) and new creates fail with 402 BudgetExceeded. A Notify Budget only sends notices. Matching uses the project and the labels an object had at admission, so relabelling running work cannot escape a Budget, and a Budget created later binds running work from its next renewal.
object
object
object
object
object
object
object
BudgetSpec is the limit, its period and its scope. Period and scope are immutable; the limit, action, thresholds and notify recipients can change.
object
Action is what happens at the limit: Block stops new holds and renewals in scope, Notify only notifies. Defaults to Block.
LimitUSD is the amount the period’s spend plus holds may reach, such as “2000.00”. It must be above 0.
BudgetNotify names extra recipients of a Budget’s notices.
object
Emails receive the threshold and exceeded notices beside the org’s billing recipients, at most 10.
Period is the accounting window: Monthly (the UTC calendar month) or Total (since creation). Defaults to Monthly. Immutable.
BudgetScope narrows a Budget to a project, to objects matching a label selector, or both.
object
Project limits the Budget to one project’s objects and its storage; unset counts every project.
object
object
object
Thresholds are the percentages of the limit at which a notice is sent, at most 5 values in 1-100, once per period each. Defaults to 50, 80 and 100.
BudgetStatus is the current period’s accounting, rendered from the enforcement row whenever the Budget is read.
object
Conditions carry Exceeded (LimitReached) while nothing is left for a new hold.
object
BudgetPeriodWindow is the current accounting window of a Budget.
object
EndTime is when the window ends; unset for Total.
StartTime is when the window started: the UTC month start, or the Budget’s creation for Total.
HeldUSD is what running work in scope holds against the limit.
NotifiedThresholds are the thresholds whose notice was sent this period.
PercentUsed is spent as a whole percentage of the limit.
RemainingUSD is limit minus spent minus held, never below 0.
SpentUSD is what the period’s captures charged.
Example generated
{ "apiVersion": "example", "kind": "example", "metadata": { "annotations": { "additionalProperty": "example" }, "creationTimestamp": "example", "deletionGracePeriodSeconds": 1, "deletionTimestamp": "example", "finalizers": [ "example" ], "generateName": "example", "generation": 1, "labels": { "additionalProperty": "example" }, "managedFields": [ { "apiVersion": "example", "fieldsType": "example", "fieldsV1": { "additionalProperty": "example" }, "manager": "example", "operation": "example", "subresource": "example", "time": "example" } ], "name": "example", "namespace": "example", "ownerReferences": [ { "apiVersion": "example", "blockOwnerDeletion": true, "controller": true, "kind": "example", "name": "example", "uid": "example" } ], "resourceVersion": "example", "selfLink": "example", "uid": "example" }, "spec": { "action": "example", "limitUSD": "example", "notify": { "emails": [ "example" ] }, "period": "example", "scope": { "project": "example", "selector": { "matchExpressions": [ { "key": "example", "operator": "example", "values": [ "example" ] } ], "matchLabels": { "additionalProperty": "example" } } }, "thresholds": [ 1 ] }, "status": { "conditions": [ { "lastTransitionTime": "example", "message": "example", "observedGeneration": 1, "reason": "example", "status": "example", "type": "example" } ], "currentPeriod": { "endTime": "example", "startTime": "example" }, "heldUSD": "example", "notifiedThresholds": [ 1 ], "percentUsed": 1, "remainingUSD": "example", "spentUSD": "example" }}default
Section titled “ default ”An error: a metav1.Status whose reason is a registered code.
Status is the error body of every API response: a Kubernetes metav1.Status (so kubectl and client-go understand it) plus three top-level extensions that those clients ignore (ADR-028).
object
object
object
Docs is the URL of the code’s docs page.
Fix says what to do next, for example a CLI command or the field to change.
object
object
RequestID identifies the request in logs and support tickets.
Example generated
{ "apiVersion": "example", "code": 1, "details": { "causes": [ { "field": "example", "message": "example", "reason": "example" } ], "group": "example", "kind": "example", "name": "example", "retryAfterSeconds": 1, "uid": "example" }, "docs": "example", "fix": "example", "kind": "example", "message": "example", "metadata": { "continue": "example", "remainingItemCount": 1, "resourceVersion": "example", "selfLink": "example", "shardInfo": { "selector": "example" } }, "reason": "example", "requestId": "example", "status": "example"}