As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Cloud Run v2 API

class google.cloud.run_v2.types.BinaryAuthorization(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Settings for Binary Authorization feature.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

use_default

Optional. If True, indicates to use the default project’s binary authorization policy. If False, binary authorization will be disabled.

This field is a member of oneof binauthz_method.

Type

bool

policy

Optional. The path to a binary authorization policy. Format: projects/{project}/platforms/cloudRun/{policy-name}

This field is a member of oneof binauthz_method.

Type

str

breakglass_justification

Optional. If present, indicates to use Breakglass using this justification. If use_default is False, then it must be empty. For more information on breakglass, see https://cloud.google.com/binary-authorization/docs/using-breakglass

Type

str

class google.cloud.run_v2.types.CancelExecutionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for deleting an Execution.

name

Required. The name of the Execution to cancel. Format: projects/{project}/locations/{location}/jobs/{job}/executions/{execution}, where {project} can be project id or number.

Type

str

validate_only

Indicates that the request should be validated without actually cancelling any resources.

Type

bool

etag

A system-generated fingerprint for this version of the resource. This may be used to detect modification conflict during updates.

Type

str

class google.cloud.run_v2.types.CloudSqlInstance(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents a set of Cloud SQL instances. Each one will be available under /cloudsql/[instance]. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run.

instances

The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format:

{project}:{location}:{instance}

Type

MutableSequence[str]

class google.cloud.run_v2.types.Condition(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Defines a status condition for a resource.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

type_

type is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting Types common to all resources include:

  • “Ready”: True when the Resource is ready.

Type

str

state

State of the condition.

Type

google.cloud.run_v2.types.Condition.State

message

Human readable message indicating details about the current status.

Type

str

last_transition_time

Last time the condition transitioned from one status to another.

Type

google.protobuf.timestamp_pb2.Timestamp

severity

How to interpret failures of this condition, one of Error, Warning, Info

Type

google.cloud.run_v2.types.Condition.Severity

reason

Output only. A common (service-level) reason for this condition.

This field is a member of oneof reasons.

Type

google.cloud.run_v2.types.Condition.CommonReason

revision_reason

Output only. A reason for the revision condition.

This field is a member of oneof reasons.

Type

google.cloud.run_v2.types.Condition.RevisionReason

execution_reason

Output only. A reason for the execution condition.

This field is a member of oneof reasons.

Type

google.cloud.run_v2.types.Condition.ExecutionReason

class CommonReason(value)[source]

Bases: proto.enums.Enum

Reasons common to all types of conditions.

Values:
COMMON_REASON_UNDEFINED (0):

Default value.

UNKNOWN (1):

Reason unknown. Further details will be in message.

REVISION_FAILED (3):

Revision creation process failed.

PROGRESS_DEADLINE_EXCEEDED (4):

Timed out waiting for completion.

CONTAINER_MISSING (6):

The container image path is incorrect.

CONTAINER_PERMISSION_DENIED (7):

Insufficient permissions on the container image.

CONTAINER_IMAGE_UNAUTHORIZED (8):

Container image is not authorized by policy.

CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED (9):

Container image policy authorization check failed.

ENCRYPTION_KEY_PERMISSION_DENIED (10):

Insufficient permissions on encryption key.

ENCRYPTION_KEY_CHECK_FAILED (11):

Permission check on encryption key failed.

SECRETS_ACCESS_CHECK_FAILED (12):

At least one Access check on secrets failed.

WAITING_FOR_OPERATION (13):

Waiting for operation to complete.

IMMEDIATE_RETRY (14):

System will retry immediately.

POSTPONED_RETRY (15):

System will retry later; current attempt failed.

INTERNAL (16):

An internal error occurred. Further information may be in the message.

class ExecutionReason(value)[source]

Bases: proto.enums.Enum

Reasons specific to Execution resource.

Values:
EXECUTION_REASON_UNDEFINED (0):

Default value.

JOB_STATUS_SERVICE_POLLING_ERROR (1):

Internal system error getting execution status. System will retry.

NON_ZERO_EXIT_CODE (2):

A task reached its retry limit and the last attempt failed due to the user container exiting with a non-zero exit code.

CANCELLED (3):

The execution was cancelled by users.

CANCELLING (4):

The execution is in the process of being cancelled.

DELETED (5):

The execution was deleted.

class RevisionReason(value)[source]

Bases: proto.enums.Enum

Reasons specific to Revision resource.

Values:
REVISION_REASON_UNDEFINED (0):

Default value.

PENDING (1):

Revision in Pending state.

RESERVE (2):

Revision is in Reserve state.

RETIRED (3):

Revision is Retired.

RETIRING (4):

Revision is being retired.

RECREATING (5):

Revision is being recreated.

HEALTH_CHECK_CONTAINER_ERROR (6):

There was a health check error.

CUSTOMIZED_PATH_RESPONSE_PENDING (7):

Health check failed due to user error from customized path of the container. System will retry.

MIN_INSTANCES_NOT_PROVISIONED (8):

A revision with min_instance_count > 0 was created and is reserved, but it was not configured to serve traffic, so it’s not live. This can also happen momentarily during traffic migration.

ACTIVE_REVISION_LIMIT_REACHED (9):

The maximum allowed number of active revisions has been reached.

NO_DEPLOYMENT (10):

There was no deployment defined. This value is no longer used, but Services created in older versions of the API might contain this value.

HEALTH_CHECK_SKIPPED (11):

A revision’s container has no port specified since the revision is of a manually scaled service with 0 instance count

MIN_INSTANCES_WARMING (12):

A revision with min_instance_count > 0 was created and is waiting for enough instances to begin a traffic migration.

class Severity(value)[source]

Bases: proto.enums.Enum

Represents the severity of the condition failures.

Values:
SEVERITY_UNSPECIFIED (0):

Unspecified severity

ERROR (1):

Error severity.

WARNING (2):

Warning severity.

INFO (3):

Info severity.

class State(value)[source]

Bases: proto.enums.Enum

Represents the possible Condition states.

Values:
STATE_UNSPECIFIED (0):

The default value. This value is used if the state is omitted.

CONDITION_PENDING (1):

Transient state: Reconciliation has not started yet.

CONDITION_RECONCILING (2):

Transient state: reconciliation is still in progress.

CONDITION_FAILED (3):

Terminal state: Reconciliation did not succeed.

CONDITION_SUCCEEDED (4):

Terminal state: Reconciliation completed successfully.

class google.cloud.run_v2.types.Container(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A single application container. This specifies both the container to run, the command to run in the container and the arguments to supply to it. Note that additional arguments can be supplied by the system to the container at runtime.

name

Name of the container specified as a DNS_LABEL (RFC 1123).

Type

str

image

Required. Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed.

Type

str

command

Entrypoint array. Not executed within a shell. The docker image’s ENTRYPOINT is used if this is not provided.

Type

MutableSequence[str]

args

Arguments to the entrypoint. The docker image’s CMD is used if this is not provided.

Type

MutableSequence[str]

env

List of environment variables to set in the container.

Type

MutableSequence[google.cloud.run_v2.types.EnvVar]

resources

Compute Resource requirements by this container.

Type

google.cloud.run_v2.types.ResourceRequirements

ports

List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible.

If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.

Type

MutableSequence[google.cloud.run_v2.types.ContainerPort]

volume_mounts

Volume to mount into the container’s filesystem.

Type

MutableSequence[google.cloud.run_v2.types.VolumeMount]

working_dir

Container’s working directory. If not specified, the container runtime’s default will be used, which might be configured in the container image.

Type

str

liveness_probe

Periodic probe of container liveness. Container will be restarted if the probe fails.

Type

google.cloud.run_v2.types.Probe

startup_probe

Startup probe of application within the container. All other probes are disabled if a startup probe is provided, until it succeeds. Container will not be added to service endpoints if the probe fails.

Type

google.cloud.run_v2.types.Probe

depends_on

Names of the containers that must start before this container.

Type

MutableSequence[str]

class google.cloud.run_v2.types.ContainerPort(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

ContainerPort represents a network port in a single container.

name

If specified, used to specify which protocol to use. Allowed values are “http1” and “h2c”.

Type

str

container_port

Port number the container listens on. This must be a valid TCP port number, 0 < container_port < 65536.

Type

int

class google.cloud.run_v2.types.CreateJobRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for creating a Job.

parent

Required. The location and project in which this Job should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number.

Type

str

job

Required. The Job instance to create.

Type

google.cloud.run_v2.types.Job

job_id

Required. The unique identifier for the Job. The name of the job becomes {parent}/jobs/{job_id}.

Type

str

validate_only

Indicates that the request should be validated and default values populated, without persisting the request or creating any resources.

Type

bool

class google.cloud.run_v2.types.CreateServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for creating a Service.

parent

Required. The location and project in which this service should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number. Only lowercase characters, digits, and hyphens.

Type

str

service

Required. The Service instance to create.

Type

google.cloud.run_v2.types.Service

service_id

Required. The unique identifier for the Service. It must begin with letter, and cannot end with hyphen; must contain fewer than 50 characters. The name of the service becomes {parent}/services/{service_id}.

Type

str

validate_only

Indicates that the request should be validated and default values populated, without persisting the request or creating any resources.

Type

bool

class google.cloud.run_v2.types.DeleteExecutionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for deleting an Execution.

name

Required. The name of the Execution to delete. Format: projects/{project}/locations/{location}/jobs/{job}/executions/{execution}, where {project} can be project id or number.

Type

str

validate_only

Indicates that the request should be validated without actually deleting any resources.

Type

bool

etag

A system-generated fingerprint for this version of the resource. This may be used to detect modification conflict during updates.

Type

str

class google.cloud.run_v2.types.DeleteJobRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message to delete a Job by its full name.

name

Required. The full name of the Job. Format: projects/{project}/locations/{location}/jobs/{job}, where {project} can be project id or number.

Type

str

validate_only

Indicates that the request should be validated without actually deleting any resources.

Type

bool

etag

A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

Type

str

class google.cloud.run_v2.types.DeleteRevisionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for deleting a retired Revision. Revision lifecycle is usually managed by making changes to the parent Service. Only retired revisions can be deleted with this API.

name

Required. The name of the Revision to delete. Format:

projects/{project}/locations/{location}/services/{service}/revisions/{revision}

Type

str

validate_only

Indicates that the request should be validated without actually deleting any resources.

Type

bool

etag

A system-generated fingerprint for this version of the resource. This may be used to detect modification conflict during updates.

Type

str

class google.cloud.run_v2.types.DeleteServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message to delete a Service by its full name.

name

Required. The full name of the Service. Format: projects/{project}/locations/{location}/services/{service}, where {project} can be project id or number.

Type

str

validate_only

Indicates that the request should be validated without actually deleting any resources.

Type

bool

etag

A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

Type

str

class google.cloud.run_v2.types.EmptyDirVolumeSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

In memory (tmpfs) ephemeral storage. It is ephemeral in the sense that when the sandbox is taken down, the data is destroyed with it (it does not persist across sandbox runs).

medium

The medium on which the data is stored. Acceptable values today is only MEMORY or none. When none, the default will currently be backed by memory but could change over time. +optional

Type

google.cloud.run_v2.types.EmptyDirVolumeSource.Medium

size_limit

Limit on the storage usable by this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers. The default is nil which means that the limit is undefined. More info:

https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. Info in Kubernetes:

https://kubernetes.io/docs/concepts/storage/volumes/#emptydir

Type

str

class Medium(value)[source]

Bases: proto.enums.Enum

The different types of medium supported for EmptyDir.

Values:
MEDIUM_UNSPECIFIED (0):

When not specified, falls back to the default implementation which is currently in memory (this may change over time).

MEMORY (1):

Explicitly set the EmptyDir to be in memory. Uses tmpfs.

class google.cloud.run_v2.types.EncryptionKeyRevocationAction(value)[source]

Bases: proto.enums.Enum

Specifies behavior if an encryption key used by a resource is revoked.

Values:
ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED (0):

Unspecified

PREVENT_NEW (1):

Prevents the creation of new instances.

SHUTDOWN (2):

Shuts down existing instances, and prevents creation of new ones.

class google.cloud.run_v2.types.EnvVar(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

EnvVar represents an environment variable present in a Container.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

name

Required. Name of the environment variable. Must not exceed 32768 characters.

Type

str

value

Literal value of the environment variable. Defaults to “”, and the maximum length is 32768 bytes. Variable references are not supported in Cloud Run.

This field is a member of oneof values.

Type

str

value_source

Source for the environment variable’s value.

This field is a member of oneof values.

Type

google.cloud.run_v2.types.EnvVarSource

class google.cloud.run_v2.types.EnvVarSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

EnvVarSource represents a source for the value of an EnvVar.

secret_key_ref

Selects a secret and a specific version from Cloud Secret Manager.

Type

google.cloud.run_v2.types.SecretKeySelector

class google.cloud.run_v2.types.Execution(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Execution represents the configuration of a single execution. A execution an immutable resource that references a container image which is run to completion.

name

Output only. The unique name of this Execution.

Type

str

uid

Output only. Server assigned unique identifier for the Execution. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

Type

str

generation

Output only. A number that monotonically increases every time the user modifies the desired state.

Type

int

labels

Output only. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google’s billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels

Type

MutableMapping[str, str]

annotations

Output only. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Type

MutableMapping[str, str]

create_time

Output only. Represents time when the execution was acknowledged by the execution controller. It is not guaranteed to be set in happens-before order across separate operations.

Type

google.protobuf.timestamp_pb2.Timestamp

start_time

Output only. Represents time when the execution started to run. It is not guaranteed to be set in happens-before order across separate operations.

Type

google.protobuf.timestamp_pb2.Timestamp

completion_time

Output only. Represents time when the execution was completed. It is not guaranteed to be set in happens-before order across separate operations.

Type

google.protobuf.timestamp_pb2.Timestamp

update_time

Output only. The last-modified time.

Type

google.protobuf.timestamp_pb2.Timestamp

delete_time

Output only. For a deleted resource, the deletion time. It is only populated as a response to a Delete request.

Type

google.protobuf.timestamp_pb2.Timestamp

expire_time

Output only. For a deleted resource, the time after which it will be permamently deleted. It is only populated as a response to a Delete request.

Type

google.protobuf.timestamp_pb2.Timestamp

launch_stage

The least stable launch stage needed to create this resource, as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA.

Note that this value might not be what was used as input. For example, if ALPHA was provided as input in the parent resource, but only BETA and GA-level features are were, this field will be BETA.

Type

google.api.launch_stage_pb2.LaunchStage

job

Output only. The name of the parent Job.

Type

str

parallelism

Output only. Specifies the maximum desired number of tasks the execution should run at any given time. Must be <= task_count. The actual number of tasks running in steady state will be less than this number when ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism.

Type

int

task_count

Output only. Specifies the desired number of tasks the execution should run. Setting to 1 means that parallelism is limited to 1 and the success of that task signals the success of the execution.

Type

int

template

Output only. The template used to create tasks for this execution.

Type

google.cloud.run_v2.types.TaskTemplate

reconciling

Output only. Indicates whether the resource’s reconciliation is still in progress. See comments in Job.reconciling for additional information on reconciliation process in Cloud Run.

Type

bool

conditions

Output only. The Condition of this Execution, containing its readiness status, and detailed error information in case it did not reach the desired state.

Type

MutableSequence[google.cloud.run_v2.types.Condition]

observed_generation

Output only. The generation of this Execution. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Type

int

running_count

Output only. The number of actively running tasks.

Type

int

succeeded_count

Output only. The number of tasks which reached phase Succeeded.

Type

int

failed_count

Output only. The number of tasks which reached phase Failed.

Type

int

cancelled_count

Output only. The number of tasks which reached phase Cancelled.

Type

int

retried_count

Output only. The number of tasks which have retried at least once.

Type

int

log_uri

Output only. URI where logs for this execution can be found in Cloud Console.

Type

str

satisfies_pzs

Output only. Reserved for future use.

Type

bool

etag

Output only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

Type

str

class AnnotationsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.run_v2.types.ExecutionEnvironment(value)[source]

Bases: proto.enums.Enum

Alternatives for execution environments.

Values:
EXECUTION_ENVIRONMENT_UNSPECIFIED (0):

Unspecified

EXECUTION_ENVIRONMENT_GEN1 (1):

Uses the First Generation environment.

EXECUTION_ENVIRONMENT_GEN2 (2):

Uses Second Generation environment.

class google.cloud.run_v2.types.ExecutionReference(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Reference to an Execution. Use /Executions.GetExecution with the given name to get full execution including the latest status.

name

Name of the execution.

Type

str

create_time

Creation timestamp of the execution.

Type

google.protobuf.timestamp_pb2.Timestamp

completion_time

Creation timestamp of the execution.

Type

google.protobuf.timestamp_pb2.Timestamp

delete_time

The deletion time of the execution. It is only populated as a response to a Delete request.

Type

google.protobuf.timestamp_pb2.Timestamp

completion_status

Status for the execution completion.

Type

google.cloud.run_v2.types.ExecutionReference.CompletionStatus

class CompletionStatus(value)[source]

Bases: proto.enums.Enum

Possible execution completion status.

Values:
COMPLETION_STATUS_UNSPECIFIED (0):

The default value. This value is used if the state is omitted.

EXECUTION_SUCCEEDED (1):

Job execution has succeeded.

EXECUTION_FAILED (2):

Job execution has failed.

EXECUTION_RUNNING (3):

Job execution is running normally.

EXECUTION_PENDING (4):

Waiting for backing resources to be provisioned.

EXECUTION_CANCELLED (5):

Job execution has been cancelled by the user.

class google.cloud.run_v2.types.ExecutionTemplate(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

ExecutionTemplate describes the data an execution should have when created from a template.

labels

Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google’s billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 ExecutionTemplate.

Type

MutableMapping[str, str]

annotations

Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected. All system annotations in v1 now have a corresponding field in v2 ExecutionTemplate.

This field follows Kubernetes annotations' namespacing, limits, and rules.

Type

MutableMapping[str, str]

parallelism

Specifies the maximum desired number of tasks the execution should run at given time. Must be <= task_count. When the job is run, if this field is 0 or unset, the maximum possible value will be used for that execution. The actual number of tasks running in steady state will be less than this number when there are fewer tasks waiting to be completed remaining, i.e. when the work left to do is less than max parallelism.

Type

int

task_count

Specifies the desired number of tasks the execution should run. Setting to 1 means that parallelism is limited to 1 and the success of that task signals the success of the execution. Defaults to 1.

Type

int

template

Required. Describes the task(s) that will be created when executing an execution.

Type

google.cloud.run_v2.types.TaskTemplate

class AnnotationsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.run_v2.types.GCSVolumeSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents a volume backed by a Cloud Storage bucket using Cloud Storage FUSE.

bucket

Cloud Storage Bucket name.

Type

str

read_only

If true, the volume will be mounted as read only for all mounts.

Type

bool

mount_options

A list of additional flags to pass to the gcsfuse CLI. Options should be specified without the leading “–“.

Type

MutableSequence[str]

class google.cloud.run_v2.types.GRPCAction(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

GRPCAction describes an action involving a GRPC port.

port

Optional. Port number of the gRPC service. Number must be in the range 1 to 65535. If not specified, defaults to the exposed port of the container, which is the value of container.ports[0].containerPort.

Type

int

service

Optional. Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this is not specified, the default behavior is defined by gRPC.

Type

str

class google.cloud.run_v2.types.GetExecutionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for obtaining a Execution by its full name.

name

Required. The full name of the Execution. Format: projects/{project}/locations/{location}/jobs/{job}/executions/{execution}, where {project} can be project id or number.

Type

str

class google.cloud.run_v2.types.GetJobRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for obtaining a Job by its full name.

name

Required. The full name of the Job. Format: projects/{project}/locations/{location}/jobs/{job}, where {project} can be project id or number.

Type

str

class google.cloud.run_v2.types.GetRevisionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for obtaining a Revision by its full name.

name

Required. The full name of the Revision. Format:

projects/{project}/locations/{location}/services/{service}/revisions/{revision}

Type

str

class google.cloud.run_v2.types.GetServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for obtaining a Service by its full name.

name

Required. The full name of the Service. Format: projects/{project}/locations/{location}/services/{service}, where {project} can be project id or number.

Type

str

class google.cloud.run_v2.types.GetTaskRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for obtaining a Task by its full name.

name

Required. The full name of the Task. Format:

projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}

Type

str

class google.cloud.run_v2.types.HTTPGetAction(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

HTTPGetAction describes an action based on HTTP Get requests.

path

Optional. Path to access on the HTTP server. Defaults to ‘/’.

Type

str

http_headers

Optional. Custom headers to set in the request. HTTP allows repeated headers.

Type

MutableSequence[google.cloud.run_v2.types.HTTPHeader]

port

Optional. Port number to access on the container. Must be in the range 1 to 65535. If not specified, defaults to the exposed port of the container, which is the value of container.ports[0].containerPort.

Type

int

class google.cloud.run_v2.types.HTTPHeader(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

HTTPHeader describes a custom header to be used in HTTP probes

name

Required. The header field name

Type

str

value

Optional. The header field value

Type

str

class google.cloud.run_v2.types.IngressTraffic(value)[source]

Bases: proto.enums.Enum

Allowed ingress traffic for the Container.

Values:
INGRESS_TRAFFIC_UNSPECIFIED (0):

Unspecified

INGRESS_TRAFFIC_ALL (1):

All inbound traffic is allowed.

INGRESS_TRAFFIC_INTERNAL_ONLY (2):

Only internal traffic is allowed.

INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER (3):

Both internal and Google Cloud Load Balancer traffic is allowed.

INGRESS_TRAFFIC_NONE (4):

No ingress traffic is allowed.

class google.cloud.run_v2.types.Job(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job represents the configuration of a single job, which references a container image that is run to completion.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

name

The fully qualified name of this Job.

Format:

projects/{project}/locations/{location}/jobs/{job}

Type

str

uid

Output only. Server assigned unique identifier for the Execution. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

Type

str

generation

Output only. A number that monotonically increases every time the user modifies the desired state.

Type

int

labels

Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google’s billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 Job.

Type

MutableMapping[str, str]

annotations

Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected on new resources. All system annotations in v1 now have a corresponding field in v2 Job.

This field follows Kubernetes annotations' namespacing, limits, and rules.

Type

MutableMapping[str, str]

create_time

Output only. The creation time.

Type

google.protobuf.timestamp_pb2.Timestamp

update_time

Output only. The last-modified time.

Type

google.protobuf.timestamp_pb2.Timestamp

delete_time

Output only. The deletion time. It is only populated as a response to a Delete request.

Type

google.protobuf.timestamp_pb2.Timestamp

expire_time

Output only. For a deleted resource, the time after which it will be permamently deleted.

Type

google.protobuf.timestamp_pb2.Timestamp

creator

Output only. Email address of the authenticated creator.

Type

str

last_modifier

Output only. Email address of the last authenticated modifier.

Type

str

client

Arbitrary identifier for the API client.

Type

str

client_version

Arbitrary version identifier for the API client.

Type

str

launch_stage

The launch stage as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA. If no value is specified, GA is assumed. Set the launch stage to a preview stage on input to allow use of preview features in that stage. On read (or output), describes whether the resource uses preview features.

For example, if ALPHA is provided as input, but only BETA and GA-level features are used, this field will be BETA on output.

Type

google.api.launch_stage_pb2.LaunchStage

binary_authorization

Settings for the Binary Authorization feature.

Type

google.cloud.run_v2.types.BinaryAuthorization

template

Required. The template used to create executions for this Job.

Type

google.cloud.run_v2.types.ExecutionTemplate

observed_generation

Output only. The generation of this Job. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Type

int

terminal_condition

Output only. The Condition of this Job, containing its readiness status, and detailed error information in case it did not reach the desired state.

Type

google.cloud.run_v2.types.Condition

conditions

Output only. The Conditions of all other associated sub-resources. They contain additional diagnostics information in case the Job does not reach its desired state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Type

MutableSequence[google.cloud.run_v2.types.Condition]

execution_count

Output only. Number of executions created for this job.

Type

int

latest_created_execution

Output only. Name of the last created execution.

Type

google.cloud.run_v2.types.ExecutionReference

reconciling

Output only. Returns true if the Job is currently being acted upon by the system to bring it into the desired state.

When a new Job is created, or an existing one is updated, Cloud Run will asynchronously perform all necessary steps to bring the Job to the desired state. This process is called reconciliation. While reconciliation is in process, observed_generation and latest_succeeded_execution, will have transient values that might mismatch the intended state: Once reconciliation is over (and this field is false), there are two possible outcomes: reconciliation succeeded and the state matches the Job, or there was an error, and reconciliation failed. This state can be found in terminal_condition.state.

If reconciliation succeeded, the following fields will match: observed_generation and generation, latest_succeeded_execution and latest_created_execution.

If reconciliation failed, observed_generation and latest_succeeded_execution will have the state of the last succeeded execution or empty for newly created Job. Additional information on the failure can be found in terminal_condition and conditions.

Type

bool

satisfies_pzs

Output only. Reserved for future use.

Type

bool

start_execution_token

A unique string used as a suffix creating a new execution. The Job will become ready when the execution is successfully started. The sum of job name and token length must be fewer than 63 characters.

This field is a member of oneof create_execution.

Type

str

run_execution_token

A unique string used as a suffix for creating a new execution. The Job will become ready when the execution is successfully completed. The sum of job name and token length must be fewer than 63 characters.

This field is a member of oneof create_execution.

Type

str

etag

Output only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

Type

str

class AnnotationsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.run_v2.types.ListExecutionsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for retrieving a list of Executions.

parent

Required. The Execution from which the Executions should be listed. To list all Executions across Jobs, use “-” instead of Job name. Format: projects/{project}/locations/{location}/jobs/{job}, where {project} can be project id or number.

Type

str

page_size

Maximum number of Executions to return in this call.

Type

int

page_token

A page token received from a previous call to ListExecutions. All other parameters must match.

Type

str

show_deleted

If true, returns deleted (but unexpired) resources along with active ones.

Type

bool

class google.cloud.run_v2.types.ListExecutionsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Response message containing a list of Executions.

executions

The resulting list of Executions.

Type

MutableSequence[google.cloud.run_v2.types.Execution]

next_page_token

A token indicating there are more items than page_size. Use it in the next ListExecutions request to continue.

Type

str

class google.cloud.run_v2.types.ListJobsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for retrieving a list of Jobs.

parent

Required. The location and project to list resources on. Format: projects/{project}/locations/{location}, where {project} can be project id or number.

Type

str

page_size

Maximum number of Jobs to return in this call.

Type

int

page_token

A page token received from a previous call to ListJobs. All other parameters must match.

Type

str

show_deleted

If true, returns deleted (but unexpired) resources along with active ones.

Type

bool

class google.cloud.run_v2.types.ListJobsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Response message containing a list of Jobs.

jobs

The resulting list of Jobs.

Type

MutableSequence[google.cloud.run_v2.types.Job]

next_page_token

A token indicating there are more items than page_size. Use it in the next ListJobs request to continue.

Type

str

class google.cloud.run_v2.types.ListRevisionsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for retrieving a list of Revisions.

parent

Required. The Service from which the Revisions should be listed. To list all Revisions across Services, use “-” instead of Service name. Format:

projects/{project}/locations/{location}/services/{service}

Type

str

page_size

Maximum number of revisions to return in this call.

Type

int

page_token

A page token received from a previous call to ListRevisions. All other parameters must match.

Type

str

show_deleted

If true, returns deleted (but unexpired) resources along with active ones.

Type

bool

class google.cloud.run_v2.types.ListRevisionsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Response message containing a list of Revisions.

revisions

The resulting list of Revisions.

Type

MutableSequence[google.cloud.run_v2.types.Revision]

next_page_token

A token indicating there are more items than page_size. Use it in the next ListRevisions request to continue.

Type

str

class google.cloud.run_v2.types.ListServicesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for retrieving a list of Services.

parent

Required. The location and project to list resources on. Location must be a valid Google Cloud region, and cannot be the “-” wildcard. Format: projects/{project}/locations/{location}, where {project} can be project id or number.

Type

str

page_size

Maximum number of Services to return in this call.

Type

int

page_token

A page token received from a previous call to ListServices. All other parameters must match.

Type

str

show_deleted

If true, returns deleted (but unexpired) resources along with active ones.

Type

bool

class google.cloud.run_v2.types.ListServicesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Response message containing a list of Services.

services

The resulting list of Services.

Type

MutableSequence[google.cloud.run_v2.types.Service]

next_page_token

A token indicating there are more items than page_size. Use it in the next ListServices request to continue.

Type

str

class google.cloud.run_v2.types.ListTasksRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for retrieving a list of Tasks.

parent

Required. The Execution from which the Tasks should be listed. To list all Tasks across Executions of a Job, use “-” instead of Execution name. To list all Tasks across Jobs, use “-” instead of Job name. Format:

projects/{project}/locations/{location}/jobs/{job}/executions/{execution}

Type

str

page_size

Maximum number of Tasks to return in this call.

Type

int

page_token

A page token received from a previous call to ListTasks. All other parameters must match.

Type

str

show_deleted

If true, returns deleted (but unexpired) resources along with active ones.

Type

bool

class google.cloud.run_v2.types.ListTasksResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Response message containing a list of Tasks.

tasks

The resulting list of Tasks.

Type

MutableSequence[google.cloud.run_v2.types.Task]

next_page_token

A token indicating there are more items than page_size. Use it in the next ListTasks request to continue.

Type

str

class google.cloud.run_v2.types.NFSVolumeSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents an NFS mount.

server

Hostname or IP address of the NFS server

Type

str

path

Path that is exported by the NFS server.

Type

str

read_only

If true, the volume will be mounted as read only for all mounts.

Type

bool

class google.cloud.run_v2.types.NodeSelector(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Hardware constraints configuration.

accelerator

Required. GPU accelerator type to attach to an instance.

Type

str

class google.cloud.run_v2.types.Probe(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

initial_delay_seconds

Optional. Number of seconds after the container has started before the probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum value for liveness probe is 3600. Maximum value for startup probe is 240.

Type

int

timeout_seconds

Optional. Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 3600. Must be smaller than period_seconds.

Type

int

period_seconds

Optional. How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe is 3600. Maximum value for startup probe is 240. Must be greater or equal than timeout_seconds.

Type

int

failure_threshold

Optional. Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.

Type

int

http_get

Optional. HTTPGet specifies the http request to perform. Exactly one of httpGet, tcpSocket, or grpc must be specified.

This field is a member of oneof probe_type.

Type

google.cloud.run_v2.types.HTTPGetAction

tcp_socket

Optional. TCPSocket specifies an action involving a TCP port. Exactly one of httpGet, tcpSocket, or grpc must be specified.

This field is a member of oneof probe_type.

Type

google.cloud.run_v2.types.TCPSocketAction

grpc

Optional. GRPC specifies an action involving a gRPC port. Exactly one of httpGet, tcpSocket, or grpc must be specified.

This field is a member of oneof probe_type.

Type

google.cloud.run_v2.types.GRPCAction

class google.cloud.run_v2.types.ResourceRequirements(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

ResourceRequirements describes the compute resource requirements.

limits

Only memory and cpu keys in the map are supported.

Notes: * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. For more information, go to https://cloud.google.com/run/docs/configuring/cpu. * For supported 'memory' values and syntax, go to https://cloud.google.com/run/docs/configuring/memory-limits

Type

MutableMapping[str, str]

cpu_idle

Determines whether CPU is only allocated during requests (true by default). However, if ResourceRequirements is set, the caller must explicitly set this field to true to preserve the default behavior.

Type

bool

startup_cpu_boost

Determines whether CPU should be boosted on startup of a new container instance above the requested CPU threshold, this can help reduce cold-start latency.

Type

bool

class LimitsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.run_v2.types.Revision(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

A Revision is an immutable snapshot of code and configuration. A Revision references a container image. Revisions are only created by updates to its parent Service.

name

Output only. The unique name of this Revision.

Type

str

uid

Output only. Server assigned unique identifier for the Revision. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

Type

str

generation

Output only. A number that monotonically increases every time the user modifies the desired state.

Type

int

labels

Output only. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google’s billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Type

MutableMapping[str, str]

annotations

Output only. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Type

MutableMapping[str, str]

create_time

Output only. The creation time.

Type

google.protobuf.timestamp_pb2.Timestamp

update_time

Output only. The last-modified time.

Type

google.protobuf.timestamp_pb2.Timestamp

delete_time

Output only. For a deleted resource, the deletion time. It is only populated as a response to a Delete request.

Type

google.protobuf.timestamp_pb2.Timestamp

expire_time

Output only. For a deleted resource, the time after which it will be permamently deleted. It is only populated as a response to a Delete request.

Type

google.protobuf.timestamp_pb2.Timestamp

launch_stage

The least stable launch stage needed to create this resource, as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA.

Note that this value might not be what was used as input. For example, if ALPHA was provided as input in the parent resource, but only BETA and GA-level features are were, this field will be BETA.

Type

google.api.launch_stage_pb2.LaunchStage

service

Output only. The name of the parent service.

Type

str

scaling

Scaling settings for this revision.

Type

google.cloud.run_v2.types.RevisionScaling

vpc_access

VPC Access configuration for this Revision. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

Type

google.cloud.run_v2.types.VpcAccess

max_instance_request_concurrency

Sets the maximum number of requests that each serving instance can receive.

Type

int

timeout

Max allowed time for an instance to respond to a request.

Type

google.protobuf.duration_pb2.Duration

service_account

Email address of the IAM service account associated with the revision of the service. The service account represents the identity of the running revision, and determines what permissions the revision has.

Type

str

containers

Holds the single container that defines the unit of execution for this Revision.

Type

MutableSequence[google.cloud.run_v2.types.Container]

volumes

A list of Volumes to make available to containers.

Type

MutableSequence[google.cloud.run_v2.types.Volume]

execution_environment

The execution environment being used to host this Revision.

Type

google.cloud.run_v2.types.ExecutionEnvironment

encryption_key

A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. For more information, go to https://cloud.google.com/run/docs/securing/using-cmek

Type

str

service_mesh

Enables service mesh connectivity.

Type

google.cloud.run_v2.types.ServiceMesh

encryption_key_revocation_action

The action to take if the encryption key is revoked.

Type

google.cloud.run_v2.types.EncryptionKeyRevocationAction

encryption_key_shutdown_duration

If encryption_key_revocation_action is SHUTDOWN, the duration before shutting down all instances. The minimum increment is 1 hour.

Type

google.protobuf.duration_pb2.Duration

reconciling

Output only. Indicates whether the resource’s reconciliation is still in progress. See comments in Service.reconciling for additional information on reconciliation process in Cloud Run.

Type

bool

conditions

Output only. The Condition of this Revision, containing its readiness status, and detailed error information in case it did not reach a serving state.

Type

MutableSequence[google.cloud.run_v2.types.Condition]

observed_generation

Output only. The generation of this Revision currently serving traffic. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Type

int

log_uri

Output only. The Google Console URI to obtain logs for the Revision.

Type

str

satisfies_pzs

Output only. Reserved for future use.

Type

bool

session_affinity

Enable session affinity.

Type

bool

scaling_status

Output only. The current effective scaling settings for the revision.

Type

google.cloud.run_v2.types.RevisionScalingStatus

node_selector

The node selector for the revision.

Type

google.cloud.run_v2.types.NodeSelector

etag

Output only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

Type

str

class AnnotationsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.run_v2.types.RevisionScaling(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Settings for revision-level scaling settings.

min_instance_count

Optional. Minimum number of serving instances that this resource should have.

Type

int

max_instance_count

Optional. Maximum number of serving instances that this resource should have. When unspecified, the field is set to the server default value of 100. For more information see https://cloud.google.com/run/docs/configuring/max-instances

Type

int

class google.cloud.run_v2.types.RevisionScalingStatus(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Effective settings for the current revision

desired_min_instance_count

The current number of min instances provisioned for this revision.

Type

int

class google.cloud.run_v2.types.RevisionTemplate(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

RevisionTemplate describes the data a revision should have when created from a template.

revision

Optional. The unique name for the revision. If this field is omitted, it will be automatically generated based on the Service name.

Type

str

labels

Optional. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google’s billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 RevisionTemplate.

Type

MutableMapping[str, str]

annotations

Optional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected. All system annotations in v1 now have a corresponding field in v2 RevisionTemplate.

This field follows Kubernetes annotations' namespacing, limits, and rules.

Type

MutableMapping[str, str]

scaling

Optional. Scaling settings for this Revision.

Type

google.cloud.run_v2.types.RevisionScaling

vpc_access

Optional. VPC Access configuration to use for this Revision. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

Type

google.cloud.run_v2.types.VpcAccess

timeout

Optional. Max allowed time for an instance to respond to a request.

Type

google.protobuf.duration_pb2.Duration

service_account

Optional. Email address of the IAM service account associated with the revision of the service. The service account represents the identity of the running revision, and determines what permissions the revision has. If not provided, the revision will use the project’s default service account.

Type

str

containers

Holds the single container that defines the unit of execution for this Revision.

Type

MutableSequence[google.cloud.run_v2.types.Container]

volumes

Optional. A list of Volumes to make available to containers.

Type

MutableSequence[google.cloud.run_v2.types.Volume]

execution_environment

Optional. The sandbox environment to host this Revision.

Type

google.cloud.run_v2.types.ExecutionEnvironment

encryption_key

A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. For more information, go to https://cloud.google.com/run/docs/securing/using-cmek

Type

str

max_instance_request_concurrency

Optional. Sets the maximum number of requests that each serving instance can receive. If not specified or 0, concurrency defaults to 80 when requested CPU >= 1 and defaults to 1 when requested CPU < 1.

Type

int

service_mesh

Optional. Enables service mesh connectivity.

Type

google.cloud.run_v2.types.ServiceMesh

encryption_key_revocation_action

Optional. The action to take if the encryption key is revoked.

Type

google.cloud.run_v2.types.EncryptionKeyRevocationAction

encryption_key_shutdown_duration

Optional. If encryption_key_revocation_action is SHUTDOWN, the duration before shutting down all instances. The minimum increment is 1 hour.

Type

google.protobuf.duration_pb2.Duration

session_affinity

Optional. Enable session affinity.

Type

bool

health_check_disabled

Optional. Disables health checking containers during deployment.

Type

bool

node_selector

Optional. The node selector for the revision template.

Type

google.cloud.run_v2.types.NodeSelector

class AnnotationsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.run_v2.types.RunJobRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message to create a new Execution of a Job.

name

Required. The full name of the Job. Format: projects/{project}/locations/{location}/jobs/{job}, where {project} can be project id or number.

Type

str

validate_only

Indicates that the request should be validated without actually deleting any resources.

Type

bool

etag

A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

Type

str

overrides

Overrides specification for a given execution of a job. If provided, overrides will be applied to update the execution or task spec.

Type

google.cloud.run_v2.types.RunJobRequest.Overrides

class Overrides(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

RunJob Overrides that contains Execution fields to be overridden.

container_overrides

Per container override specification.

Type

MutableSequence[google.cloud.run_v2.types.RunJobRequest.Overrides.ContainerOverride]

task_count

Optional. The desired number of tasks the execution should run. Will replace existing task_count value.

Type

int

timeout

Duration in seconds the task may be active before the system will actively try to mark it failed and kill associated containers. Will replace existing timeout_seconds value.

Type

google.protobuf.duration_pb2.Duration

class ContainerOverride(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Per-container override specification.

name

The name of the container specified as a DNS_LABEL.

Type

str

args

Optional. Arguments to the entrypoint. Will replace existing args for override.

Type

MutableSequence[str]

env

List of environment variables to set in the container. Will be merged with existing env for override.

Type

MutableSequence[google.cloud.run_v2.types.EnvVar]

clear_args

Optional. True if the intention is to clear out existing args list.

Type

bool

class google.cloud.run_v2.types.SecretKeySelector(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

SecretEnvVarSource represents a source for the value of an EnvVar.

secret

Required. The name of the secret in Cloud Secret Manager. Format: {secret_name} if the secret is in the same project. projects/{project}/secrets/{secret_name} if the secret is in a different project.

Type

str

version

The Cloud Secret Manager secret version. Can be ‘latest’ for the latest version, an integer for a specific version, or a version alias.

Type

str

class google.cloud.run_v2.types.SecretVolumeSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The secret’s value will be presented as the content of a file whose name is defined in the item path. If no items are defined, the name of the file is the secret.

secret

Required. The name of the secret in Cloud Secret Manager. Format: {secret} if the secret is in the same project. projects/{project}/secrets/{secret} if the secret is in a different project.

Type

str

items

If unspecified, the volume will expose a file whose name is the secret, relative to VolumeMount.mount_path. If specified, the key will be used as the version to fetch from Cloud Secret Manager and the path will be the name of the file exposed in the volume. When items are defined, they must specify a path and a version.

Type

MutableSequence[google.cloud.run_v2.types.VersionToPath]

default_mode

Integer representation of mode bits to use on created files by default. Must be a value between 0000 and 0777 (octal), defaulting to 0444. Directories within the path are not affected by this setting.

Notes

  • Internally, a umask of 0222 will be applied to any non-zero value.

  • This is an integer representation of the mode bits. So, the octal integer value should look exactly as the chmod numeric notation with a leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or 493 (base-10).

  • This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

This might be in conflict with other options that affect the file mode, like fsGroup, and as a result, other mode bits could be set.

Type

int

class google.cloud.run_v2.types.Service(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Service acts as a top-level container that manages a set of configurations and revision templates which implement a network service. Service exists to provide a singular abstraction which can be access controlled, reasoned about, and which encapsulates software lifecycle decisions such as rollout policy and team resource ownership.

name

The fully qualified name of this Service. In CreateServiceRequest, this field is ignored, and instead composed from CreateServiceRequest.parent and CreateServiceRequest.service_id.

Format: projects/{project}/locations/{location}/services/{service_id}

Type

str

description

User-provided description of the Service. This field currently has a 512-character limit.

Type

str

uid

Output only. Server assigned unique identifier for the trigger. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

Type

str

generation

Output only. A number that monotonically increases every time the user modifies the desired state. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.

Type

int

labels

Optional. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google’s billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 Service.

Type

MutableMapping[str, str]

annotations

Optional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected in new resources. All system annotations in v1 now have a corresponding field in v2 Service.

This field follows Kubernetes annotations' namespacing, limits, and rules.

Type

MutableMapping[str, str]

create_time

Output only. The creation time.

Type

google.protobuf.timestamp_pb2.Timestamp

update_time

Output only. The last-modified time.

Type

google.protobuf.timestamp_pb2.Timestamp

delete_time

Output only. The deletion time. It is only populated as a response to a Delete request.

Type

google.protobuf.timestamp_pb2.Timestamp

expire_time

Output only. For a deleted resource, the time after which it will be permamently deleted.

Type

google.protobuf.timestamp_pb2.Timestamp

creator

Output only. Email address of the authenticated creator.

Type

str

last_modifier

Output only. Email address of the last authenticated modifier.

Type

str

client

Arbitrary identifier for the API client.

Type

str

client_version

Arbitrary version identifier for the API client.

Type

str

ingress

Optional. Provides the ingress settings for this Service. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.

Type

google.cloud.run_v2.types.IngressTraffic

launch_stage

Optional. The launch stage as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA. If no value is specified, GA is assumed. Set the launch stage to a preview stage on input to allow use of preview features in that stage. On read (or output), describes whether the resource uses preview features.

For example, if ALPHA is provided as input, but only BETA and GA-level features are used, this field will be BETA on output.

Type

google.api.launch_stage_pb2.LaunchStage

binary_authorization

Optional. Settings for the Binary Authorization feature.

Type

google.cloud.run_v2.types.BinaryAuthorization

template

Required. The template used to create revisions for this Service.

Type

google.cloud.run_v2.types.RevisionTemplate

traffic

Optional. Specifies how to distribute traffic over a collection of Revisions belonging to the Service. If traffic is empty or not provided, defaults to 100% traffic to the latest Ready Revision.

Type

MutableSequence[google.cloud.run_v2.types.TrafficTarget]

scaling

Optional. Specifies service-level scaling settings

Type

google.cloud.run_v2.types.ServiceScaling

invoker_iam_disabled

Optional. Disables IAM permission check for run.routes.invoke for callers of this service. This feature is available by invitation only. For more information, visit https://cloud.google.com/run/docs/securing/managing-access#invoker_check.

Type

bool

default_uri_disabled

Optional. Disables public resolution of the default URI of this service.

Type

bool

urls

Output only. All URLs serving traffic for this Service.

Type

MutableSequence[str]

custom_audiences

One or more custom audiences that you want this service to support. Specify each custom audience as the full URL in a string. The custom audiences are encoded in the token and used to authenticate requests. For more information, see https://cloud.google.com/run/docs/configuring/custom-audiences.

Type

MutableSequence[str]

observed_generation

Output only. The generation of this Service currently serving traffic. See comments in reconciling for additional information on reconciliation process in Cloud Run. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.

Type

int

terminal_condition

Output only. The Condition of this Service, containing its readiness status, and detailed error information in case it did not reach a serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Type

google.cloud.run_v2.types.Condition

conditions

Output only. The Conditions of all other associated sub-resources. They contain additional diagnostics information in case the Service does not reach its Serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Type

MutableSequence[google.cloud.run_v2.types.Condition]

latest_ready_revision

Output only. Name of the latest revision that is serving traffic. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Type

str

latest_created_revision

Output only. Name of the last created revision. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Type

str

traffic_statuses

Output only. Detailed status information for corresponding traffic targets. See comments in reconciling for additional information on reconciliation process in Cloud Run.

Type

MutableSequence[google.cloud.run_v2.types.TrafficTargetStatus]

uri

Output only. The main URI in which this Service is serving traffic.

Type

str

satisfies_pzs

Output only. Reserved for future use.

Type

bool

reconciling

Output only. Returns true if the Service is currently being acted upon by the system to bring it into the desired state.

When a new Service is created, or an existing one is updated, Cloud Run will asynchronously perform all necessary steps to bring the Service to the desired serving state. This process is called reconciliation. While reconciliation is in process, observed_generation, latest_ready_revison, traffic_statuses, and uri will have transient values that might mismatch the intended state: Once reconciliation is over (and this field is false), there are two possible outcomes: reconciliation succeeded and the serving state matches the Service, or there was an error, and reconciliation failed. This state can be found in terminal_condition.state.

If reconciliation succeeded, the following fields will match: traffic and traffic_statuses, observed_generation and generation, latest_ready_revision and latest_created_revision.

If reconciliation failed, traffic_statuses, observed_generation, and latest_ready_revision will have the state of the last serving revision, or empty for newly created Services. Additional information on the failure can be found in terminal_condition and conditions.

Type

bool

etag

Output only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

Type

str

class AnnotationsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.run_v2.types.ServiceMesh(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Settings for Cloud Service Mesh. For more information see https://cloud.google.com/service-mesh/docs/overview.

mesh

The Mesh resource name. Format: projects/{project}/locations/global/meshes/{mesh}, where {project} can be project id or number.

Type

str

class google.cloud.run_v2.types.ServiceScaling(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Scaling settings applied at the service level rather than at the revision level.

min_instance_count

Optional. total min instances for the service. This number of instances is divided among all revisions with specified traffic based on the percent of traffic they are receiving.

Type

int

scaling_mode

Optional. The scaling mode for the service.

Type

google.cloud.run_v2.types.ServiceScaling.ScalingMode

manual_instance_count

Optional. total instance count for the service in manual scaling mode. This number of instances is divided among all revisions with specified traffic based on the percent of traffic they are receiving.

This field is a member of oneof _manual_instance_count.

Type

int

class ScalingMode(value)[source]

Bases: proto.enums.Enum

The scaling mode for the service. If not provided, it defaults to AUTOMATIC.

Values:
SCALING_MODE_UNSPECIFIED (0):

Unspecified.

AUTOMATIC (1):

Scale based on traffic between min and max instances.

MANUAL (2):

Scale to exactly min instances and ignore max instances.

class google.cloud.run_v2.types.StorageSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Location of the source in an archive file in Google Cloud Storage.

bucket

Required. Google Cloud Storage bucket containing the source (see Bucket Name Requirements).

Type

str

object_

Required. Google Cloud Storage object containing the source.

This object must be a gzipped archive file (.tar.gz) containing source to build.

Type

str

generation

Optional. Google Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used.

Type

int

class google.cloud.run_v2.types.SubmitBuildRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for submitting a Build.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

parent

Required. The project and location to build in. Location must be a region, e.g., ‘us-central1’ or ‘global’ if the global builder is to be used. Format: projects/{project}/locations/{location}

Type

str

storage_source

Required. Source for the build.

This field is a member of oneof source.

Type

google.cloud.run_v2.types.StorageSource

image_uri

Required. Artifact Registry URI to store the built image.

Type

str

buildpack_build

Build the source using Buildpacks.

This field is a member of oneof build_type.

Type

google.cloud.run_v2.types.SubmitBuildRequest.BuildpacksBuild

docker_build

Build the source using Docker. This means the source has a Dockerfile.

This field is a member of oneof build_type.

Type

google.cloud.run_v2.types.SubmitBuildRequest.DockerBuild

service_account

Optional. The service account to use for the build. If not set, the default Cloud Build service account for the project will be used.

Type

str

worker_pool

Optional. Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is projects/{project}/locations/{region}/workerPools/{workerPool} where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool.

Type

str

tags

Optional. Additional tags to annotate the build.

Type

MutableSequence[str]

class BuildpacksBuild(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Build the source using Buildpacks.

runtime

The runtime name, e.g. ‘go113’. Leave blank for generic builds.

Type

str

function_target

Optional. Name of the function target if the source is a function source. Required for function builds.

Type

str

cache_image_uri

Optional. cache_image_uri is the GCR/AR URL where the cache image will be stored. cache_image_uri is optional and omitting it will disable caching. This URL must be stable across builds. It is used to derive a build-specific temporary URL by substituting the tag with the build ID. The build will clean up the temporary image on a best-effort basis.

Type

str

base_image

Optional. The base image used to opt into automatic base image updates.

Type

str

environment_variables

Optional. User-provided build-time environment variables.

Type

MutableMapping[str, str]

enable_automatic_updates

Optional. Whether or not the application container will be enrolled in automatic base image updates. When true, the application will be built on a scratch base image, so the base layers can be appended at run time.

Type

bool

class EnvironmentVariablesEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class DockerBuild(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Build the source using Docker. This means the source has a Dockerfile.

class google.cloud.run_v2.types.SubmitBuildResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Response message for submitting a Build.

build_operation

Cloud Build operation to be polled via CloudBuild API.

Type

google.longrunning.operations_pb2.Operation

base_image_uri

URI of the base builder image in Artifact Registry being used in the build. Used to opt into automatic base image updates.

Type

str

base_image_warning

Warning message for the base image.

Type

str

class google.cloud.run_v2.types.TCPSocketAction(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

TCPSocketAction describes an action based on opening a socket

port

Optional. Port number to access on the container. Must be in the range 1 to 65535. If not specified, defaults to the exposed port of the container, which is the value of container.ports[0].containerPort.

Type

int

class google.cloud.run_v2.types.Task(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Task represents a single run of a container to completion.

name

Output only. The unique name of this Task.

Type

str

uid

Output only. Server assigned unique identifier for the Task. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

Type

str

generation

Output only. A number that monotonically increases every time the user modifies the desired state.

Type

int

labels

Output only. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google’s billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels

Type

MutableMapping[str, str]

annotations

Output only. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Type

MutableMapping[str, str]

create_time

Output only. Represents time when the task was created by the system. It is not guaranteed to be set in happens-before order across separate operations.

Type

google.protobuf.timestamp_pb2.Timestamp

scheduled_time

Output only. Represents time when the task was scheduled to run by the system. It is not guaranteed to be set in happens-before order across separate operations.

Type

google.protobuf.timestamp_pb2.Timestamp

start_time

Output only. Represents time when the task started to run. It is not guaranteed to be set in happens-before order across separate operations.

Type

google.protobuf.timestamp_pb2.Timestamp

completion_time

Output only. Represents time when the Task was completed. It is not guaranteed to be set in happens-before order across separate operations.

Type

google.protobuf.timestamp_pb2.Timestamp

update_time

Output only. The last-modified time.

Type

google.protobuf.timestamp_pb2.Timestamp

delete_time

Output only. For a deleted resource, the deletion time. It is only populated as a response to a Delete request.

Type

google.protobuf.timestamp_pb2.Timestamp

expire_time

Output only. For a deleted resource, the time after which it will be permamently deleted. It is only populated as a response to a Delete request.

Type

google.protobuf.timestamp_pb2.Timestamp

job

Output only. The name of the parent Job.

Type

str

execution

Output only. The name of the parent Execution.

Type

str

containers

Holds the single container that defines the unit of execution for this task.

Type

MutableSequence[google.cloud.run_v2.types.Container]

volumes

A list of Volumes to make available to containers.

Type

MutableSequence[google.cloud.run_v2.types.Volume]

max_retries

Number of retries allowed per Task, before marking this Task failed.

Type

int

timeout

Max allowed time duration the Task may be active before the system will actively try to mark it failed and kill associated containers. This applies per attempt of a task, meaning each retry can run for the full timeout.

Type

google.protobuf.duration_pb2.Duration

service_account

Email address of the IAM service account associated with the Task of a Job. The service account represents the identity of the running task, and determines what permissions the task has. If not provided, the task will use the project’s default service account.

Type

str

execution_environment

The execution environment being used to host this Task.

Type

google.cloud.run_v2.types.ExecutionEnvironment

reconciling

Output only. Indicates whether the resource’s reconciliation is still in progress. See comments in Job.reconciling for additional information on reconciliation process in Cloud Run.

Type

bool

conditions

Output only. The Condition of this Task, containing its readiness status, and detailed error information in case it did not reach the desired state.

Type

MutableSequence[google.cloud.run_v2.types.Condition]

observed_generation

Output only. The generation of this Task. See comments in Job.reconciling for additional information on reconciliation process in Cloud Run.

Type

int

index

Output only. Index of the Task, unique per execution, and beginning at 0.

Type

int

retried

Output only. The number of times this Task was retried. Tasks are retried when they fail up to the maxRetries limit.

Type

int

last_attempt_result

Output only. Result of the last attempt of this Task.

Type

google.cloud.run_v2.types.TaskAttemptResult

encryption_key

Output only. A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. For more information, go to https://cloud.google.com/run/docs/securing/using-cmek

Type

str

vpc_access

Output only. VPC Access configuration to use for this Task. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

Type

google.cloud.run_v2.types.VpcAccess

log_uri

Output only. URI where logs for this execution can be found in Cloud Console.

Type

str

satisfies_pzs

Output only. Reserved for future use.

Type

bool

etag

Output only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

Type

str

class AnnotationsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.run_v2.types.TaskAttemptResult(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Result of a task attempt.

status

Output only. The status of this attempt. If the status code is OK, then the attempt succeeded.

Type

google.rpc.status_pb2.Status

exit_code

Output only. The exit code of this attempt. This may be unset if the container was unable to exit cleanly with a code due to some other failure. See status field for possible failure details.

Type

int

class google.cloud.run_v2.types.TaskTemplate(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

TaskTemplate describes the data a task should have when created from a template.

containers

Holds the single container that defines the unit of execution for this task.

Type

MutableSequence[google.cloud.run_v2.types.Container]

volumes

Optional. A list of Volumes to make available to containers.

Type

MutableSequence[google.cloud.run_v2.types.Volume]

max_retries

Number of retries allowed per Task, before marking this Task failed. Defaults to 3.

This field is a member of oneof retries.

Type

int

timeout

Optional. Max allowed time duration the Task may be active before the system will actively try to mark it failed and kill associated containers. This applies per attempt of a task, meaning each retry can run for the full timeout. Defaults to 600 seconds.

Type

google.protobuf.duration_pb2.Duration

service_account

Optional. Email address of the IAM service account associated with the Task of a Job. The service account represents the identity of the running task, and determines what permissions the task has. If not provided, the task will use the project’s default service account.

Type

str

execution_environment

Optional. The execution environment being used to host this Task.

Type

google.cloud.run_v2.types.ExecutionEnvironment

encryption_key

A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. For more information, go to https://cloud.google.com/run/docs/securing/using-cmek

Type

str

vpc_access

Optional. VPC Access configuration to use for this Task. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

Type

google.cloud.run_v2.types.VpcAccess

class google.cloud.run_v2.types.TrafficTarget(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Holds a single traffic routing entry for the Service. Allocations can be done to a specific Revision name, or pointing to the latest Ready Revision.

type_

The allocation type for this traffic target.

Type

google.cloud.run_v2.types.TrafficTargetAllocationType

revision

Revision to which to send this portion of traffic, if traffic allocation is by revision.

Type

str

percent

Specifies percent of the traffic to this Revision. This defaults to zero if unspecified.

Type

int

tag

Indicates a string to be part of the URI to exclusively reference this target.

Type

str

class google.cloud.run_v2.types.TrafficTargetAllocationType(value)[source]

Bases: proto.enums.Enum

The type of instance allocation.

Values:
TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED (0):

Unspecified instance allocation type.

TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST (1):

Allocates instances to the Service’s latest ready Revision.

TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION (2):

Allocates instances to a Revision by name.

class google.cloud.run_v2.types.TrafficTargetStatus(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Represents the observed state of a single TrafficTarget entry.

type_

The allocation type for this traffic target.

Type

google.cloud.run_v2.types.TrafficTargetAllocationType

revision

Revision to which this traffic is sent.

Type

str

percent

Specifies percent of the traffic to this Revision.

Type

int

tag

Indicates the string used in the URI to exclusively reference this target.

Type

str

uri

Displays the target URI.

Type

str

class google.cloud.run_v2.types.UpdateJobRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for updating a Job.

job

Required. The Job to be updated.

Type

google.cloud.run_v2.types.Job

validate_only

Indicates that the request should be validated and default values populated, without persisting the request or updating any resources.

Type

bool

allow_missing

Optional. If set to true, and if the Job does not exist, it will create a new one. Caller must have both create and update permissions for this call if this is set to true.

Type

bool

class google.cloud.run_v2.types.UpdateServiceRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Request message for updating a service.

update_mask

Optional. The list of fields to be updated.

Type

google.protobuf.field_mask_pb2.FieldMask

service

Required. The Service to be updated.

Type

google.cloud.run_v2.types.Service

validate_only

Indicates that the request should be validated and default values populated, without persisting the request or updating any resources.

Type

bool

allow_missing

Optional. If set to true, and if the Service does not exist, it will create a new one. The caller must have ‘run.services.create’ permissions if this is set to true and the Service does not exist.

Type

bool

class google.cloud.run_v2.types.VersionToPath(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

VersionToPath maps a specific version of a secret to a relative file to mount to, relative to VolumeMount’s mount_path.

path

Required. The relative path of the secret in the container.

Type

str

version

The Cloud Secret Manager secret version. Can be ‘latest’ for the latest value, or an integer or a secret alias for a specific version.

Type

str

mode

Integer octal mode bits to use on this file, must be a value between 01 and 0777 (octal). If 0 or not set, the Volume’s default mode will be used.

Notes

  • Internally, a umask of 0222 will be applied to any non-zero value.

  • This is an integer representation of the mode bits. So, the octal integer value should look exactly as the chmod numeric notation with a leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or 493 (base-10).

  • This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

Type

int

class google.cloud.run_v2.types.Volume(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Volume represents a named volume in a container.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

name

Required. Volume’s name.

Type

str

secret

Secret represents a secret that should populate this volume.

This field is a member of oneof volume_type.

Type

google.cloud.run_v2.types.SecretVolumeSource

cloud_sql_instance

For Cloud SQL volumes, contains the specific instances that should be mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run.

This field is a member of oneof volume_type.

Type

google.cloud.run_v2.types.CloudSqlInstance

empty_dir

Ephemeral storage used as a shared volume.

This field is a member of oneof volume_type.

Type

google.cloud.run_v2.types.EmptyDirVolumeSource

nfs

For NFS Voumes, contains the path to the nfs Volume

This field is a member of oneof volume_type.

Type

google.cloud.run_v2.types.NFSVolumeSource

gcs

Persistent storage backed by a Google Cloud Storage bucket.

This field is a member of oneof volume_type.

Type

google.cloud.run_v2.types.GCSVolumeSource

class google.cloud.run_v2.types.VolumeMount(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

VolumeMount describes a mounting of a Volume within a container.

name

Required. This must match the Name of a Volume.

Type

str

mount_path

Required. Path within the container at which the volume should be mounted. Must not contain ‘:’. For Cloud SQL volumes, it can be left empty, or must otherwise be /cloudsql. All instances defined in the Volume will be available as /cloudsql/[instance]. For more information on Cloud SQL volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run

Type

str

class google.cloud.run_v2.types.VpcAccess(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

VPC Access settings. For more information on sending traffic to a VPC network, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.

connector

VPC Access connector name. Format: projects/{project}/locations/{location}/connectors/{connector}, where {project} can be project id or number. For more information on sending traffic to a VPC network via a connector, visit https://cloud.google.com/run/docs/configuring/vpc-connectors.

Type

str

egress

Optional. Traffic VPC egress settings. If not provided, it defaults to PRIVATE_RANGES_ONLY.

Type

google.cloud.run_v2.types.VpcAccess.VpcEgress

network_interfaces

Optional. Direct VPC egress settings. Currently only single network interface is supported.

Type

MutableSequence[google.cloud.run_v2.types.VpcAccess.NetworkInterface]

class NetworkInterface(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Direct VPC egress settings.

network

Optional. The VPC network that the Cloud Run resource will be able to send traffic to. At least one of network or subnetwork must be specified. If both network and subnetwork are specified, the given VPC subnetwork must belong to the given VPC network. If network is not specified, it will be looked up from the subnetwork.

Type

str

subnetwork

Optional. The VPC subnetwork that the Cloud Run resource will get IPs from. At least one of network or subnetwork must be specified. If both network and subnetwork are specified, the given VPC subnetwork must belong to the given VPC network. If subnetwork is not specified, the subnetwork with the same name with the network will be used.

Type

str

tags

Optional. Network tags applied to this Cloud Run resource.

Type

MutableSequence[str]

class VpcEgress(value)[source]

Bases: proto.enums.Enum

Egress options for VPC access.

Values:
VPC_EGRESS_UNSPECIFIED (0):

Unspecified

ALL_TRAFFIC (1):

All outbound traffic is routed through the VPC connector.

PRIVATE_RANGES_ONLY (2):

Only private IP ranges are routed through the VPC connector.