zuke.tools.gcloud

← Python API reference

@zuke/gcloud 1.4.2: @zuke/gcloud — typed Google Cloud tooling for Zuke builds: the gcloud (Google Cloud SDK) CLI wrapper, plus GCS, Secret Manager and Cloud Monitoring REST task groups that share gcloud-based auth (no Google SDK dependency), and canary support for Cloud Run rollouts gated on Cloud Monitoring.

Symbols

#

CloudMonitoringMetricValueSettings

class
class CloudMonitoringMetricValueSettings(CloudMonitoringTimeSeriesSettings)

Settings for CloudMonitoringTasks.metricValue: a time-series read, and how to turn it into one number. The view is always FULL — the reader needs the points.

  • aggregate(how: Literal['latest', 'sum', 'average', 'maximum', 'minimum']) -> Self

    How to turn the points into one number, across every series the answer holds. "latest" (the default) sums each series' own newest point, so a metric split by a label reads as its total. The others combine every point in the window: a "sum" of per-minute ALIGN_SUM points is the window's total. A DISTRIBUTION point reads as its mean. "average" weights each mean by its sample count; "maximum" and "minimum" are of the means. Means cannot be added, so "sum" refuses distributions, and "latest" refuses more than one distribution series — collapse them with .crossSeriesReducer(...), or align them to a number with ALIGN_PERCENTILE_99, ALIGN_MEAN and the like.

  • missing_data_as(value: float) -> Self

    Return value when there are no points, instead of failing. Cloud Monitoring writes no point for a period with no events, so for a count of errors no data does mean 0; for a latency it usually means the filter is looking in the wrong place.

#

CloudMonitoringTasks

class
class CloudMonitoringTasks

Typed Cloud Monitoring reads.

  • static async time_series_list(ctx: ServiceContext, configure: Callable[[CloudMonitoringTimeSeriesSettings], CloudMonitoringTimeSeriesSettings] | None=None) -> object

    Read the time series the settings describe, every page of them. A series can arrive split across two pages; each part is returned as the API sent it. Fails when the read still has a next page after .maxPages(n) pages, rather than return part of the answer.

  • static async metric_value(ctx: ServiceContext, configure: Callable[[CloudMonitoringMetricValueSettings], CloudMonitoringMetricValueSettings] | None=None) -> object

    One number from the time series the settings describe: the latest value, or an aggregate of every point in the window.

#

CloudMonitoringTimeSeriesSettings

class
class CloudMonitoringTimeSeriesSettings(Settings)

Settings for a Cloud Monitoring time-series read, configured through CloudMonitoringTasks.timeSeriesList((s) => …).

`ts s.project("my-proj") .metricType("run.googleapis.com/request_count") .resourceType("cloud_run_revision") .resourceLabel("service_name", "api") .metricLabel("response_code_class", "5xx") .alignmentPeriod("60s").perSeriesAligner("ALIGN_SUM") .crossSeriesReducer("REDUCE_SUM") .window("15m") `

  • project(id: str) -> Self

    The project to read from; when omitted, GOOGLE_CLOUD_PROJECT (then GCLOUD_PROJECT).

  • metric_type(type_: str) -> Self

    The metric to read: metric.type = "<type>", e.g. "run.googleapis.com/request_count". The API reads exactly one metric type per call.

  • resource_type(type_: str) -> Self

    Only series on this monitored-resource type: resource.type = "<type>".

  • resource_label(key: str, value: str) -> Self

    Only series whose resource label key is value; repeatable.

  • metric_label(key: str, value: str) -> Self

    Only series whose metric label key is value; repeatable.

  • filter(expression: str) -> Self

    Raw text in the Monitoring filter language, joined with the typed parts by AND; repeatable. It is the caller's own text and is not escaped — never build it from an untrusted value. With no metricType, it must name the metric itself.

  • window(duration: str | float) -> Self

    How far back to read ("15m", or ms; default five minutes), ending now — or, with an alignmentPeriod, at the last period boundary, so the period still being written is not read. The window must be at least one period long.

  • interval(start: str, end: str) -> Self

    Read exactly this interval instead of a window ending now.

  • alignment_period(duration: str | float) -> Self

    What each aligned point covers (aggregation.alignmentPeriod) — "60s", "5m", or ms; whole seconds, at least 60, as the API requires.

  • per_series_aligner(aligner: Literal['ALIGN_NONE', 'ALIGN_DELTA', 'ALIGN_RATE', 'ALIGN_INTERPOLATE', 'ALIGN_NEXT_OLDER', 'ALIGN_MIN', 'ALIGN_MAX', 'ALIGN_MEAN', 'ALIGN_COUNT', 'ALIGN_SUM', 'ALIGN_STDDEV', 'ALIGN_COUNT_TRUE', 'ALIGN_COUNT_FALSE', 'ALIGN_FRACTION_TRUE', 'ALIGN_PERCENTILE_99', 'ALIGN_PERCENTILE_95', 'ALIGN_PERCENTILE_50', 'ALIGN_PERCENTILE_05', 'ALIGN_PERCENT_CHANGE']) -> Self

    How each series is aligned (aggregation.perSeriesAligner).

  • cross_series_reducer(reducer: Literal['REDUCE_NONE', 'REDUCE_MEAN', 'REDUCE_MIN', 'REDUCE_MAX', 'REDUCE_SUM', 'REDUCE_STDDEV', 'REDUCE_COUNT', 'REDUCE_COUNT_TRUE', 'REDUCE_COUNT_FALSE', 'REDUCE_FRACTION_TRUE', 'REDUCE_PERCENTILE_99', 'REDUCE_PERCENTILE_95', 'REDUCE_PERCENTILE_50', 'REDUCE_PERCENTILE_05']) -> Self

    How aligned series are combined (aggregation.crossSeriesReducer).

  • group_by_fields(*fields: str) -> Self

    The labels the reducer keeps series apart by (aggregation.groupByFields), e.g. "resource.labels.revision_name".

  • view(view: Literal['FULL', 'HEADERS']) -> Self

    FULL (the default) returns points; HEADERS only each series' labels.

  • page_size(count: float) -> Self

    The most results per page (pageSize; the API's default is 100,000).

  • max_pages(count: float) -> Self

    The most pages to read (default 100). A read that still has a next page after that many fails — a partial answer is never returned as a whole.

  • delay(duration: str | float) -> Self

    End the window this long before now ("2m", or ms) — for the time a metric takes to become readable. Google's metrics list gives it per metric: Cloud Run's request_count and request_latencies are "not visible for up to 120 seconds" after sampling. Without it the newest points may not exist yet, or hold only part of their period. Default 0 for a read; the cloudMonitoring(...) analysis defaults to two minutes.

  • token(value: str) -> Self

    A pre-resolved OAuth access token.

  • gcloud(configure: Callable[[GcloudSettings], GcloudSettings]) -> Self

    Global gcloud flags for the default token read, gcloud auth print-access-token — (g) => g.account("ci@p.iam…"), or a .runner(...), the seam a test answers through. Unused when a token or tokenProvider is set.

#

GcloudArtifactsImagesDeleteSettings

class
class GcloudArtifactsImagesDeleteSettings(GcloudSettings)

Settings for gcloud artifacts docker images delete.

  • image(reference: str) -> Self

    The image or version to delete (positional).

  • delete_tags() -> Self

    Delete the version even though tags point at it (--delete-tags), which gcloud otherwise refuses.

#

GcloudArtifactsImagesListSettings

class
class GcloudArtifactsImagesListSettings(GcloudSettings)

Settings for gcloud artifacts docker images list.

  • repository(path: str) -> Self

    The repository or image to list (positional).

  • include_tags() -> Self

    Include each version's tags (--include-tags).

  • limit(value: float) -> Self

    Return at most this many images (--limit).

  • filter(expression: str) -> Self

    Restrict the listing (--filter).

#

GcloudArtifactsRepositoriesDescribeSettings

class
class GcloudArtifactsRepositoriesDescribeSettings(GcloudSettings)

Settings for gcloud artifacts repositories describe.

  • repository(name: str) -> Self

    The repository to describe (positional).

  • location(value: str) -> Self

    The location it lives in (--location).

#

GcloudArtifactsRepositoriesListSettings

class
class GcloudArtifactsRepositoriesListSettings(GcloudSettings)

Settings for gcloud artifacts repositories list.

  • location(value: str) -> Self

    The location to list from (--location).

  • limit(value: float) -> Self

    Return at most this many repositories (--limit).

#

GcloudAuthActivateServiceAccountSettings

class
class GcloudAuthActivateServiceAccountSettings(GcloudSettings)

Settings for gcloud auth activate-service-account.

  • service_account(email: str) -> Self

    The service account to activate (positional); optional beside a key file.

  • key_file(path: str) -> Self

    The JSON key to activate it from (--key-file).

#

GcloudAuthConfigureDockerSettings

class
class GcloudAuthConfigureDockerSettings(GcloudSettings)

Settings for gcloud auth configure-docker.

  • registries(*values: str) -> Self

    The registries to add a credential helper for (positional, comma separated), e.g. "us-central1-docker.pkg.dev"; repeatable.

#

GcloudAuthListSettings

class
class GcloudAuthListSettings(GcloudSettings)

Settings for gcloud auth list.

  • filter_account(email: str) -> Self

    Only the named account (--filter-account).

#

GcloudAuthPrintAccessTokenSettings

class
class GcloudAuthPrintAccessTokenSettings(GcloudSettings)

Settings for gcloud auth print-access-token.

  • for_account(email: str) -> Self

    Print the token for this account rather than the active one (positional).

#

GcloudAuthPrintIdentityTokenSettings

class
class GcloudAuthPrintIdentityTokenSettings(GcloudSettings)

Settings for gcloud auth print-identity-token.

  • for_account(email: str) -> Self

    Print the token for this account rather than the active one (positional).

  • audiences(*values: str) -> Self

    The audiences the token is minted for (--audiences); repeatable. A Cloud Run service invoked service-to-service is the usual reason: the receiving service's URL is the audience, and a token minted without one is rejected there.

  • include_email() -> Self

    Include the service account email in the token (--include-email).

#

GcloudAuthRevokeSettings

class
class GcloudAuthRevokeSettings(GcloudSettings)

Settings for gcloud auth revoke.

  • accounts(*values: str) -> Self

    The accounts to revoke (positional); repeatable.

  • all() -> Self

    Revoke every credentialed account (--all).

#

GcloudBuildsDescribeSettings

class
class GcloudBuildsDescribeSettings(GcloudSettings)

Settings for gcloud builds describe.

  • build(id: str) -> Self

    The build to describe (positional).

  • region(value: str) -> Self

    The region it ran in (--region).

#

GcloudBuildsListSettings

class
class GcloudBuildsListSettings(GcloudSettings)

Settings for gcloud builds list.

  • limit(value: float) -> Self

    Return at most this many builds (--limit).

  • filter(expression: str) -> Self

    Restrict the listing (--filter), e.g. "status=SUCCESS".

  • region(value: str) -> Self

    The region to list from (--region).

  • ongoing() -> Self

    Only builds that have not finished (--ongoing).

#

GcloudBuildsLogSettings

class
class GcloudBuildsLogSettings(GcloudSettings)

Settings for gcloud builds log.

  • build(id: str) -> Self

    The build whose log to read (positional).

  • stream() -> Self

    Follow the log until the build finishes (--stream), which makes the task block for the build's duration rather than returning what exists now.

  • region(value: str) -> Self

    The region it ran in (--region).

#

GcloudBuildsSubmitSettings

class
class GcloudBuildsSubmitSettings(GcloudSettings)

Settings for gcloud builds submit.

  • source(path: str) -> Self

    The source to build (positional), e.g. "." or a gs:// archive.

  • tag(image: str) -> Self

    Build a container and push it to this tag (--tag).

  • config(path: str) -> Self

    Build from a config file (--config), e.g. cloudbuild.yaml.

  • pack(spec: str) -> Self

    Build with buildpacks (--pack), e.g. "image=gcr.io/p/i".

  • timeout(value: str) -> Self

    Fail the build after this long (--timeout), e.g. "600s".

  • machine_type(value: str) -> Self

    The machine type to build on (--machine-type).

  • substitutions(*pairs: str) -> Self

    Substitution values for the config (--substitutions); repeatable.

  • async_() -> Self

    Return as soon as the build is queued (--async).

  • gcs_source_staging_dir(uri: str) -> Self

    Stage the source under this bucket path (--gcs-source-staging-dir).

  • ignore_file(path: str) -> Self

    Exclude files matching this ignore file (--ignore-file).

  • region(value: str) -> Self

    The region to build in (--region).

#

GcloudClustersDescribeSettings

class
class GcloudClustersDescribeSettings(GcloudSettings)

Settings for gcloud container clusters describe.

  • cluster(name: str) -> Self

    The cluster to describe (positional).

  • location(value: str) -> Self

    The cluster's location (--location).

  • region(value: str) -> Self

    The cluster's region (--region).

  • zone(value: str) -> Self

    The cluster's zone (--zone).

#

GcloudClustersGetCredentialsSettings

class
class GcloudClustersGetCredentialsSettings(GcloudSettings)

Settings for gcloud container clusters get-credentials.

  • cluster(name: str) -> Self

    The cluster to fetch credentials for (positional).

  • location(value: str) -> Self

    The cluster's location (--location).

  • region(value: str) -> Self

    The cluster's region (--region).

  • zone(value: str) -> Self

    The cluster's zone (--zone).

  • internal_ip() -> Self

    Use the internal endpoint (--internal-ip), for a private cluster.

  • dns_endpoint() -> Self

    Use the DNS endpoint (--dns-endpoint).

#

GcloudClustersListSettings

class
class GcloudClustersListSettings(GcloudSettings)

Settings for gcloud container clusters list.

  • location(value: str) -> Self

    Restrict to a location (--location).

  • region(value: str) -> Self

    Restrict to a region (--region).

  • zone(value: str) -> Self

    Restrict to a zone (--zone).

  • filter(expression: str) -> Self

    Restrict the listing (--filter).

#

GcloudConfigGetValueSettings

class
class GcloudConfigGetValueSettings(GcloudSettings)

Settings for gcloud config get-value.

  • property(name: str) -> Self

    The property to read (positional).

#

GcloudConfigListSettings

class
class GcloudConfigListSettings(GcloudSettings)

Settings for gcloud config list.

  • all() -> Self

    Include properties left at their defaults (--all).

#

GcloudConfigSetSettings

class
class GcloudConfigSetSettings(GcloudSettings)

Settings for gcloud config set.

  • property(name: str) -> Self

    The property to set (positional), e.g. "project" or "run/region".

  • value(text: str) -> Self

    The value to set it to (positional).

#

GcloudConfigUnsetSettings

class
class GcloudConfigUnsetSettings(GcloudSettings)

Settings for gcloud config unset.

  • property(name: str) -> Self

    The property to clear (positional).

#

GcloudFunctionsDeploySettings

class
class GcloudFunctionsDeploySettings(GcloudSettings)

Settings for gcloud functions deploy.

  • function(name: str) -> Self

    The function to deploy (positional).

  • runtime(value: str) -> Self

    The language runtime (--runtime), e.g. "nodejs20".

  • region(value: str) -> Self

    The region to deploy into (--region).

  • entry_point(value: str) -> Self

    The exported symbol to invoke (--entry-point).

  • source(path: str) -> Self

    Where the source lives (--source).

  • trigger_http() -> Self

    Trigger on HTTP requests (--trigger-http).

  • trigger_topic(name: str) -> Self

    Trigger on a Pub/Sub topic (--trigger-topic).

  • trigger_bucket(name: str) -> Self

    Trigger on a Cloud Storage bucket (--trigger-bucket).

  • trigger_event_filters(*filters: str) -> Self

    Trigger on matching Eventarc events (--trigger-event-filters).

  • service_account(email: str) -> Self

    The identity the function runs as (--service-account).

  • set_env_vars(*pairs: str) -> Self

    Environment variables (--set-env-vars), as KEY=value; repeatable.

  • memory(value: str) -> Self

    Memory per instance (--memory).

  • timeout(value: str) -> Self

    Execution timeout (--timeout).

  • gen2() -> Self

    Deploy as a 2nd-generation function (--gen2).

#

GcloudFunctionsDescribeSettings

class
class GcloudFunctionsDescribeSettings(GcloudSettings)

Settings for gcloud functions describe.

  • function(name: str) -> Self

    The function to describe (positional).

  • region(value: str) -> Self

    The region it runs in (--region).

  • gen2() -> Self

    Look it up as a 2nd-generation function (--gen2).

#

GcloudLoggingEntryCountSettings

class
class GcloudLoggingEntryCountSettings(GcloudLoggingReadSettings)

Settings for GcloudTasks.logEntryCount: a gcloud logging read whose matches are counted. .limit(n) is the most entries counted; a count above it fails as "more than n".

#

GcloudLoggingLogsListSettings

class
class GcloudLoggingLogsListSettings(GcloudSettings)

Settings for gcloud logging logs list: the logs that hold entries.

  • log_view(bucket: str, location: str, view: str) -> Self

    List the logs of a log view (--bucket, --location, --view).

  • filter(expression: str) -> Self

    Keep only matching logs (--filter), gcloud's own list filter.

  • limit(count: float) -> Self

    List at most this many logs (--limit).

  • sort_by(*fields: str) -> Self

    Sort by these fields (--sort-by); prefix one with ~ to descend.

#

GcloudLoggingReadSettings

class
class GcloudLoggingReadSettings(GcloudSettings)

Settings for gcloud logging read: which entries (the filter), from where (project, folder, organization, billing account, or a log view), and how many.

  • filter(expression: str) -> Self

    Raw filter text in the Logging query language, joined with every other part by AND; repeatable. It is the caller's own text and is not escaped — never build it from an untrusted value; use the typed setters for those.

  • resource_type(type_: str) -> Self

    Only entries from this monitored-resource type: resource.type="…".

  • resource_label(key: str, value: str) -> Self

    Only entries whose resource label key is value; repeatable.

  • label(key: str, value: str) -> Self

    Only entries whose own label key is value; repeatable.

  • min_severity(severity: Literal['DEFAULT', 'DEBUG', 'INFO', 'NOTICE', 'WARNING', 'ERROR', 'CRITICAL', 'ALERT', 'EMERGENCY']) -> Self

    Only entries at severity or above: severity>=ERROR.

  • since(time: str) -> Self

    Only entries at or after time: timestamp>="…".

  • until(time: str) -> Self

    Only entries before time: timestamp<"…".

  • freshness(duration: str | float) -> Self

    Only entries newer than this — "1h", "90s", or ms — sent as an explicit timestamp>="<now − duration>" in the filter, measured from now. gcloud's own --freshness is not used: gcloud silently drops it whenever the filter's text contains the word timestamp anywhere, or the order is asc, and the read then spans the whole retention period.

  • order(order: Literal['asc', 'desc']) -> Self

    Newest first (desc, gcloud's default) or oldest first (--order).

  • limit(count: float) -> Self

    Read at most this many entries (--limit; gcloud's default is unlimited).

  • organization(id: str) -> Self

    Read from an organization's logs (--organization). gcloud takes one of --organization, --folder, --billing-account and --project.

  • folder(id: str) -> Self

    Read from a folder's logs (--folder).

  • billing_account(id: str) -> Self

    Read from a billing account's logs (--billing-account).

  • log_view(bucket: str, location: str, view: str) -> Self

    Read through a log view (--bucket, --location, --view).

  • resource_names(*names: str) -> Self

    Read from these resources instead (--resource-names): a project, folder or organization name, or a full log-view path. gcloud takes these or a log view, not both.

#

GcloudMonitoringDashboardsListSettings

class
class GcloudMonitoringDashboardsListSettings(GcloudMonitoringListSettings)

Settings for gcloud monitoring dashboards list.

#

GcloudMonitoringListSettings

class
class GcloudMonitoringListSettings(GcloudSettings)

The list flags every gcloud monitoring … list command takes: --filter, --limit, --page-size, --sort-by and --uri. Each listing extends it and names its own command path.

  • filter(expression: str) -> Self

    Keep only matching items (--filter), gcloud's own list filter.

  • limit(count: float) -> Self

    List at most this many items (--limit).

  • page_size(count: float) -> Self

    How many items to request per page (--page-size).

  • sort_by(*fields: str) -> Self

    Sort by these fields (--sort-by); prefix one with ~ to descend.

  • uri() -> Self

    Print each item's resource URI instead (--uri).

#

GcloudMonitoringPoliciesDescribeSettings

class
class GcloudMonitoringPoliciesDescribeSettings(GcloudSettings)

Settings for gcloud monitoring policies describe.

  • policy(id_or_name: str) -> Self

    The policy to describe (positional): its id, or its full name projects/<project>/alertPolicies/<id>.

#

GcloudMonitoringPoliciesListSettings

class
class GcloudMonitoringPoliciesListSettings(GcloudMonitoringListSettings)

Settings for gcloud monitoring policies list: the alerting policies.

#

GcloudMonitoringUptimeListConfigsSettings

class
class GcloudMonitoringUptimeListConfigsSettings(GcloudMonitoringListSettings)

Settings for gcloud monitoring uptime list-configs: the uptime checks and synthetic monitors.

#

GcloudRunDeploySettings

class
class GcloudRunDeploySettings(GcloudSettings)

Settings for gcloud run deploy.

  • service(name: str) -> Self

    The service to deploy (positional).

  • image(reference: str) -> Self

    The container image to deploy (--image).

  • source(path: str) -> Self

    Build and deploy from source instead of an image (--source).

  • region(value: str) -> Self

    The region to deploy into (--region).

  • platform(value: str) -> Self

    The platform to target (--platform), e.g. "managed".

  • allow_unauthenticated() -> Self

    Let unauthenticated callers invoke the service (--allow-unauthenticated).

  • no_allow_unauthenticated() -> Self

    Require authentication to invoke it (--no-allow-unauthenticated).

  • service_account(email: str) -> Self

    The identity the service runs as (--service-account).

  • set_env_vars(*pairs: str) -> Self

    Environment variables (--set-env-vars), as KEY=value; repeatable.

  • set_secrets(*pairs: str) -> Self

    Secret Manager mounts (--set-secrets); repeatable.

  • memory(value: str) -> Self

    Memory per instance (--memory), e.g. "512Mi".

  • cpu(value: str) -> Self

    CPU per instance (--cpu).

  • concurrency(value: float) -> Self

    Requests served concurrently per instance (--concurrency).

  • max_instances(value: float) -> Self

    Upper bound on instances (--max-instances).

  • min_instances(value: float) -> Self

    Lower bound on instances (--min-instances).

  • port(value: float) -> Self

    The port the container listens on (--port).

  • timeout(value: str) -> Self

    Request timeout (--timeout).

  • tag(value: str) -> Self

    Tag this revision (--tag), so it is addressable without traffic.

  • no_traffic() -> Self

    Deploy without moving traffic to the new revision (--no-traffic).

#

GcloudRunServicesDescribeSettings

class
class GcloudRunServicesDescribeSettings(GcloudSettings)

Settings for gcloud run services describe.

  • service(name: str) -> Self

    The service to describe (positional).

  • region(value: str) -> Self

    The region it runs in (--region).

  • platform(value: str) -> Self

    The platform it runs on (--platform).

#

GcloudRunServicesListSettings

class
class GcloudRunServicesListSettings(GcloudSettings)

Settings for gcloud run services list.

  • region(value: str) -> Self

    The region to list from (--region).

  • platform(value: str) -> Self

    The platform to list from (--platform).

  • filter(expression: str) -> Self

    Restrict the listing (--filter).

#

GcloudRunServicesUpdateSettings

class
class GcloudRunServicesUpdateSettings(GcloudSettings)

Settings for gcloud run services update — amending a service that already exists.

Distinct from GcloudRunDeploySettings on purpose. run deploy creates the service when it is absent and resets settings the invocation does not name; run services update only ever amends an existing one. A deploy that points a live service at a freshly built image wants the second guarantee, and getting the first by accident — a service quietly created, or scaling config quietly dropped — is a worse failure than an error.

  • service(name: str) -> Self

    The service to update (positional).

  • region(value: str) -> Self

    The region it runs in (--region).

  • platform(value: str) -> Self

    The platform it runs on (--platform).

  • image(reference: str) -> Self

    The container image to point the service at (--image).

  • update_env_vars(*pairs: str) -> Self

    Set or overwrite environment variables (--update-env-vars), as KEY=value; repeatable. Variables the call does not name are left alone — which is the difference from run deploy's --set-env-vars.

  • remove_env_vars(*names: str) -> Self

    Remove environment variables by name (--remove-env-vars); repeatable.

  • clear_env_vars() -> Self

    Remove every environment variable the service has (--clear-env-vars).

  • update_secrets(*pairs: str) -> Self

    Set or overwrite Secret Manager mounts (--update-secrets), as KEY=secret:version; repeatable.

  • memory(value: str) -> Self

    Memory per instance (--memory), e.g. "512Mi".

  • cpu(value: str) -> Self

    CPU per instance (--cpu).

  • concurrency(value: float) -> Self

    Requests served concurrently per instance (--concurrency).

  • max_instances(value: float) -> Self

    Upper bound on instances (--max-instances).

  • min_instances(value: float) -> Self

    Lower bound on instances (--min-instances).

  • tag(value: str) -> Self

    Tag the revision this update creates (--tag).

  • no_traffic() -> Self

    Create the revision without moving traffic to it (--no-traffic).

#

GcloudRunUpdateTrafficSettings

class
class GcloudRunUpdateTrafficSettings(GcloudSettings)

Settings for gcloud run services update-traffic.

  • service(name: str) -> Self

    The service whose traffic to move (positional).

  • region(value: str) -> Self

    The region it runs in (--region).

  • to_latest() -> Self

    Send all traffic to the newest revision (--to-latest).

  • to_revisions(*splits: str) -> Self

    Split traffic across revisions (--to-revisions), as rev=percent.

  • to_tags(*splits: str) -> Self

    Split traffic across tags (--to-tags), as tag=percent.

#

GcloudSecretsVersionsAccessSettings

class
class GcloudSecretsVersionsAccessSettings(GcloudSettings)

Settings for gcloud secrets versions access.

  • version(value: str) -> Self

    The version to read (positional); defaults to latest.

  • secret(name: str) -> Self

    The secret to read it from (--secret).

#

GcloudSettings

class
class GcloudSettings(SubcommandSettings)

Settings for a gcloud invocation.

  • container_images_add_tag(source: str, *destinations: str) -> Self

    Add tags to a container image across registries: gcloud container images add-tag <source> <destination…>. Each argument is a discrete argv token, so an image reference can't inject flags. Runs with --quiet (the re-tag is non-interactive automation; add-tag otherwise prompts for confirmation).

  • sql_instances_describe(instance: str) -> Self

    Describe a Cloud SQL instance: gcloud sql instances describe <instance>. Add .format("json") to get a machine-readable body to parse from the command's stdout.

  • sql_operations_wait(operation: str) -> Self

    Block until a Cloud SQL operation completes: gcloud sql operations wait <operation> — the typed form of the poll-an-operation shell loop.

  • project(id: str) -> Self

    Target Google Cloud project (--project).

  • account(email: str) -> Self

    Account to run as (--account).

  • configuration(name: str) -> Self

    Named gcloud configuration to use (--configuration).

  • format(value: str) -> Self

    Output format, e.g. json, yaml, value(name) (--format).

  • verbosity(level: str) -> Self

    Logging verbosity: debug, info, warning, error, … (--verbosity).

  • no_prompt() -> Self

    Disable interactive prompts, accepting defaults (gcloud's --quiet). Named noPrompt to avoid clashing with the base .quiet(), which suppresses Zuke's own output streaming.

#

GcloudStorageCpSettings

class
class GcloudStorageCpSettings(GcloudSettings)

Settings for gcloud storage cp.

  • sources(*paths: str) -> Self

    The sources to copy (positional); repeatable.

  • destination(path: str) -> Self

    Where to copy them (positional).

  • recursive() -> Self

    Copy directories and their contents (--recursive).

  • no_clobber() -> Self

    Skip objects that already exist (--no-clobber).

  • content_type(value: str) -> Self

    Set the uploaded objects' content type (--content-type).

  • cache_control(value: str) -> Self

    Set the uploaded objects' cache control (--cache-control).

#

GcloudStorageLsSettings

class
class GcloudStorageLsSettings(GcloudSettings)

Settings for gcloud storage ls.

  • paths(*values: str) -> Self

    The paths to list (positional); repeatable.

  • recursive() -> Self

    Recurse into prefixes (--recursive).

  • long() -> Self

    Include size and creation time (--long).

#

GcloudStorageRmSettings

class
class GcloudStorageRmSettings(GcloudSettings)

Settings for gcloud storage rm.

  • paths(*values: str) -> Self

    The objects or prefixes to remove (positional); repeatable.

  • recursive() -> Self

    Remove prefixes and everything under them (--recursive).

#

GcloudStorageRsyncSettings

class
class GcloudStorageRsyncSettings(GcloudSettings)

Settings for gcloud storage rsync.

  • source(path: str) -> Self

    The source tree (positional).

  • destination(path: str) -> Self

    The destination tree (positional).

  • recursive() -> Self

    Recurse into directories (--recursive).

  • delete_unmatched_destination_objects() -> Self

    Delete objects at the destination that the source does not have (--delete-unmatched-destination-objects), which makes the destination a mirror rather than a superset.

  • exclude(pattern: str) -> Self

    Skip paths matching this pattern (--exclude).

#

GcloudTasks

class
class GcloudTasks

Typed task functions for the gcloud CLI.

  • static async run(ctx: ServiceContext, configure: Callable[[GcloudSettings], GcloudSettings] | None=None) -> ExecResult

    Run a gcloud command.

  • static async auth_activate_service_account(ctx: ServiceContext, configure: Callable[[GcloudAuthActivateServiceAccountSettings], GcloudAuthActivateServiceAccountSettings] | None=None) -> ExecResult

    Activate a service account: gcloud auth activate-service-account.

  • static async auth_print_access_token(ctx: ServiceContext, configure: Callable[[GcloudAuthPrintAccessTokenSettings], GcloudAuthPrintAccessTokenSettings] | None=None) -> ExecResult

    Print an OAuth access token: gcloud auth print-access-token.

  • static async access_token(ctx: ServiceContext, configure: Callable[[GcloudAuthPrintAccessTokenSettings], GcloudAuthPrintAccessTokenSettings] | None=None) -> object

    The OAuth access token itself, read back as a string.

  • static async auth_print_identity_token(ctx: ServiceContext, configure: Callable[[GcloudAuthPrintIdentityTokenSettings], GcloudAuthPrintIdentityTokenSettings] | None=None) -> ExecResult

    Print an identity token: gcloud auth print-identity-token.

  • static async identity_token(ctx: ServiceContext, configure: Callable[[GcloudAuthPrintIdentityTokenSettings], GcloudAuthPrintIdentityTokenSettings] | None=None) -> object

    The identity token itself, read back as a string.

  • static async auth_configure_docker(ctx: ServiceContext, configure: Callable[[GcloudAuthConfigureDockerSettings], GcloudAuthConfigureDockerSettings] | None=None) -> ExecResult

    Register gcloud as a Docker credential helper: gcloud auth configure-docker.

  • static async auth_list(ctx: ServiceContext, configure: Callable[[GcloudAuthListSettings], GcloudAuthListSettings] | None=None) -> ExecResult

    List credentialed accounts: gcloud auth list.

  • static async auth_revoke(ctx: ServiceContext, configure: Callable[[GcloudAuthRevokeSettings], GcloudAuthRevokeSettings] | None=None) -> ExecResult

    Revoke credentials: gcloud auth revoke.

  • static async config_set(ctx: ServiceContext, configure: Callable[[GcloudConfigSetSettings], GcloudConfigSetSettings] | None=None) -> ExecResult

    Set a property: gcloud config set.

  • static async config_unset(ctx: ServiceContext, configure: Callable[[GcloudConfigUnsetSettings], GcloudConfigUnsetSettings] | None=None) -> ExecResult

    Clear a property: gcloud config unset.

  • static async config_get_value(ctx: ServiceContext, configure: Callable[[GcloudConfigGetValueSettings], GcloudConfigGetValueSettings] | None=None) -> ExecResult

    Read a property: gcloud config get-value.

  • static async config_value(ctx: ServiceContext, configure: Callable[[GcloudConfigGetValueSettings], GcloudConfigGetValueSettings] | None=None) -> object

    A configured property's value, read back as a string.

  • static async config_list(ctx: ServiceContext, configure: Callable[[GcloudConfigListSettings], GcloudConfigListSettings] | None=None) -> ExecResult

    List the active configuration: gcloud config list.

  • static async builds_submit(ctx: ServiceContext, configure: Callable[[GcloudBuildsSubmitSettings], GcloudBuildsSubmitSettings] | None=None) -> ExecResult

    Submit a Cloud Build: gcloud builds submit.

  • static async builds_list(ctx: ServiceContext, configure: Callable[[GcloudBuildsListSettings], GcloudBuildsListSettings] | None=None) -> ExecResult

    List builds: gcloud builds list.

  • static async builds_describe(ctx: ServiceContext, configure: Callable[[GcloudBuildsDescribeSettings], GcloudBuildsDescribeSettings] | None=None) -> ExecResult

    Describe a build: gcloud builds describe.

  • static async builds_log(ctx: ServiceContext, configure: Callable[[GcloudBuildsLogSettings], GcloudBuildsLogSettings] | None=None) -> ExecResult

    Read a build's log: gcloud builds log.

  • static async run_deploy(ctx: ServiceContext, configure: Callable[[GcloudRunDeploySettings], GcloudRunDeploySettings] | None=None) -> ExecResult

    Deploy to Cloud Run: gcloud run deploy.

  • static async run_services_describe(ctx: ServiceContext, configure: Callable[[GcloudRunServicesDescribeSettings], GcloudRunServicesDescribeSettings] | None=None) -> ExecResult

    Describe a Cloud Run service: gcloud run services describe.

  • static async run_service_url(ctx: ServiceContext, configure: Callable[[GcloudRunServicesDescribeSettings], GcloudRunServicesDescribeSettings] | None=None) -> object

    The URL Cloud Run assigned a service, read back as a string. Pins --format to gcloud's own value projection, so gcloud extracts the field.

  • static async run_services_list(ctx: ServiceContext, configure: Callable[[GcloudRunServicesListSettings], GcloudRunServicesListSettings] | None=None) -> ExecResult

    List Cloud Run services: gcloud run services list.

  • static async run_services_update(ctx: ServiceContext, configure: Callable[[GcloudRunServicesUpdateSettings], GcloudRunServicesUpdateSettings] | None=None) -> ExecResult

    Amend an existing Cloud Run service: gcloud run services update. Unlike runDeploy, it never creates the service and never resets settings the call does not name.

  • static async run_update_traffic(ctx: ServiceContext, configure: Callable[[GcloudRunUpdateTrafficSettings], GcloudRunUpdateTrafficSettings] | None=None) -> ExecResult

    Move traffic between revisions: gcloud run services update-traffic.

  • static async artifacts_images_list(ctx: ServiceContext, configure: Callable[[GcloudArtifactsImagesListSettings], GcloudArtifactsImagesListSettings] | None=None) -> ExecResult

    List images in Artifact Registry: gcloud artifacts docker images list.

  • static async artifacts_images_delete(ctx: ServiceContext, configure: Callable[[GcloudArtifactsImagesDeleteSettings], GcloudArtifactsImagesDeleteSettings] | None=None) -> ExecResult

    Delete an image: gcloud artifacts docker images delete.

  • static async artifacts_repositories_list(ctx: ServiceContext, configure: Callable[[GcloudArtifactsRepositoriesListSettings], GcloudArtifactsRepositoriesListSettings] | None=None) -> ExecResult

    List repositories: gcloud artifacts repositories list.

  • static async artifacts_repositories_describe(ctx: ServiceContext, configure: Callable[[GcloudArtifactsRepositoriesDescribeSettings], GcloudArtifactsRepositoriesDescribeSettings] | None=None) -> ExecResult

    Describe a repository: gcloud artifacts repositories describe.

  • static async storage_cp(ctx: ServiceContext, configure: Callable[[GcloudStorageCpSettings], GcloudStorageCpSettings] | None=None) -> ExecResult

    Copy to or from Cloud Storage: gcloud storage cp.

  • static async storage_rsync(ctx: ServiceContext, configure: Callable[[GcloudStorageRsyncSettings], GcloudStorageRsyncSettings] | None=None) -> ExecResult

    Sync a tree to or from Cloud Storage: gcloud storage rsync.

  • static async storage_ls(ctx: ServiceContext, configure: Callable[[GcloudStorageLsSettings], GcloudStorageLsSettings] | None=None) -> ExecResult

    List objects: gcloud storage ls.

  • static async storage_rm(ctx: ServiceContext, configure: Callable[[GcloudStorageRmSettings], GcloudStorageRmSettings] | None=None) -> ExecResult

    Remove objects: gcloud storage rm.

  • static async clusters_get_credentials(ctx: ServiceContext, configure: Callable[[GcloudClustersGetCredentialsSettings], GcloudClustersGetCredentialsSettings] | None=None) -> ExecResult

    Write a kubeconfig entry for a GKE cluster: gcloud container clusters get-credentials.

  • static async clusters_list(ctx: ServiceContext, configure: Callable[[GcloudClustersListSettings], GcloudClustersListSettings] | None=None) -> ExecResult

    List GKE clusters: gcloud container clusters list.

  • static async clusters_describe(ctx: ServiceContext, configure: Callable[[GcloudClustersDescribeSettings], GcloudClustersDescribeSettings] | None=None) -> ExecResult

    Describe a GKE cluster: gcloud container clusters describe.

  • static async functions_deploy(ctx: ServiceContext, configure: Callable[[GcloudFunctionsDeploySettings], GcloudFunctionsDeploySettings] | None=None) -> ExecResult

    Deploy a Cloud Function: gcloud functions deploy.

  • static async functions_describe(ctx: ServiceContext, configure: Callable[[GcloudFunctionsDescribeSettings], GcloudFunctionsDescribeSettings] | None=None) -> ExecResult

    Describe a Cloud Function: gcloud functions describe.

  • static async secrets_access(ctx: ServiceContext, configure: Callable[[GcloudSecretsVersionsAccessSettings], GcloudSecretsVersionsAccessSettings] | None=None) -> ExecResult

    Read a secret version: gcloud secrets versions access.

  • static async secret_value(ctx: ServiceContext, configure: Callable[[GcloudSecretsVersionsAccessSettings], GcloudSecretsVersionsAccessSettings] | None=None) -> object

    A secret version's payload, read back as a string.

  • static async logging_read(ctx: ServiceContext, configure: Callable[[GcloudLoggingReadSettings], GcloudLoggingReadSettings] | None=None) -> ExecResult

    Read log entries: gcloud logging read. What it reads is printed, as gcloud prints it — into the build log unless .quiet() is set, and log entries can carry secrets.

  • static async log_entry_count(ctx: ServiceContext, configure: Callable[[GcloudLoggingEntryCountSettings], GcloudLoggingEntryCountSettings] | None=None) -> object

    How many log entries a gcloud logging read filter matches, counting at most .limit(n) (default 1000) and failing when more match. Reads only each entry's id, quietly, so no payload reaches the build.

  • static async logging_logs_list(ctx: ServiceContext, configure: Callable[[GcloudLoggingLogsListSettings], GcloudLoggingLogsListSettings] | None=None) -> ExecResult

    List the logs that hold entries: gcloud logging logs list.

  • static async monitoring_policies_list(ctx: ServiceContext, configure: Callable[[GcloudMonitoringPoliciesListSettings], GcloudMonitoringPoliciesListSettings] | None=None) -> ExecResult

    List alerting policies: gcloud monitoring policies list.

  • static async monitoring_policies_describe(ctx: ServiceContext, configure: Callable[[GcloudMonitoringPoliciesDescribeSettings], GcloudMonitoringPoliciesDescribeSettings] | None=None) -> ExecResult

    Describe an alerting policy: gcloud monitoring policies describe.

  • static async monitoring_dashboards_list(ctx: ServiceContext, configure: Callable[[GcloudMonitoringDashboardsListSettings], GcloudMonitoringDashboardsListSettings] | None=None) -> ExecResult

    List dashboards: gcloud monitoring dashboards list.

  • static async monitoring_uptime_list_configs(ctx: ServiceContext, configure: Callable[[GcloudMonitoringUptimeListConfigsSettings], GcloudMonitoringUptimeListConfigsSettings] | None=None) -> ExecResult

    List uptime checks and synthetic monitors: gcloud monitoring uptime list-configs.

#

GcsTasks

class
class GcsTasks

Typed Google Cloud Storage JSON operations.

  • static async read_json(ctx: ServiceContext, bucket: str, object: str, options: Mapping[str, object] | None=None) -> object

    Read object object from bucket and parse its body as JSON.

  • static async write_json(ctx: ServiceContext, bucket: str, object: str, data: object, options: Mapping[str, object] | None=None) -> None

    Write data (JSON-serialised) as object object in bucket.

  • static async list(ctx: ServiceContext, bucket: str, options: Mapping[str, object] | None=None) -> object

    List object names in bucket (optionally filtered by prefix).

#

SecretManagerTasks

class
class SecretManagerTasks

Typed Google Secret Manager operations.

  • static async access(ctx: ServiceContext, name: str, options: Mapping[str, object] | None=None) -> object

    Access secret name's payload as a string (version defaults to "latest").