Skip to main content

Module cbf

Module cbf 

Source
Expand description

CloudZero Common Bill Format (CBF) serializer + AnyCost Stream uploader.

Spec pinned: CBF as documented at https://docs.cloudzero.com/docs/anycost-common-bill-format-cbf — required columns time/usage_start + cost/cost; savings are emitted as lineitem/type=Discount rows with negative cost (CBF’s documented mechanism, included in CloudZero “Real Cost”).

Idempotency: the Stream API request carries "operation": "replace_drop", which replaces all previously dropped data for the same month — re-running an export overwrites instead of duplicating (CloudZero-side guarantee).

Constants§

HEADER

Functions§

to_csv
CBF CSV (for AnyCost bucket drops or manual import).
to_stream_body
AnyCost Stream request body for one month (YYYY-MM): all rows must belong to that month; replace_drop makes the upload idempotent.
upload
Upload one month to the AnyCost Stream API.