-
Notifications
You must be signed in to change notification settings - Fork 0
Controlplane Module EN
A generic Dataflow control-plane API: submit a job, request cancellation, read job evidence. All REST calls, all ADC-authenticated, never a gcloud subprocess.
get_authorized_session() — deferred-import ADC (google.auth.default()) + AuthorizedSession. Raises CloudAccessError on failure. Every other module in this package gets its HTTP session from here.
-
submit_job(*, gate_check, submit_fn)— runsgate_check()(raises on failure) thensubmit_fn(); wraps any failure asCloudSubmissionUnavailableso library internals never leak to the caller's API layer. -
generate_job_name(prefix)—<prefix>-<UTC timestamp>-<random hex suffix>, using only Dataflow-legal job-name characters. Optional convenience.
request_job_cancellation(*, project, job_id, region) — PUT to projects.locations.jobs.update with requestedState: JOB_STATE_CANCELLED. Returns the reported state right after the request (typically CANCELLING — cancellation is asynchronous).
Read-only (GET) only — nothing here submits, cancels, drains, or updates a job.
-
get_dataflow_job_summary(...)→DataflowJobSummary(name, short id, region, type, state, timestamps, console URL). -
get_dataflow_job_metrics(...)→ list ofDataflowCounterValuefor each requested counter name; anything not found in the real response isfound=False, never fabricated. -
is_job_running(...)→Trueonly if state isRUNNING. -
extract_user_counter(...)— pulls one named user-namespace counter's scalar out of a raw.../metricsJSON response. -
job_url/console_url— REST/console URL builders.
Pair this with your own BigQuery-backed evidence lookups for a fuller operational picture — this module only knows what the Dataflow REST API itself reports.