Package google.cloud.run.v2

Index

Executions

Cloud Run Execution Control Plane API.

CancelExecution

rpc CancelExecution(CancelExecutionRequest) returns (Operation)

Cancels an Execution.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteExecution

rpc DeleteExecution(DeleteExecutionRequest) returns (Operation)

Deletes an Execution.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetExecution

rpc GetExecution(GetExecutionRequest) returns (Execution)

Gets information about an Execution.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListExecutions

rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse)

Lists Executions from a Job. Results are sorted by creation time, descending.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Jobs

Cloud Run Job Control Plane API.

CreateJob

rpc CreateJob(CreateJobRequest) returns (Operation)

Creates a Job.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteJob

rpc DeleteJob(DeleteJobRequest) returns (Operation)

Deletes a Job.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetIamPolicy

rpc GetIamPolicy(GetIamPolicyRequest) returns (Policy)

Gets the IAM Access Control policy currently in effect for the given Job. This result does not include any inherited policies.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetJob

rpc GetJob(GetJobRequest) returns (Job)

Gets information about a Job.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListJobs

rpc ListJobs(ListJobsRequest) returns (ListJobsResponse)

Lists Jobs. Results are sorted by creation time, descending.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

RunJob

rpc RunJob(RunJobRequest) returns (Operation)

Triggers creation of a new Execution of this Job.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

SetIamPolicy

rpc SetIamPolicy(SetIamPolicyRequest) returns (Policy)

Sets the IAM Access control policy for the specified Job. Overwrites any existing policy.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

TestIamPermissions

rpc TestIamPermissions(TestIamPermissionsRequest) returns (TestIamPermissionsResponse)

Returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateJob

rpc UpdateJob(UpdateJobRequest) returns (Operation)

Updates a Job.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Revisions

Cloud Run Revision Control Plane API.

DeleteRevision

rpc DeleteRevision(DeleteRevisionRequest) returns (Operation)

Deletes a Revision.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetRevision

rpc GetRevision(GetRevisionRequest) returns (Revision)

Gets information about a Revision.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListRevisions

rpc ListRevisions(ListRevisionsRequest) returns (ListRevisionsResponse)

Lists Revisions from a given Service, or from a given location. Results are sorted by creation time, descending.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Services

Cloud Run Service Control Plane API

CreateService

rpc CreateService(CreateServiceRequest) returns (Operation)

Creates a new Service in a given project and location.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteService

rpc DeleteService(DeleteServiceRequest) returns (Operation)

Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetIamPolicy

rpc GetIamPolicy(GetIamPolicyRequest) returns (Policy)

Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetService

rpc GetService(GetServiceRequest) returns (Service)

Gets information about a Service.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListServices

rpc ListServices(ListServicesRequest) returns (ListServicesResponse)

Lists Services. Results are sorted by creation time, descending.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

SetIamPolicy

rpc SetIamPolicy(SetIamPolicyRequest) returns (Policy)

Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

TestIamPermissions

rpc TestIamPermissions(TestIamPermissionsRequest) returns (TestIamPermissionsResponse)

Returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateService

rpc UpdateService(UpdateServiceRequest) returns (Operation)

Updates a Service.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Tasks

Cloud Run Task Control Plane API.

GetTask

rpc GetTask(GetTaskRequest) returns (Task)

Gets information about a Task.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListTasks

rpc ListTasks(ListTasksRequest) returns (ListTasksResponse)

Lists Tasks from an Execution of a Job.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

BinaryAuthorization

Settings for Binary Authorization feature.

Fields
breakglass_justification

string

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

Union field binauthz_method.

binauthz_method can be only one of the following:

use_default

bool

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

policy

string

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

CancelExecutionRequest

Request message for deleting an Execution.

Fields
name

string

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.

Authorization requires the following IAM permission on the specified resource name:

  • run.jobs.run
validate_only

bool

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

etag

string

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

CloudSqlInstance

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.

Fields
instances[]

string

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}

Condition

Defines a status condition for a resource.

Fields
type

string

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.

state

State

State of the condition.

message

string

Human readable message indicating details about the current status.

last_transition_time

Timestamp

Last time the condition transitioned from one status to another.

severity

Severity

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

Union field reasons. The reason for this condition. Depending on the condition type, it will populate one of these fields. Successful conditions cannot have a reason. reasons can be only one of the following:
reason

CommonReason

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

revision_reason

RevisionReason

Output only. A reason for the revision condition.

execution_reason

ExecutionReason

Output only. A reason for the execution condition.

CommonReason

Reasons common to all types of conditions.

Enums
COMMON_REASON_UNDEFINED Default value.
UNKNOWN Reason unknown. Further details will be in message.
REVISION_FAILED Revision creation process failed.
PROGRESS_DEADLINE_EXCEEDED Timed out waiting for completion.
CONTAINER_MISSING The container image path is incorrect.
CONTAINER_PERMISSION_DENIED Insufficient permissions on the container image.
CONTAINER_IMAGE_UNAUTHORIZED Container image is not authorized by policy.
CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED Container image policy authorization check failed.
ENCRYPTION_KEY_PERMISSION_DENIED Insufficient permissions on encryption key.
ENCRYPTION_KEY_CHECK_FAILED Permission check on encryption key failed.
SECRETS_ACCESS_CHECK_FAILED At least one Access check on secrets failed.
WAITING_FOR_OPERATION Waiting for operation to complete.
IMMEDIATE_RETRY System will retry immediately.
POSTPONED_RETRY System will retry later; current attempt failed.
INTERNAL An internal error occurred. Further information may be in the message.

ExecutionReason

Reasons specific to Execution resource.

Enums
EXECUTION_REASON_UNDEFINED Default value.
JOB_STATUS_SERVICE_POLLING_ERROR Internal system error getting execution status. System will retry.
NON_ZERO_EXIT_CODE A task reached its retry limit and the last attempt failed due to the user container exiting with a non-zero exit code.
CANCELLED The execution was cancelled by users.
CANCELLING The execution is in the process of being cancelled.
DELETED The execution was deleted.

RevisionReason

Reasons specific to Revision resource.

Enums
REVISION_REASON_UNDEFINED Default value.
PENDING Revision in Pending state.
RESERVE Revision is in Reserve state.
RETIRED Revision is Retired.
RETIRING Revision is being retired.
RECREATING Revision is being recreated.
HEALTH_CHECK_CONTAINER_ERROR There was a health check error.
CUSTOMIZED_PATH_RESPONSE_PENDING Health check failed due to user error from customized path of the container. System will retry.
MIN_INSTANCES_NOT_PROVISIONED 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 The maximum allowed number of active revisions has been reached.
NO_DEPLOYMENT 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 A revision's container has no port specified since the revision is of a manually scaled service with 0 instance count
MIN_INSTANCES_WARMING A revision with min_instance_count > 0 was created and is waiting for enough instances to begin a traffic migration.

Severity

Represents the severity of the condition failures.

Enums
SEVERITY_UNSPECIFIED Unspecified severity
ERROR Error severity.
WARNING Warning severity.
INFO Info severity.

State

Represents the possible Condition states.

Enums
STATE_UNSPECIFIED The default value. This value is used if the state is omitted.
CONDITION_PENDING Transient state: Reconciliation has not started yet.
CONDITION_RECONCILING Transient state: reconciliation is still in progress.
CONDITION_FAILED Terminal state: Reconciliation did not succeed.
CONDITION_SUCCEEDED Terminal state: Reconciliation completed successfully.

Container

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.

Fields
name

string

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

image

string

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

command[]

string

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

args[]

string

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

env[]

EnvVar

List of environment variables to set in the container.

resources

ResourceRequirements

Compute Resource requirements by this container.

ports[]

ContainerPort

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.

volume_mounts[]

VolumeMount

Volume to mount into the container's filesystem.

working_dir

string

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

liveness_probe

Probe

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

startup_probe

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.

depends_on[]

string

Names of the containers that must start before this container.

ContainerPort

ContainerPort represents a network port in a single container.

Fields
name

string

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

container_port

int32

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

CreateJobRequest

Request message for creating a Job.

Fields
parent

string

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.

Authorization requires the following IAM permission on the specified resource parent:

  • run.jobs.create
job

Job

Required. The Job instance to create.

job_id

string

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

validate_only

bool

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

CreateServiceRequest

Request message for creating a Service.

Fields
parent

string

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.

Authorization requires the following IAM permission on the specified resource parent:

  • run.services.create
service

Service

Required. The Service instance to create.

service_id

string

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}.

validate_only

bool

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

DeleteExecutionRequest

Request message for deleting an Execution.

Fields
name

string

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.

Authorization requires the following IAM permission on the specified resource name:

  • run.executions.delete
validate_only

bool

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

etag

string

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

DeleteJobRequest

Request message to delete a Job by its full name.

Fields
name

string

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

validate_only

bool

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

etag

string

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

DeleteRevisionRequest

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.

Fields
name

string

Required. The name of the Revision to delete. Format: projects/{project}/locations/{location}/services/{service}/revisions/{revision}

Authorization requires the following IAM permission on the specified resource name:

  • run.revisions.delete
validate_only

bool

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

etag

string

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

DeleteServiceRequest

Request message to delete a Service by its full name.

Fields
name

string

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

validate_only

bool

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

etag

string

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

EmptyDirVolumeSource

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).

Fields
medium

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

size_limit

string

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

Medium

The different types of medium supported for EmptyDir.

Enums
MEDIUM_UNSPECIFIED When not specified, falls back to the default implementation which is currently in memory (this may change over time).
MEMORY Explicitly set the EmptyDir to be in memory. Uses tmpfs.

EncryptionKeyRevocationAction

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

Enums
ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED Unspecified
PREVENT_NEW Prevents the creation of new instances.
SHUTDOWN Shuts down existing instances, and prevents creation of new ones.

EnvVar

EnvVar represents an environment variable present in a Container.

Fields
name

string

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

Union field values.

values can be only one of the following:

value

string

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

value_source

EnvVarSource

Source for the environment variable's value.

EnvVarSource

EnvVarSource represents a source for the value of an EnvVar.

Fields
secret_key_ref

SecretKeySelector

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

Execution

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

Fields
name

string

Output only. The unique name of this Execution.

uid

string

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.

generation

int64

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

labels

map<string, string>

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

annotations

map<string, string>

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.

create_time

Timestamp

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.

start_time

Timestamp

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

completion_time

Timestamp

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

update_time

Timestamp

Output only. The last-modified time.

delete_time

Timestamp

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

expire_time

Timestamp

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.

launch_stage

LaunchStage

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.

job

string

Output only. The name of the parent Job.

parallelism

int32

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.

task_count

int32

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.

template

TaskTemplate

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

reconciling

bool

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.

conditions[]

Condition

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

observed_generation

int64

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

running_count

int32

Output only. The number of actively running tasks.

succeeded_count

int32

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

failed_count

int32

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

cancelled_count

int32

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

retried_count

int32

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

log_uri

string

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

satisfies_pzs

bool

Output only. Reserved for future use.

etag

string

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

ExecutionEnvironment

Alternatives for execution environments.

Enums
EXECUTION_ENVIRONMENT_UNSPECIFIED Unspecified
EXECUTION_ENVIRONMENT_GEN1 Uses the First Generation environment.
EXECUTION_ENVIRONMENT_GEN2 Uses Second Generation environment.

ExecutionReference

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

Fields
name

string

Name of the execution.

create_time

Timestamp

Creation timestamp of the execution.

completion_time

Timestamp

Creation timestamp of the execution.

delete_time

Timestamp

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

completion_status

CompletionStatus

Status for the execution completion.

CompletionStatus

Possible execution completion status.

Enums
COMPLETION_STATUS_UNSPECIFIED The default value. This value is used if the state is omitted.
EXECUTION_SUCCEEDED Job execution has succeeded.
EXECUTION_FAILED Job execution has failed.
EXECUTION_RUNNING Job execution is running normally.
EXECUTION_PENDING Waiting for backing resources to be provisioned.
EXECUTION_CANCELLED Job execution has been cancelled by the user.

ExecutionTemplate

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

Fields
labels

map<string, string>

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.

annotations

map<string, string>

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.

parallelism

int32

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.

task_count

int32

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.

template

TaskTemplate

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

GCSVolumeSource

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

Fields
bucket

string

Cloud Storage Bucket name.

read_only

bool

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

GRPCAction

GRPCAction describes an action involving a GRPC port.

Fields
port

int32

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.

service

string

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.

GetExecutionRequest

Request message for obtaining a Execution by its full name.

Fields
name

string

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

Authorization requires the following IAM permission on the specified resource name:

  • run.executions.get

GetJobRequest

Request message for obtaining a Job by its full name.

Fields
name

string

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

GetRevisionRequest

Request message for obtaining a Revision by its full name.

Fields
name

string

Required. The full name of the Revision. Format: projects/{project}/locations/{location}/services/{service}/revisions/{revision}

GetServiceRequest

Request message for obtaining a Service by its full name.

Fields
name

string

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

GetTaskRequest

Request message for obtaining a Task by its full name.

Fields
name

string

Required. The full name of the Task. Format: projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}

Authorization requires the following IAM permission on the specified resource name:

  • run.tasks.get

HTTPGetAction

HTTPGetAction describes an action based on HTTP Get requests.

Fields
path

string

Optional. Path to access on the HTTP server. Defaults to '/'.

http_headers[]

HTTPHeader

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

port

int32

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.

HTTPHeader

HTTPHeader describes a custom header to be used in HTTP probes

Fields
name

string

Required. The header field name

value

string

Optional. The header field value

IngressTraffic

Allowed ingress traffic for the Container.

Enums
INGRESS_TRAFFIC_UNSPECIFIED Unspecified
INGRESS_TRAFFIC_ALL All inbound traffic is allowed.
INGRESS_TRAFFIC_INTERNAL_ONLY Only internal traffic is allowed.
INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER Both internal and Google Cloud Load Balancer traffic is allowed.
INGRESS_TRAFFIC_NONE No ingress traffic is allowed.

Job

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

Fields
name

string

The fully qualified name of this Job.

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

uid

string

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.

generation

int64

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

labels

map<string, string>

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.

annotations

map<string, string>

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.

create_time

Timestamp

Output only. The creation time.

update_time

Timestamp

Output only. The last-modified time.

delete_time

Timestamp

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

expire_time

Timestamp

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

creator

string

Output only. Email address of the authenticated creator.

last_modifier

string

Output only. Email address of the last authenticated modifier.

client

string

Arbitrary identifier for the API client.

client_version

string

Arbitrary version identifier for the API client.

launch_stage

LaunchStage

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.

binary_authorization

BinaryAuthorization

Settings for the Binary Authorization feature.

template

ExecutionTemplate

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

observed_generation

int64

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

terminal_condition

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.

conditions[]

Condition

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.

execution_count

int32

Output only. Number of executions created for this job.

latest_created_execution

ExecutionReference

Output only. Name of the last created execution.

reconciling

bool

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.

satisfies_pzs

bool

Output only. Reserved for future use.

etag

string

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

Union field create_execution.

create_execution can be only one of the following:

start_execution_token

string

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.

run_execution_token

string

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.

ListExecutionsRequest

Request message for retrieving a list of Executions.

Fields
parent

string

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.

Authorization requires the following IAM permission on the specified resource parent:

  • run.executions.list
page_size

int32

Maximum number of Executions to return in this call.

page_token

string

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

show_deleted

bool

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

ListExecutionsResponse

Response message containing a list of Executions.

Fields
executions[]

Execution

The resulting list of Executions.

next_page_token

string

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

ListJobsRequest

Request message for retrieving a list of Jobs.

Fields
parent

string

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

Authorization requires the following IAM permission on the specified resource parent:

  • run.jobs.list
page_size

int32

Maximum number of Jobs to return in this call.

page_token

string

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

show_deleted

bool

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

ListJobsResponse

Response message containing a list of Jobs.

Fields
jobs[]

Job

The resulting list of Jobs.

next_page_token

string

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

ListRevisionsRequest

Request message for retrieving a list of Revisions.

Fields
parent

string

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}

Authorization requires the following IAM permission on the specified resource parent:

  • run.revisions.list
page_size

int32

Maximum number of revisions to return in this call.

page_token

string

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

show_deleted

bool

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

ListRevisionsResponse

Response message containing a list of Revisions.

Fields
revisions[]

Revision

The resulting list of Revisions.

next_page_token

string

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

ListServicesRequest

Request message for retrieving a list of Services.

Fields
parent

string

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.

Authorization requires the following IAM permission on the specified resource parent:

  • run.services.list
page_size

int32

Maximum number of Services to return in this call.

page_token

string

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

show_deleted

bool

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

ListServicesResponse

Response message containing a list of Services.

Fields
services[]

Service

The resulting list of Services.

next_page_token

string

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

ListTasksRequest

Request message for retrieving a list of Tasks.

Fields
parent

string

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}

Authorization requires the following IAM permission on the specified resource parent:

  • run.tasks.list
page_size

int32

Maximum number of Tasks to return in this call.

page_token

string

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

show_deleted

bool

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

ListTasksResponse

Response message containing a list of Tasks.

Fields
tasks[]

Task

The resulting list of Tasks.

next_page_token

string

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

NFSVolumeSource

Represents an NFS mount.

Fields
server

string

Hostname or IP address of the NFS server

path

string

Path that is exported by the NFS server.

read_only

bool

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

NodeSelector

Hardware constraints configuration.

Fields
accelerator

string

Required. GPU accelerator type to attach to an instance.

Probe

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

Fields
initial_delay_seconds

int32

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.

timeout_seconds

int32

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.

period_seconds

int32

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.

failure_threshold

int32

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

Union field probe_type.

probe_type can be only one of the following:

http_get

HTTPGetAction

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

tcp_socket

TCPSocketAction

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

grpc

GRPCAction

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

ResourceRequirements

ResourceRequirements describes the compute resource requirements.

Fields
limits

map<string, string>

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

cpu_idle

bool

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.

startup_cpu_boost

bool

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.

Revision

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.

Fields
name

string

Output only. The unique name of this Revision.

uid

string

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.

generation

int64

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

labels

map<string, string>

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.

annotations

map<string, string>

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.

create_time

Timestamp

Output only. The creation time.

update_time

Timestamp

Output only. The last-modified time.

delete_time

Timestamp

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

expire_time

Timestamp

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.

launch_stage

LaunchStage

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.

service

string

Output only. The name of the parent service.

scaling

RevisionScaling

Scaling settings for this revision.

vpc_access

VpcAccess

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

max_instance_request_concurrency

int32

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

timeout

Duration

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

service_account

string

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.

containers[]

Container

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

volumes[]

Volume

A list of Volumes to make available to containers.

execution_environment

ExecutionEnvironment

The execution environment being used to host this Revision.

encryption_key

string

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

service_mesh

ServiceMesh

Enables service mesh connectivity.

encryption_key_revocation_action

EncryptionKeyRevocationAction

The action to take if the encryption key is revoked.

encryption_key_shutdown_duration

Duration

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

reconciling

bool

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.

conditions[]

Condition

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

observed_generation

int64

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

log_uri

string

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

satisfies_pzs

bool

Output only. Reserved for future use.

session_affinity

bool

Enable session affinity.

scaling_status

RevisionScalingStatus

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

node_selector

NodeSelector

The node selector for the revision.

etag

string

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

RevisionScaling

Settings for revision-level scaling settings.

Fields
min_instance_count

int32

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

max_instance_count

int32

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

RevisionScalingStatus

Effective settings for the current revision

Fields
desired_min_instance_count

int32

The current number of min instances provisioned for this revision.

RevisionTemplate

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

Fields
revision

string

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

labels

map<string, string>

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.

annotations

map<string, string>

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.

scaling

RevisionScaling

Optional. Scaling settings for this Revision.

vpc_access

VpcAccess

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

timeout

Duration

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

service_account

string

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.

containers[]

Container

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

volumes[]

Volume

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

execution_environment

ExecutionEnvironment

Optional. The sandbox environment to host this Revision.

encryption_key

string

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

max_instance_request_concurrency

int32

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

service_mesh

ServiceMesh

Optional. Enables service mesh connectivity.

session_affinity

bool

Optional. Enable session affinity.

health_check_disabled

bool

Optional. Disables health checking containers during deployment.

node_selector

NodeSelector

Optional. The node selector for the revision template.

RunJobRequest

Request message to create a new Execution of a Job.

Fields
name

string

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

validate_only

bool

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

etag

string

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

overrides

Overrides

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

Authorization requires the following IAM permission on the specified resource overrides:

  • run.jobs.runWithOverrides

Overrides

RunJob Overrides that contains Execution fields to be overridden.

Fields
container_overrides[]

ContainerOverride

Per container override specification.

task_count

int32

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

timeout

Duration

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.

ContainerOverride

Per-container override specification.

Fields
name

string

The name of the container specified as a DNS_LABEL.

args[]

string

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

env[]

EnvVar

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

clear_args

bool

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

SecretKeySelector

SecretEnvVarSource represents a source for the value of an EnvVar.

Fields
secret

string

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.

version

string

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

SecretVolumeSource

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.

Fields
secret

string

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.

items[]

VersionToPath

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.

default_mode

int32

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 777 (a=rwx), set to 0777 (octal) or 511 (base-10). 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.

Service

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.

Fields
name

string

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}

description

string

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

uid

string

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.

generation

int64

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.

labels

map<string, string>

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.

annotations

map<string, string>

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.

create_time

Timestamp

Output only. The creation time.

update_time

Timestamp

Output only. The last-modified time.

delete_time

Timestamp

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

expire_time

Timestamp

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

creator

string

Output only. Email address of the authenticated creator.

last_modifier

string

Output only. Email address of the last authenticated modifier.

client

string

Arbitrary identifier for the API client.

client_version

string

Arbitrary version identifier for the API client.

ingress

IngressTraffic

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.

launch_stage

LaunchStage

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.

binary_authorization

BinaryAuthorization

Optional. Settings for the Binary Authorization feature.

template

RevisionTemplate

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

traffic[]

TrafficTarget

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.

scaling

ServiceScaling

Optional. Specifies service-level scaling settings

default_uri_disabled

bool

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

urls[]

string

Output only. All URLs serving traffic for this Service.

custom_audiences[]

string

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.

observed_generation

int64

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.

terminal_condition

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.

conditions[]

Condition

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.

latest_ready_revision

string

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

latest_created_revision

string

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

traffic_statuses[]

TrafficTargetStatus

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

uri

string

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

satisfies_pzs

bool

Output only. Reserved for future use.

reconciling

bool

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.

etag

string

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

ServiceMesh

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

Fields
mesh

string

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

ServiceScaling

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

Fields
min_instance_count

int32

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. (BETA)

TCPSocketAction

TCPSocketAction describes an action based on opening a socket

Fields
port

int32

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.

Task

Task represents a single run of a container to completion.

Fields
name

string

Output only. The unique name of this Task.

uid

string

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.

generation

int64

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

labels

map<string, string>

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

annotations

map<string, string>

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.

create_time

Timestamp

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.

scheduled_time

Timestamp

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.

start_time

Timestamp

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

completion_time

Timestamp

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

update_time

Timestamp

Output only. The last-modified time.

delete_time

Timestamp

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

expire_time

Timestamp

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.

job

string

Output only. The name of the parent Job.

execution

string

Output only. The name of the parent Execution.

containers[]

Container

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

volumes[]

Volume

A list of Volumes to make available to containers.

max_retries

int32

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

timeout

Duration

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.

service_account

string

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.

execution_environment

ExecutionEnvironment

The execution environment being used to host this Task.

reconciling

bool

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.

conditions[]

Condition

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

observed_generation

int64

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

index

int32

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

retried

int32

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

last_attempt_result

TaskAttemptResult

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

encryption_key

string

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

vpc_access

VpcAccess

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

log_uri

string

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

satisfies_pzs

bool

Output only. Reserved for future use.

etag

string

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

TaskAttemptResult

Result of a task attempt.

Fields
status

Status

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

exit_code

int32

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.

TaskTemplate

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

Fields
containers[]

Container

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

volumes[]

Volume

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

timeout

Duration

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.

service_account

string

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.

execution_environment

ExecutionEnvironment

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

encryption_key

string

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

vpc_access

VpcAccess

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

Union field retries.

retries can be only one of the following:

max_retries

int32

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

TrafficTarget

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.

Fields
type

TrafficTargetAllocationType

The allocation type for this traffic target.

revision

string

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

percent

int32

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

tag

string

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

TrafficTargetAllocationType

The type of instance allocation.

Enums
TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED Unspecified instance allocation type.
TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST Allocates instances to the Service's latest ready Revision.
TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION Allocates instances to a Revision by name.

TrafficTargetStatus

Represents the observed state of a single TrafficTarget entry.

Fields
type

TrafficTargetAllocationType

The allocation type for this traffic target.

revision

string

Revision to which this traffic is sent.

percent

int32

Specifies percent of the traffic to this Revision.

tag

string

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

uri

string

Displays the target URI.

UpdateJobRequest

Request message for updating a Job.

Fields
job

Job

Required. The Job to be updated.

validate_only

bool

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

allow_missing

bool

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.

UpdateServiceRequest

Request message for updating a service.

Fields
update_mask

FieldMask

Optional. The list of fields to be updated.

service

Service

Required. The Service to be updated.

validate_only

bool

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

allow_missing

bool

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.

VersionToPath

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

Fields
path

string

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

version

string

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

mode

int32

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 777 (a=rwx), set to 0777 (octal) or 511 (base-10). 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.

Volume

Volume represents a named volume in a container.

Fields
name

string

Required. Volume's name.

Union field volume_type.

volume_type can be only one of the following:

secret

SecretVolumeSource

Secret represents a secret that should populate this volume.

cloud_sql_instance

CloudSqlInstance

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.

empty_dir

EmptyDirVolumeSource

Ephemeral storage used as a shared volume.

nfs

NFSVolumeSource

For NFS Voumes, contains the path to the nfs Volume

gcs

GCSVolumeSource

Persistent storage backed by a Google Cloud Storage bucket.

VolumeMount

VolumeMount describes a mounting of a Volume within a container.

Fields
name

string

Required. This must match the Name of a Volume.

mount_path

string

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

VpcAccess

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

Fields
connector

string

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.

egress

VpcEgress

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

network_interfaces[]

NetworkInterface

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

NetworkInterface

Direct VPC egress settings.

Fields
network

string

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.

subnetwork

string

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.

tags[]

string

Optional. Network tags applied to this Cloud Run resource.

VpcEgress

Egress options for VPC access.

Enums
VPC_EGRESS_UNSPECIFIED Unspecified
ALL_TRAFFIC All outbound traffic is routed through the VPC connector.
PRIVATE_RANGES_ONLY Only private IP ranges are routed through the VPC connector.