#[non_exhaustive]pub struct TaskTemplate {
pub containers: Vec<Container>,
pub volumes: Vec<Volume>,
pub timeout: Option<Duration>,
pub service_account: String,
pub execution_environment: ExecutionEnvironment,
pub encryption_key: String,
pub vpc_access: Option<VpcAccess>,
pub retries: Option<Retries>,
/* private fields */
}Expand description
TaskTemplate describes the data a task should have when created from a template.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.containers: Vec<Container>Holds the single container that defines the unit of execution for this task.
volumes: Vec<Volume>Optional. A list of Volumes to make available to containers.
timeout: Option<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: StringOptional. 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: ExecutionEnvironmentOptional. The execution environment being used to host this Task.
encryption_key: StringA 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: Option<VpcAccess>Optional. VPC Access configuration to use for this Task. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
retries: Option<Retries>Implementations§
Source§impl TaskTemplate
impl TaskTemplate
pub fn new() -> Self
Sourcepub fn set_service_account<T: Into<String>>(self, v: T) -> Self
pub fn set_service_account<T: Into<String>>(self, v: T) -> Self
Sets the value of service_account.
Sourcepub fn set_execution_environment<T: Into<ExecutionEnvironment>>(
self,
v: T,
) -> Self
pub fn set_execution_environment<T: Into<ExecutionEnvironment>>( self, v: T, ) -> Self
Sets the value of execution_environment.
Sourcepub fn set_encryption_key<T: Into<String>>(self, v: T) -> Self
pub fn set_encryption_key<T: Into<String>>(self, v: T) -> Self
Sets the value of encryption_key.
Sourcepub fn set_vpc_access<T: Into<Option<VpcAccess>>>(self, v: T) -> Self
pub fn set_vpc_access<T: Into<Option<VpcAccess>>>(self, v: T) -> Self
Sets the value of vpc_access.
Sourcepub fn set_containers<T, V>(self, v: T) -> Self
pub fn set_containers<T, V>(self, v: T) -> Self
Sets the value of containers.
Sourcepub fn set_volumes<T, V>(self, v: T) -> Self
pub fn set_volumes<T, V>(self, v: T) -> Self
Sets the value of volumes.
Sourcepub fn set_retries<T: Into<Option<Retries>>>(self, v: T) -> Self
pub fn set_retries<T: Into<Option<Retries>>>(self, v: T) -> Self
Sets the value of retries.
Note that all the setters affecting retries are mutually
exclusive.
Sourcepub fn max_retries(&self) -> Option<&i32>
pub fn max_retries(&self) -> Option<&i32>
The value of retries
if it holds a MaxRetries, None if the field is not set or
holds a different branch.
Sourcepub fn set_max_retries<T: Into<i32>>(self, v: T) -> Self
pub fn set_max_retries<T: Into<i32>>(self, v: T) -> Self
Sets the value of retries
to hold a MaxRetries.
Note that all the setters affecting retries are
mutually exclusive.
Trait Implementations§
Source§impl Clone for TaskTemplate
impl Clone for TaskTemplate
Source§fn clone(&self) -> TaskTemplate
fn clone(&self) -> TaskTemplate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more