aws_sdk_ecs/client/
update_task_protection.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`UpdateTaskProtection`](crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`cluster(impl Into<String>)`](crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder::cluster) / [`set_cluster(Option<String>)`](crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder::set_cluster):<br>required: **true**<br><p>The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.</p><br>
7    ///   - [`tasks(impl Into<String>)`](crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder::tasks) / [`set_tasks(Option<Vec::<String>>)`](crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder::set_tasks):<br>required: **true**<br><p>A list of up to 10 task IDs or full ARN entries.</p><br>
8    ///   - [`protection_enabled(bool)`](crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder::protection_enabled) / [`set_protection_enabled(Option<bool>)`](crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder::set_protection_enabled):<br>required: **true**<br><p>Specify <code>true</code> to mark a task for protection and <code>false</code> to unset protection, making it eligible for termination.</p><br>
9    ///   - [`expires_in_minutes(i32)`](crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder::expires_in_minutes) / [`set_expires_in_minutes(Option<i32>)`](crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder::set_expires_in_minutes):<br>required: **false**<br><p>If you set <code>protectionEnabled</code> to <code>true</code>, you can specify the duration for task protection in minutes. You can specify a value from 1 minute to up to 2,880 minutes (48 hours). During this time, your task will not be terminated by scale-in events from Service Auto Scaling or deployments. After this time period lapses, <code>protectionEnabled</code> will be reset to <code>false</code>.</p> <p>If you don’t specify the time, then the task is automatically protected for 120 minutes (2 hours).</p><br>
10    /// - On success, responds with [`UpdateTaskProtectionOutput`](crate::operation::update_task_protection::UpdateTaskProtectionOutput) with field(s):
11    ///   - [`protected_tasks(Option<Vec::<ProtectedTask>>)`](crate::operation::update_task_protection::UpdateTaskProtectionOutput::protected_tasks): <p>A list of tasks with the following information.</p> <ul>  <li>   <p><code>taskArn</code>: The task ARN.</p></li>  <li>   <p><code>protectionEnabled</code>: The protection status of the task. If scale-in protection is turned on for a task, the value is <code>true</code>. Otherwise, it is <code>false</code>.</p></li>  <li>   <p><code>expirationDate</code>: The epoch time when protection for the task will expire.</p></li> </ul>
12    ///   - [`failures(Option<Vec::<Failure>>)`](crate::operation::update_task_protection::UpdateTaskProtectionOutput::failures): <p>Any failures associated with the call.</p>
13    /// - On failure, responds with [`SdkError<UpdateTaskProtectionError>`](crate::operation::update_task_protection::UpdateTaskProtectionError)
14    pub fn update_task_protection(&self) -> crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder {
15        crate::operation::update_task_protection::builders::UpdateTaskProtectionFluentBuilder::new(self.handle.clone())
16    }
17}