zuke.tools.gcloud
@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.
zuke on PyPI ↗ 48 symbols
Symbols
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']) -> SelfHow 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-minuteALIGN_SUMpoints is the window's total. ADISTRIBUTIONpoint 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 withALIGN_PERCENTILE_99,ALIGN_MEANand the like. -
missing_data_as(value: float) -> SelfReturn
valuewhen 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 mean0; for a latency it usually means the filter is looking in the wrong place.
class CloudMonitoringTasks Typed Cloud Monitoring reads.
-
static async time_series_list(ctx: ServiceContext, configure: Callable[[CloudMonitoringTimeSeriesSettings], CloudMonitoringTimeSeriesSettings] | None=None) -> objectRead 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) -> objectOne number from the time series the settings describe: the latest value, or an aggregate of every point in the window.
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) -> SelfThe project to read from; when omitted,
GOOGLE_CLOUD_PROJECT(thenGCLOUD_PROJECT). -
metric_type(type_: str) -> SelfThe 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) -> SelfOnly series on this monitored-resource type:
resource.type = "<type>". -
resource_label(key: str, value: str) -> SelfOnly series whose resource label
keyisvalue; repeatable. -
metric_label(key: str, value: str) -> SelfOnly series whose metric label
keyisvalue; repeatable. -
filter(expression: str) -> SelfRaw 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) -> SelfHow 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) -> SelfRead exactly this interval instead of a window ending now.
-
alignment_period(duration: str | float) -> SelfWhat 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']) -> SelfHow 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']) -> SelfHow aligned series are combined (
aggregation.crossSeriesReducer). -
group_by_fields(*fields: str) -> SelfThe labels the reducer keeps series apart by (
aggregation.groupByFields), e.g."resource.labels.revision_name". -
view(view: Literal['FULL', 'HEADERS']) -> SelfFULL(the default) returns points;HEADERSonly each series' labels. -
page_size(count: float) -> SelfThe most results per page (
pageSize; the API's default is 100,000). -
max_pages(count: float) -> SelfThe 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) -> SelfEnd 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'srequest_countandrequest_latenciesare "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. Default0for a read; thecloudMonitoring(...)analysis defaults to two minutes. -
token(value: str) -> SelfA pre-resolved OAuth access token.
-
gcloud(configure: Callable[[GcloudSettings], GcloudSettings]) -> SelfGlobal 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.
class GcloudArtifactsImagesDeleteSettings(GcloudSettings) Settings for gcloud artifacts docker images delete.
-
image(reference: str) -> SelfThe image or version to delete (positional).
-
delete_tags() -> SelfDelete the version even though tags point at it (
--delete-tags), which gcloud otherwise refuses.
class GcloudArtifactsImagesListSettings(GcloudSettings) Settings for gcloud artifacts docker images list.
-
repository(path: str) -> SelfThe repository or image to list (positional).
-
include_tags() -> SelfInclude each version's tags (
--include-tags). -
limit(value: float) -> SelfReturn at most this many images (
--limit). -
filter(expression: str) -> SelfRestrict the listing (
--filter).
class GcloudArtifactsRepositoriesDescribeSettings(GcloudSettings) Settings for gcloud artifacts repositories describe.
-
repository(name: str) -> SelfThe repository to describe (positional).
-
location(value: str) -> SelfThe location it lives in (
--location).
class GcloudArtifactsRepositoriesListSettings(GcloudSettings) Settings for gcloud artifacts repositories list.
-
location(value: str) -> SelfThe location to list from (
--location). -
limit(value: float) -> SelfReturn at most this many repositories (
--limit).
class GcloudAuthActivateServiceAccountSettings(GcloudSettings) Settings for gcloud auth activate-service-account.
-
service_account(email: str) -> SelfThe service account to activate (positional); optional beside a key file.
-
key_file(path: str) -> SelfThe JSON key to activate it from (
--key-file).
class GcloudAuthConfigureDockerSettings(GcloudSettings) Settings for gcloud auth configure-docker.
-
registries(*values: str) -> SelfThe registries to add a credential helper for (positional, comma separated), e.g.
"us-central1-docker.pkg.dev"; repeatable.
class GcloudAuthListSettings(GcloudSettings) Settings for gcloud auth list.
-
filter_account(email: str) -> SelfOnly the named account (
--filter-account).
class GcloudAuthPrintAccessTokenSettings(GcloudSettings) Settings for gcloud auth print-access-token.
-
for_account(email: str) -> SelfPrint the token for this account rather than the active one (positional).
class GcloudAuthPrintIdentityTokenSettings(GcloudSettings) Settings for gcloud auth print-identity-token.
-
for_account(email: str) -> SelfPrint the token for this account rather than the active one (positional).
-
audiences(*values: str) -> SelfThe 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() -> SelfInclude the service account email in the token (
--include-email).
class GcloudAuthRevokeSettings(GcloudSettings) Settings for gcloud auth revoke.
-
accounts(*values: str) -> SelfThe accounts to revoke (positional); repeatable.
-
all() -> SelfRevoke every credentialed account (
--all).
class GcloudBuildsDescribeSettings(GcloudSettings) Settings for gcloud builds describe.
-
build(id: str) -> SelfThe build to describe (positional).
-
region(value: str) -> SelfThe region it ran in (
--region).
class GcloudBuildsListSettings(GcloudSettings) Settings for gcloud builds list.
-
limit(value: float) -> SelfReturn at most this many builds (
--limit). -
filter(expression: str) -> SelfRestrict the listing (
--filter), e.g."status=SUCCESS". -
region(value: str) -> SelfThe region to list from (
--region). -
ongoing() -> SelfOnly builds that have not finished (
--ongoing).
class GcloudBuildsLogSettings(GcloudSettings) Settings for gcloud builds log.
-
build(id: str) -> SelfThe build whose log to read (positional).
-
stream() -> SelfFollow 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) -> SelfThe region it ran in (
--region).
class GcloudBuildsSubmitSettings(GcloudSettings) Settings for gcloud builds submit.
-
source(path: str) -> SelfThe source to build (positional), e.g.
"."or ags://archive. -
tag(image: str) -> SelfBuild a container and push it to this tag (
--tag). -
config(path: str) -> SelfBuild from a config file (
--config), e.g.cloudbuild.yaml. -
pack(spec: str) -> SelfBuild with buildpacks (
--pack), e.g."image=gcr.io/p/i". -
timeout(value: str) -> SelfFail the build after this long (
--timeout), e.g."600s". -
machine_type(value: str) -> SelfThe machine type to build on (
--machine-type). -
substitutions(*pairs: str) -> SelfSubstitution values for the config (
--substitutions); repeatable. -
async_() -> SelfReturn as soon as the build is queued (
--async). -
gcs_source_staging_dir(uri: str) -> SelfStage the source under this bucket path (
--gcs-source-staging-dir). -
ignore_file(path: str) -> SelfExclude files matching this ignore file (
--ignore-file). -
region(value: str) -> SelfThe region to build in (
--region).
class GcloudClustersDescribeSettings(GcloudSettings) Settings for gcloud container clusters describe.
-
cluster(name: str) -> SelfThe cluster to describe (positional).
-
location(value: str) -> SelfThe cluster's location (
--location). -
region(value: str) -> SelfThe cluster's region (
--region). -
zone(value: str) -> SelfThe cluster's zone (
--zone).
class GcloudClustersGetCredentialsSettings(GcloudSettings) Settings for gcloud container clusters get-credentials.
-
cluster(name: str) -> SelfThe cluster to fetch credentials for (positional).
-
location(value: str) -> SelfThe cluster's location (
--location). -
region(value: str) -> SelfThe cluster's region (
--region). -
zone(value: str) -> SelfThe cluster's zone (
--zone). -
internal_ip() -> SelfUse the internal endpoint (
--internal-ip), for a private cluster. -
dns_endpoint() -> SelfUse the DNS endpoint (
--dns-endpoint).
class GcloudClustersListSettings(GcloudSettings) Settings for gcloud container clusters list.
-
location(value: str) -> SelfRestrict to a location (
--location). -
region(value: str) -> SelfRestrict to a region (
--region). -
zone(value: str) -> SelfRestrict to a zone (
--zone). -
filter(expression: str) -> SelfRestrict the listing (
--filter).
class GcloudConfigGetValueSettings(GcloudSettings) Settings for gcloud config get-value.
-
property(name: str) -> SelfThe property to read (positional).
class GcloudConfigListSettings(GcloudSettings) Settings for gcloud config list.
-
all() -> SelfInclude properties left at their defaults (
--all).
class GcloudConfigSetSettings(GcloudSettings) Settings for gcloud config set.
-
property(name: str) -> SelfThe property to set (positional), e.g.
"project"or"run/region". -
value(text: str) -> SelfThe value to set it to (positional).
class GcloudConfigUnsetSettings(GcloudSettings) Settings for gcloud config unset.
-
property(name: str) -> SelfThe property to clear (positional).
class GcloudFunctionsDeploySettings(GcloudSettings) Settings for gcloud functions deploy.
-
function(name: str) -> SelfThe function to deploy (positional).
-
runtime(value: str) -> SelfThe language runtime (
--runtime), e.g."nodejs20". -
region(value: str) -> SelfThe region to deploy into (
--region). -
entry_point(value: str) -> SelfThe exported symbol to invoke (
--entry-point). -
source(path: str) -> SelfWhere the source lives (
--source). -
trigger_http() -> SelfTrigger on HTTP requests (
--trigger-http). -
trigger_topic(name: str) -> SelfTrigger on a Pub/Sub topic (
--trigger-topic). -
trigger_bucket(name: str) -> SelfTrigger on a Cloud Storage bucket (
--trigger-bucket). -
trigger_event_filters(*filters: str) -> SelfTrigger on matching Eventarc events (
--trigger-event-filters). -
service_account(email: str) -> SelfThe identity the function runs as (
--service-account). -
set_env_vars(*pairs: str) -> SelfEnvironment variables (
--set-env-vars), asKEY=value; repeatable. -
memory(value: str) -> SelfMemory per instance (
--memory). -
timeout(value: str) -> SelfExecution timeout (
--timeout). -
gen2() -> SelfDeploy as a 2nd-generation function (
--gen2).
class GcloudFunctionsDescribeSettings(GcloudSettings) Settings for gcloud functions describe.
-
function(name: str) -> SelfThe function to describe (positional).
-
region(value: str) -> SelfThe region it runs in (
--region). -
gen2() -> SelfLook it up as a 2nd-generation function (
--gen2).
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".
class GcloudLoggingLogsListSettings(GcloudSettings) Settings for gcloud logging logs list: the logs that hold entries.
-
log_view(bucket: str, location: str, view: str) -> SelfList the logs of a log view (
--bucket,--location,--view). -
filter(expression: str) -> SelfKeep only matching logs (
--filter), gcloud's own list filter. -
limit(count: float) -> SelfList at most this many logs (
--limit). -
sort_by(*fields: str) -> SelfSort by these fields (
--sort-by); prefix one with~to descend.
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) -> SelfRaw 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) -> SelfOnly entries from this monitored-resource type:
resource.type="…". -
resource_label(key: str, value: str) -> SelfOnly entries whose resource label
keyisvalue; repeatable. -
label(key: str, value: str) -> SelfOnly entries whose own label
keyisvalue; repeatable. -
min_severity(severity: Literal['DEFAULT', 'DEBUG', 'INFO', 'NOTICE', 'WARNING', 'ERROR', 'CRITICAL', 'ALERT', 'EMERGENCY']) -> SelfOnly entries at
severityor above:severity>=ERROR. -
since(time: str) -> SelfOnly entries at or after
time:timestamp>="…". -
until(time: str) -> SelfOnly entries before
time:timestamp<"…". -
freshness(duration: str | float) -> SelfOnly entries newer than this —
"1h","90s", or ms — sent as an explicittimestamp>="<now − duration>"in the filter, measured from now. gcloud's own--freshnessis not used: gcloud silently drops it whenever the filter's text contains the wordtimestampanywhere, or the order isasc, and the read then spans the whole retention period. -
order(order: Literal['asc', 'desc']) -> SelfNewest first (
desc, gcloud's default) or oldest first (--order). -
limit(count: float) -> SelfRead at most this many entries (
--limit; gcloud's default is unlimited). -
organization(id: str) -> SelfRead from an organization's logs (
--organization). gcloud takes one of--organization,--folder,--billing-accountand--project. -
folder(id: str) -> SelfRead from a folder's logs (
--folder). -
billing_account(id: str) -> SelfRead from a billing account's logs (
--billing-account). -
log_view(bucket: str, location: str, view: str) -> SelfRead through a log view (
--bucket,--location,--view). -
resource_names(*names: str) -> SelfRead 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.
class GcloudMonitoringDashboardsListSettings(GcloudMonitoringListSettings) Settings for gcloud monitoring dashboards list.
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) -> SelfKeep only matching items (
--filter), gcloud's own list filter. -
limit(count: float) -> SelfList at most this many items (
--limit). -
page_size(count: float) -> SelfHow many items to request per page (
--page-size). -
sort_by(*fields: str) -> SelfSort by these fields (
--sort-by); prefix one with~to descend. -
uri() -> SelfPrint each item's resource URI instead (
--uri).
class GcloudMonitoringPoliciesDescribeSettings(GcloudSettings) Settings for gcloud monitoring policies describe.
-
policy(id_or_name: str) -> SelfThe policy to describe (positional): its id, or its full name
projects/<project>/alertPolicies/<id>.
class GcloudMonitoringPoliciesListSettings(GcloudMonitoringListSettings) Settings for gcloud monitoring policies list: the alerting policies.
class GcloudMonitoringUptimeListConfigsSettings(GcloudMonitoringListSettings) Settings for gcloud monitoring uptime list-configs: the uptime checks and synthetic monitors.
class GcloudRunDeploySettings(GcloudSettings) Settings for gcloud run deploy.
-
service(name: str) -> SelfThe service to deploy (positional).
-
image(reference: str) -> SelfThe container image to deploy (
--image). -
source(path: str) -> SelfBuild and deploy from source instead of an image (
--source). -
region(value: str) -> SelfThe region to deploy into (
--region). -
platform(value: str) -> SelfThe platform to target (
--platform), e.g."managed". -
allow_unauthenticated() -> SelfLet unauthenticated callers invoke the service (
--allow-unauthenticated). -
no_allow_unauthenticated() -> SelfRequire authentication to invoke it (
--no-allow-unauthenticated). -
service_account(email: str) -> SelfThe identity the service runs as (
--service-account). -
set_env_vars(*pairs: str) -> SelfEnvironment variables (
--set-env-vars), asKEY=value; repeatable. -
set_secrets(*pairs: str) -> SelfSecret Manager mounts (
--set-secrets); repeatable. -
memory(value: str) -> SelfMemory per instance (
--memory), e.g."512Mi". -
cpu(value: str) -> SelfCPU per instance (
--cpu). -
concurrency(value: float) -> SelfRequests served concurrently per instance (
--concurrency). -
max_instances(value: float) -> SelfUpper bound on instances (
--max-instances). -
min_instances(value: float) -> SelfLower bound on instances (
--min-instances). -
port(value: float) -> SelfThe port the container listens on (
--port). -
timeout(value: str) -> SelfRequest timeout (
--timeout). -
tag(value: str) -> SelfTag this revision (
--tag), so it is addressable without traffic. -
no_traffic() -> SelfDeploy without moving traffic to the new revision (
--no-traffic).
class GcloudRunServicesDescribeSettings(GcloudSettings) Settings for gcloud run services describe.
-
service(name: str) -> SelfThe service to describe (positional).
-
region(value: str) -> SelfThe region it runs in (
--region). -
platform(value: str) -> SelfThe platform it runs on (
--platform).
class GcloudRunServicesListSettings(GcloudSettings) Settings for gcloud run services list.
-
region(value: str) -> SelfThe region to list from (
--region). -
platform(value: str) -> SelfThe platform to list from (
--platform). -
filter(expression: str) -> SelfRestrict the listing (
--filter).
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) -> SelfThe service to update (positional).
-
region(value: str) -> SelfThe region it runs in (
--region). -
platform(value: str) -> SelfThe platform it runs on (
--platform). -
image(reference: str) -> SelfThe container image to point the service at (
--image). -
update_env_vars(*pairs: str) -> SelfSet or overwrite environment variables (
--update-env-vars), asKEY=value; repeatable. Variables the call does not name are left alone — which is the difference fromrun deploy's--set-env-vars. -
remove_env_vars(*names: str) -> SelfRemove environment variables by name (
--remove-env-vars); repeatable. -
clear_env_vars() -> SelfRemove every environment variable the service has (
--clear-env-vars). -
update_secrets(*pairs: str) -> SelfSet or overwrite Secret Manager mounts (
--update-secrets), asKEY=secret:version; repeatable. -
memory(value: str) -> SelfMemory per instance (
--memory), e.g."512Mi". -
cpu(value: str) -> SelfCPU per instance (
--cpu). -
concurrency(value: float) -> SelfRequests served concurrently per instance (
--concurrency). -
max_instances(value: float) -> SelfUpper bound on instances (
--max-instances). -
min_instances(value: float) -> SelfLower bound on instances (
--min-instances). -
tag(value: str) -> SelfTag the revision this update creates (
--tag). -
no_traffic() -> SelfCreate the revision without moving traffic to it (
--no-traffic).
class GcloudRunUpdateTrafficSettings(GcloudSettings) Settings for gcloud run services update-traffic.
-
service(name: str) -> SelfThe service whose traffic to move (positional).
-
region(value: str) -> SelfThe region it runs in (
--region). -
to_latest() -> SelfSend all traffic to the newest revision (
--to-latest). -
to_revisions(*splits: str) -> SelfSplit traffic across revisions (
--to-revisions), asrev=percent. -
to_tags(*splits: str) -> SelfSplit traffic across tags (
--to-tags), astag=percent.
class GcloudSecretsVersionsAccessSettings(GcloudSettings) Settings for gcloud secrets versions access.
-
version(value: str) -> SelfThe version to read (positional); defaults to
latest. -
secret(name: str) -> SelfThe secret to read it from (
--secret).
class GcloudSettings(SubcommandSettings) Settings for a gcloud invocation.
-
container_images_add_tag(source: str, *destinations: str) -> SelfAdd 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-tagotherwise prompts for confirmation). -
sql_instances_describe(instance: str) -> SelfDescribe 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) -> SelfBlock until a Cloud SQL operation completes:
gcloud sql operations wait <operation>— the typed form of the poll-an-operation shell loop. -
project(id: str) -> SelfTarget Google Cloud project (
--project). -
account(email: str) -> SelfAccount to run as (
--account). -
configuration(name: str) -> SelfNamed gcloud configuration to use (
--configuration). -
format(value: str) -> SelfOutput format, e.g.
json,yaml,value(name)(--format). -
verbosity(level: str) -> SelfLogging verbosity:
debug,info,warning,error, … (--verbosity). -
no_prompt() -> SelfDisable interactive prompts, accepting defaults (gcloud's
--quiet). NamednoPromptto avoid clashing with the base.quiet(), which suppresses Zuke's own output streaming.
class GcloudStorageCpSettings(GcloudSettings) Settings for gcloud storage cp.
-
sources(*paths: str) -> SelfThe sources to copy (positional); repeatable.
-
destination(path: str) -> SelfWhere to copy them (positional).
-
recursive() -> SelfCopy directories and their contents (
--recursive). -
no_clobber() -> SelfSkip objects that already exist (
--no-clobber). -
content_type(value: str) -> SelfSet the uploaded objects' content type (
--content-type). -
cache_control(value: str) -> SelfSet the uploaded objects' cache control (
--cache-control).
class GcloudStorageLsSettings(GcloudSettings) Settings for gcloud storage ls.
-
paths(*values: str) -> SelfThe paths to list (positional); repeatable.
-
recursive() -> SelfRecurse into prefixes (
--recursive). -
long() -> SelfInclude size and creation time (
--long).
class GcloudStorageRmSettings(GcloudSettings) Settings for gcloud storage rm.
-
paths(*values: str) -> SelfThe objects or prefixes to remove (positional); repeatable.
-
recursive() -> SelfRemove prefixes and everything under them (
--recursive).
class GcloudStorageRsyncSettings(GcloudSettings) Settings for gcloud storage rsync.
-
source(path: str) -> SelfThe source tree (positional).
-
destination(path: str) -> SelfThe destination tree (positional).
-
recursive() -> SelfRecurse into directories (
--recursive). -
delete_unmatched_destination_objects() -> SelfDelete 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) -> SelfSkip paths matching this pattern (
--exclude).
class GcloudTasks Typed task functions for the gcloud CLI.
-
static async run(ctx: ServiceContext, configure: Callable[[GcloudSettings], GcloudSettings] | None=None) -> ExecResultRun a
gcloudcommand. -
static async auth_activate_service_account(ctx: ServiceContext, configure: Callable[[GcloudAuthActivateServiceAccountSettings], GcloudAuthActivateServiceAccountSettings] | None=None) -> ExecResultActivate a service account:
gcloud auth activate-service-account. -
static async auth_print_access_token(ctx: ServiceContext, configure: Callable[[GcloudAuthPrintAccessTokenSettings], GcloudAuthPrintAccessTokenSettings] | None=None) -> ExecResultPrint an OAuth access token:
gcloud auth print-access-token. -
static async access_token(ctx: ServiceContext, configure: Callable[[GcloudAuthPrintAccessTokenSettings], GcloudAuthPrintAccessTokenSettings] | None=None) -> objectThe OAuth access token itself, read back as a string.
-
static async auth_print_identity_token(ctx: ServiceContext, configure: Callable[[GcloudAuthPrintIdentityTokenSettings], GcloudAuthPrintIdentityTokenSettings] | None=None) -> ExecResultPrint an identity token:
gcloud auth print-identity-token. -
static async identity_token(ctx: ServiceContext, configure: Callable[[GcloudAuthPrintIdentityTokenSettings], GcloudAuthPrintIdentityTokenSettings] | None=None) -> objectThe identity token itself, read back as a string.
-
static async auth_configure_docker(ctx: ServiceContext, configure: Callable[[GcloudAuthConfigureDockerSettings], GcloudAuthConfigureDockerSettings] | None=None) -> ExecResultRegister gcloud as a Docker credential helper:
gcloud auth configure-docker. -
static async auth_list(ctx: ServiceContext, configure: Callable[[GcloudAuthListSettings], GcloudAuthListSettings] | None=None) -> ExecResultList credentialed accounts:
gcloud auth list. -
static async auth_revoke(ctx: ServiceContext, configure: Callable[[GcloudAuthRevokeSettings], GcloudAuthRevokeSettings] | None=None) -> ExecResultRevoke credentials:
gcloud auth revoke. -
static async config_set(ctx: ServiceContext, configure: Callable[[GcloudConfigSetSettings], GcloudConfigSetSettings] | None=None) -> ExecResultSet a property:
gcloud config set. -
static async config_unset(ctx: ServiceContext, configure: Callable[[GcloudConfigUnsetSettings], GcloudConfigUnsetSettings] | None=None) -> ExecResultClear a property:
gcloud config unset. -
static async config_get_value(ctx: ServiceContext, configure: Callable[[GcloudConfigGetValueSettings], GcloudConfigGetValueSettings] | None=None) -> ExecResultRead a property:
gcloud config get-value. -
static async config_value(ctx: ServiceContext, configure: Callable[[GcloudConfigGetValueSettings], GcloudConfigGetValueSettings] | None=None) -> objectA configured property's value, read back as a string.
-
static async config_list(ctx: ServiceContext, configure: Callable[[GcloudConfigListSettings], GcloudConfigListSettings] | None=None) -> ExecResultList the active configuration:
gcloud config list. -
static async builds_submit(ctx: ServiceContext, configure: Callable[[GcloudBuildsSubmitSettings], GcloudBuildsSubmitSettings] | None=None) -> ExecResultSubmit a Cloud Build:
gcloud builds submit. -
static async builds_list(ctx: ServiceContext, configure: Callable[[GcloudBuildsListSettings], GcloudBuildsListSettings] | None=None) -> ExecResultList builds:
gcloud builds list. -
static async builds_describe(ctx: ServiceContext, configure: Callable[[GcloudBuildsDescribeSettings], GcloudBuildsDescribeSettings] | None=None) -> ExecResultDescribe a build:
gcloud builds describe. -
static async builds_log(ctx: ServiceContext, configure: Callable[[GcloudBuildsLogSettings], GcloudBuildsLogSettings] | None=None) -> ExecResultRead a build's log:
gcloud builds log. -
static async run_deploy(ctx: ServiceContext, configure: Callable[[GcloudRunDeploySettings], GcloudRunDeploySettings] | None=None) -> ExecResultDeploy to Cloud Run:
gcloud run deploy. -
static async run_services_describe(ctx: ServiceContext, configure: Callable[[GcloudRunServicesDescribeSettings], GcloudRunServicesDescribeSettings] | None=None) -> ExecResultDescribe a Cloud Run service:
gcloud run services describe. -
static async run_service_url(ctx: ServiceContext, configure: Callable[[GcloudRunServicesDescribeSettings], GcloudRunServicesDescribeSettings] | None=None) -> objectThe URL Cloud Run assigned a service, read back as a string. Pins
--formatto gcloud's own value projection, so gcloud extracts the field. -
static async run_services_list(ctx: ServiceContext, configure: Callable[[GcloudRunServicesListSettings], GcloudRunServicesListSettings] | None=None) -> ExecResultList Cloud Run services:
gcloud run services list. -
static async run_services_update(ctx: ServiceContext, configure: Callable[[GcloudRunServicesUpdateSettings], GcloudRunServicesUpdateSettings] | None=None) -> ExecResultAmend 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) -> ExecResultMove traffic between revisions:
gcloud run services update-traffic. -
static async artifacts_images_list(ctx: ServiceContext, configure: Callable[[GcloudArtifactsImagesListSettings], GcloudArtifactsImagesListSettings] | None=None) -> ExecResultList images in Artifact Registry:
gcloud artifacts docker images list. -
static async artifacts_images_delete(ctx: ServiceContext, configure: Callable[[GcloudArtifactsImagesDeleteSettings], GcloudArtifactsImagesDeleteSettings] | None=None) -> ExecResultDelete an image:
gcloud artifacts docker images delete. -
static async artifacts_repositories_list(ctx: ServiceContext, configure: Callable[[GcloudArtifactsRepositoriesListSettings], GcloudArtifactsRepositoriesListSettings] | None=None) -> ExecResultList repositories:
gcloud artifacts repositories list. -
static async artifacts_repositories_describe(ctx: ServiceContext, configure: Callable[[GcloudArtifactsRepositoriesDescribeSettings], GcloudArtifactsRepositoriesDescribeSettings] | None=None) -> ExecResultDescribe a repository:
gcloud artifacts repositories describe. -
static async storage_cp(ctx: ServiceContext, configure: Callable[[GcloudStorageCpSettings], GcloudStorageCpSettings] | None=None) -> ExecResultCopy to or from Cloud Storage:
gcloud storage cp. -
static async storage_rsync(ctx: ServiceContext, configure: Callable[[GcloudStorageRsyncSettings], GcloudStorageRsyncSettings] | None=None) -> ExecResultSync a tree to or from Cloud Storage:
gcloud storage rsync. -
static async storage_ls(ctx: ServiceContext, configure: Callable[[GcloudStorageLsSettings], GcloudStorageLsSettings] | None=None) -> ExecResultList objects:
gcloud storage ls. -
static async storage_rm(ctx: ServiceContext, configure: Callable[[GcloudStorageRmSettings], GcloudStorageRmSettings] | None=None) -> ExecResultRemove objects:
gcloud storage rm. -
static async clusters_get_credentials(ctx: ServiceContext, configure: Callable[[GcloudClustersGetCredentialsSettings], GcloudClustersGetCredentialsSettings] | None=None) -> ExecResultWrite a kubeconfig entry for a GKE cluster:
gcloud container clusters get-credentials. -
static async clusters_list(ctx: ServiceContext, configure: Callable[[GcloudClustersListSettings], GcloudClustersListSettings] | None=None) -> ExecResultList GKE clusters:
gcloud container clusters list. -
static async clusters_describe(ctx: ServiceContext, configure: Callable[[GcloudClustersDescribeSettings], GcloudClustersDescribeSettings] | None=None) -> ExecResultDescribe a GKE cluster:
gcloud container clusters describe. -
static async functions_deploy(ctx: ServiceContext, configure: Callable[[GcloudFunctionsDeploySettings], GcloudFunctionsDeploySettings] | None=None) -> ExecResultDeploy a Cloud Function:
gcloud functions deploy. -
static async functions_describe(ctx: ServiceContext, configure: Callable[[GcloudFunctionsDescribeSettings], GcloudFunctionsDescribeSettings] | None=None) -> ExecResultDescribe a Cloud Function:
gcloud functions describe. -
static async secrets_access(ctx: ServiceContext, configure: Callable[[GcloudSecretsVersionsAccessSettings], GcloudSecretsVersionsAccessSettings] | None=None) -> ExecResultRead a secret version:
gcloud secrets versions access. -
static async secret_value(ctx: ServiceContext, configure: Callable[[GcloudSecretsVersionsAccessSettings], GcloudSecretsVersionsAccessSettings] | None=None) -> objectA secret version's payload, read back as a string.
-
static async logging_read(ctx: ServiceContext, configure: Callable[[GcloudLoggingReadSettings], GcloudLoggingReadSettings] | None=None) -> ExecResultRead 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) -> objectHow many log entries a
gcloud logging readfilter 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) -> ExecResultList the logs that hold entries:
gcloud logging logs list. -
static async monitoring_policies_list(ctx: ServiceContext, configure: Callable[[GcloudMonitoringPoliciesListSettings], GcloudMonitoringPoliciesListSettings] | None=None) -> ExecResultList alerting policies:
gcloud monitoring policies list. -
static async monitoring_policies_describe(ctx: ServiceContext, configure: Callable[[GcloudMonitoringPoliciesDescribeSettings], GcloudMonitoringPoliciesDescribeSettings] | None=None) -> ExecResultDescribe an alerting policy:
gcloud monitoring policies describe. -
static async monitoring_dashboards_list(ctx: ServiceContext, configure: Callable[[GcloudMonitoringDashboardsListSettings], GcloudMonitoringDashboardsListSettings] | None=None) -> ExecResultList dashboards:
gcloud monitoring dashboards list. -
static async monitoring_uptime_list_configs(ctx: ServiceContext, configure: Callable[[GcloudMonitoringUptimeListConfigsSettings], GcloudMonitoringUptimeListConfigsSettings] | None=None) -> ExecResultList uptime checks and synthetic monitors:
gcloud monitoring uptime list-configs.
class GcsTasks Typed Google Cloud Storage JSON operations.
-
static async read_json(ctx: ServiceContext, bucket: str, object: str, options: Mapping[str, object] | None=None) -> objectRead object
objectfrombucketand parse its body as JSON. -
static async write_json(ctx: ServiceContext, bucket: str, object: str, data: object, options: Mapping[str, object] | None=None) -> NoneWrite
data(JSON-serialised) as objectobjectinbucket. -
static async list(ctx: ServiceContext, bucket: str, options: Mapping[str, object] | None=None) -> objectList object names in
bucket(optionally filtered byprefix).
class SecretManagerTasks Typed Google Secret Manager operations.
-
static async access(ctx: ServiceContext, name: str, options: Mapping[str, object] | None=None) -> objectAccess secret
name's payload as a string (version defaults to"latest").