AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
This is the response object from the UpdateTaskProtection operation.
Namespace: Amazon.ECS.Model
Assembly: AWSSDK.ECS.dll
Version: 3.x.y.z
public class UpdateTaskProtectionResponse : AmazonWebServiceResponse
The UpdateTaskProtectionResponse type exposes the following members
Name | Description | |
---|---|---|
![]() |
UpdateTaskProtectionResponse() |
Name | Type | Description | |
---|---|---|---|
![]() |
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
Failures | System.Collections.Generic.List<Amazon.ECS.Model.Failure> |
Gets and sets the property Failures. Any failures associated with the call. |
![]() |
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
ProtectedTasks | System.Collections.Generic.List<Amazon.ECS.Model.ProtectedTask> |
Gets and sets the property ProtectedTasks. A list of tasks with the following information.
|
![]() |
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
This example enables scale-in protection for a task for 60 minutes.
var client = new AmazonECSClient(); var response = client.UpdateTaskProtection(new UpdateTaskProtectionRequest { Cluster = "test-task-protection", ExpiresInMinutes = 60, ProtectionEnabled = true, Tasks = new List<string> { "b8b1cf532d0e46ba8d44a40d1de16772" } }); List<Failure> failures = response.Failures; List<ProtectedTask> protectedTasks = response.ProtectedTasks;
This example enables task scale-in protection for a task, without specifying the expiresInMinutes parameter, for the default protection period of 120 minutes.
var client = new AmazonECSClient(); var response = client.UpdateTaskProtection(new UpdateTaskProtectionRequest { Cluster = "test-task-protection", ProtectionEnabled = true, Tasks = new List<string> { "b8b1cf532d0e46ba8d44a40d1de16772" } }); List<Failure> failures = response.Failures; List<ProtectedTask> protectedTasks = response.ProtectedTasks;
This example removes scale-in protection for a task.
var client = new AmazonECSClient(); var response = client.UpdateTaskProtection(new UpdateTaskProtectionRequest { Cluster = "test-task-protection", ProtectionEnabled = false, Tasks = new List<string> { "b8b1cf532d0e46ba8d44a40d1de16772" } }); List<Failure> failures = response.Failures; List<ProtectedTask> protectedTasks = response.ProtectedTasks;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5