Google Cloud Run V2 Client - Class TaskTemplate (1.5.0)

Reference documentation and code samples for the Google Cloud Run V2 Client class TaskTemplate.

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

Generated from protobuf message google.cloud.run.v2.TaskTemplate

Namespace

Google \ Cloud \ Run \ V2

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ containers array<Container>

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

↳ volumes array<Volume>

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

↳ max_retries int

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

↳ timeout Google\Protobuf\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 int

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.

getContainers

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

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setContainers

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

Parameter
Name Description
var array<Container>
Returns
Type Description
$this

getVolumes

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

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setVolumes

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

Parameter
Name Description
var array<Volume>
Returns
Type Description
$this

getMaxRetries

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

Defaults to 3.

Returns
Type Description
int

hasMaxRetries

setMaxRetries

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

Defaults to 3.

Parameter
Name Description
var int
Returns
Type Description
$this

getTimeout

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.

Returns
Type Description
Google\Protobuf\Duration|null

hasTimeout

clearTimeout

setTimeout

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.

Parameter
Name Description
var Google\Protobuf\Duration
Returns
Type Description
$this

getServiceAccount

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.

Returns
Type Description
string

setServiceAccount

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.

Parameter
Name Description
var string
Returns
Type Description
$this

getExecutionEnvironment

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

Returns
Type Description
int

setExecutionEnvironment

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

Parameter
Name Description
var int
Returns
Type Description
$this

getEncryptionKey

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

Returns
Type Description
string

setEncryptionKey

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

Parameter
Name Description
var string
Returns
Type Description
$this

getVpcAccess

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

Returns
Type Description
VpcAccess|null

hasVpcAccess

clearVpcAccess

setVpcAccess

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

Parameter
Name Description
var VpcAccess
Returns
Type Description
$this

getRetries

Returns
Type Description
string