Skip to main content

pump-gcp-radar

A wrapper around gcp-radar that adds a one-command push of your GCP inventory and billing CSVs to Pump's self-serve onboarding endpoint — no standing cross-account access required.

Everything in gcp-radar (inventory, billing, diagram, run, ...) works unchanged. The only addition is run --upload-token.

Install

pip install pump-gcp-radar

The console script is pump-gcp-radar, so it installs alongside upstream gcp-radar without colliding.

Pump onboarding

In the Pump app, mint an upload token. Pump shows you a ready-to-paste command.

Run it against the GCP project you want to onboard:

pump-gcp-radar run --project my-proj \
  --billing-table my-proj.billing_ds.gcp_billing_export_v1_XXXXXX \
  --upload-token <TOKEN>

This inventories the project read-only (resources and committed use discounts), queries the billing export, writes gcp-radar's combined CSV locally (--output, default inventory.csv), and uploads it to Pump as two files. Pump detects both, runs its analysis, and surfaces the findings in the app. Add --diagram architecture.drawio to also write a diagram locally.

All of run's own options (--project, --billing-table, --billing-days, --billing-account, --output, --diagram, ...) work as in gcp-radar. Without a billing table (--billing-table or $GCP_RADAR_BILLING_TABLE), only the inventory is uploaded. --upload-token is only supported with run, and it isn't listed in --help because gcp-radar owns that parser.

The two uploaded files use gcp-radar's one-shot format (a RecordType column on every row), split from the combined CSV:

  • inventory.csv: Inventory and Commitment (CUD) rows
  • billing.csv: DailyCost, MonthlyCost, SkuCost and Credit rows

The split files are written to a temporary directory and deleted after the upload; your combined --output file is left untouched.

What leaves your machine

Only the two CSVs. The token carries no GCP credentials and no company id — Pump binds the company and derives the S3 key server-side, so a token can only ever write its own upload's prefix. Each file goes to S3 through a short-lived presigned PUT URL that Pump mints on demand.

Pointing at a non-prod backend

The token exchange defaults to https://api.pump.co. Override it for local testing:

pump-gcp-radar run --billing-table ... --upload-token <TOKEN> --api-base http://localhost:8001
# or
PUMP_API_BASE=http://localhost:8001 pump-gcp-radar run --billing-table ... --upload-token <TOKEN>

How the push works

pump_gcp_radar/cli.py strips --upload-token and --api-base from the command line, runs gcp-radar's real main(), and after a successful run splits the CSV. Then pump_gcp_radar/upload.py:

  1. For each role (inventory, billing), POSTs {api_base}/api/v1/estimate/radar/urls with {"token", "role"} and receives a presigned S3 PUT URL.
  2. PUTs the corresponding CSV with Content-Type: text/csv (the presigned URL signs the content-type, so it must match).

Relationship to upstream

This package builds on gcp-radar (MIT). The scanning and billing code is upstream's; the Pump push is this package's addition.

Development

pip install -e ".[dev]"
pytest

Metadata

Release files for pump-gcp-radar 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pump-gcp-radar 0.2.1
File Size Uploaded
pump_gcp_radar-0.2.1.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pump-gcp-radar 0.2.1
File Interpreter ABI Platform
pump_gcp_radar-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / pump_gcp_radar-0.2.1.tar.gz

Download URL pump_gcp_radar-0.2.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6684c201d0d3e3c083943e189c17192e459330a8fa14eb52f003257ce708e2b6
BLAKE2b-256 checksum
How to use checksums
f2d3b58520990732216ffe23cce9b5bbf0ced7bb841469b487fbd22e42e9658b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / pump_gcp_radar-0.2.1-py3-none-any.whl

Download URL pump_gcp_radar-0.2.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a05775b1b38971daaef40313c5510cceb70c156144c5916f738478fe2345254
BLAKE2b-256 checksum
How to use checksums
3d70a3e14bba6f7bc52b023e5b6c0462658cef5fe5fe4e9decb12e605b321f26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page