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.0

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.0
File Size Uploaded
pump_gcp_radar-0.2.0.tar.gz 7.7 kB Details

Built distribution (wheel)

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

Total release size: 15.4 kB

Release files / pump_gcp_radar-0.2.0.tar.gz

Download URL pump_gcp_radar-0.2.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
331cc762318ad2bc75bcbc651e5da1ddb88375dc08ef5bf26040b96cb6e6e919
BLAKE2b-256 checksum
How to use checksums
9c3c9ad7aba363880a9cb102894e6e5831e6ed9efe9d59ec4e101eb760f40f39
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.0-py3-none-any.whl

Download URL pump_gcp_radar-0.2.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0cf22941845d5d6a8f87809a09eb46c20aaaea4af602da4030f4b2d36688cf7
BLAKE2b-256 checksum
How to use checksums
b8b362b60a3819bf7d78b218ac860542373861f79c086464635c85c61756f42f
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

0.2.1

2 release files

This release

0.2.0 This release

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