Google Cloud Run V2 Client - Class Task (0.3.4)

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

Task represents a single run of a container to completion.

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

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ 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 int|string

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

↳ labels array|Google\Protobuf\Internal\MapField

KRM-style labels for the resource. 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 array|Google\Protobuf\Internal\MapField

KRM-style annotations for the resource.

↳ create_time Google\Protobuf\Timestamp

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

↳ start_time Google\Protobuf\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 Google\Protobuf\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 Google\Protobuf\Timestamp

Output only. The last-modified time.

↳ delete_time Google\Protobuf\Timestamp

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

↳ expire_time Google\Protobuf\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 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.

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

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

↳ 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 array<Google\Cloud\Run\V2\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 int|string

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

↳ index int

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

↳ retried int

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

↳ last_attempt_result Google\Cloud\Run\V2\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 Google\Cloud\Run\V2\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.

↳ etag string

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

getName

Output only. The unique name of this Task.

Returns
TypeDescription
string

setName

Output only. The unique name of this Task.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getUid

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.

Returns
TypeDescription
string

setUid

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.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getGeneration

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

Returns
TypeDescription
int|string

setGeneration

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

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getLabels

KRM-style labels for the resource.

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

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setLabels

KRM-style labels for the resource.

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

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getAnnotations

KRM-style annotations for the resource.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setAnnotations

KRM-style annotations for the resource.

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getCreateTime

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

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

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

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getStartTime

Output only. Represents time when the task started to run.

It is not guaranteed to be set in happens-before order across separate operations.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasStartTime

clearStartTime

setStartTime

Output only. Represents time when the task started to run.

It is not guaranteed to be set in happens-before order across separate operations.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getCompletionTime

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

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasCompletionTime

clearCompletionTime

setCompletionTime

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

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getUpdateTime

Output only. The last-modified time.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

Output only. The last-modified time.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getDeleteTime

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

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasDeleteTime

clearDeleteTime

setDeleteTime

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

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getExpireTime

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.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasExpireTime

clearExpireTime

setExpireTime

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.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getJob

Output only. The name of the parent Job.

Returns
TypeDescription
string

setJob

Output only. The name of the parent Job.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getExecution

Output only. The name of the parent Execution.

Returns
TypeDescription
string

setExecution

Output only. The name of the parent Execution.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

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.

Returns
TypeDescription
int

setMaxRetries

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

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.

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.

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

getReconciling

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.

Returns
TypeDescription
bool

setReconciling

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.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getConditions

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

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setConditions

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

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

getObservedGeneration

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

Returns
TypeDescription
int|string

setObservedGeneration

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

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getIndex

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

Returns
TypeDescription
int

setIndex

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

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getRetried

Output only. The number of times this Task was retried.

Tasks are retried when they fail up to the maxRetries limit.

Returns
TypeDescription
int

setRetried

Output only. The number of times this Task was retried.

Tasks are retried when they fail up to the maxRetries limit.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getLastAttemptResult

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

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

hasLastAttemptResult

clearLastAttemptResult

setLastAttemptResult

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

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

getEncryptionKey

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

Returns
TypeDescription
string

setEncryptionKey

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getVpcAccess

Output only. 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

Output only. 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

getLogUri

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

Returns
TypeDescription
string

setLogUri

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getEtag

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

Returns
TypeDescription
string

setEtag

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this