Skip to content

feat: support for bucket-exposure table-aliases and listing (Analytics Hub) endpoints #777

Description

@vojtechnovotny-heu

What's missing

kbagent has no support for two Storage API endpoints we're using to expose Keboola
buckets to BigQuery Analytics Hub consumers:

  1. POST /v2/storage/branch/{branchId}/buckets/{bucketId}/table-aliases
  2. POST / GET / PATCH /v2/storage/branch/{branchId}/buckets/{bucketId}/listing
    (the exposure listing itself — bigquery.listingResourceName in the GET response
    is what a consumer subscribes to via Analytics Hub, out of scope here)

Right now we build request bodies by hand and hit these with raw curl + a
kbagent token create --bucket-write scoped token, since neither endpoint has a
client/service/command in the CLI (checked client/storage_tables.py — it has
create_bucket, share_bucket/link_bucket, but nothing for aliases or listings).

What we found by observation (not from public docs)

These endpoints don't appear to be documented anywhere we could find — not in
Keboola's public docs, not in this repo, not in kbagent serve's OpenAPI. We
captured the request/response shapes by intercepting window.fetch in the
Keboola UI's own bucket-exposure flow. Two things worth a maintainer's eyes:

  • The PATCH (update) endpoint's description field is named exposureDescription,
    but POST (create) uses listingDescription — same resource, different field
    name depending on verb. We only confirmed this because we saw both in the wire
    capture; happy to share exact request/response bodies if useful.
  • bigquery.listingId appears immutable once created (client-side form
    constraint, not confirmed server-side) — matches ^[a-zA-Z0-9_]+$, ≤63 chars.

Proposed shape (matching existing patterns)

  • client/storage_tables.py: create_table_alias(bucket_id, source_table, name, branch_id=None),
    create_listing(...), get_listing(...) — same prefix/body pattern as create_bucket
  • storage create-table-alias, storage create-listing, storage get-listing commands
  • OPERATION_REGISTRY entries (write category)
  • Given the endpoints are unpublished, we'd love a maintainer confirmation of the
    contract before anyone sinks time into a PR — happy to share our captured
    request/response samples if that helps.

Not requesting: an Analytics Hub subscribe client. That call runs on the
consumer's own GCP side with their own ADC credentials against Google's API, not
Keboola's — outside kbagent's surface regardless of this feature.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions