Google Cloud Run V2 Client - Class TaskTemplate (0.5.2)

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
NameDescription
data array

Optional. Data for populating the Message object.

↳ containers array<Google\Cloud\Run\V2\Container>

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

↳ volumes array<Google\Cloud\Run\V2\Volume>

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

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

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

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 Google\Cloud\Run\V2\VpcAccess

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
TypeDescription
Google\Protobuf\Internal\RepeatedField

setContainers

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

Parameter
NameDescription
var array<Google\Cloud\Run\V2\Container>
Returns
TypeDescription
$this

getVolumes

A list of Volumes to make available to containers.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setVolumes

A list of Volumes to make available to containers.

Parameter
NameDescription
var array<Google\Cloud\Run\V2\Volume>
Returns
TypeDescription
$this

getMaxRetries

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

Defaults to 3.

Returns
TypeDescription
int

hasMaxRetries

setMaxRetries

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

Defaults to 3.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getTimeout

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
TypeDescription
Google\Protobuf\Duration|null

hasTimeout

clearTimeout

setTimeout

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
NameDescription
var Google\Protobuf\Duration
Returns
TypeDescription
$this

getServiceAccount

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
TypeDescription
string

setServiceAccount

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
NameDescription
var string
Returns
TypeDescription
$this

getExecutionEnvironment

The execution environment being used to host this Task.

Returns
TypeDescription
int

setExecutionEnvironment

The execution environment being used to host this Task.

Parameter
NameDescription
var int
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getVpcAccess

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

Returns
TypeDescription
Google\Cloud\Run\V2\VpcAccess|null

hasVpcAccess

clearVpcAccess

setVpcAccess

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

Parameter
NameDescription
var Google\Cloud\Run\V2\VpcAccess
Returns
TypeDescription
$this

getRetries

Returns
TypeDescription
string