AWS SDK Version 3 for .NET
API Reference

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 GetTaskProtection operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.ECS.Model.GetTaskProtectionResponse

Namespace: Amazon.ECS.Model
Assembly: AWSSDK.ECS.dll
Version: 3.x.y.z

Syntax

C#
public class GetTaskProtectionResponse : AmazonWebServiceResponse

The GetTaskProtectionResponse type exposes the following members

Constructors

NameDescription
Public Method GetTaskProtectionResponse()

Properties

NameTypeDescription
Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property Failures System.Collections.Generic.List<Amazon.ECS.Model.Failure>

Gets and sets the property Failures.

Any failures associated with the call.

Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property ProtectedTasks System.Collections.Generic.List<Amazon.ECS.Model.ProtectedTask>

Gets and sets the property ProtectedTasks.

A list of tasks with the following information.

  • taskArn: The task ARN.

  • protectionEnabled: The protection status of the task. If scale-in protection is turned on for a task, the value is true. Otherwise, it is false.

  • expirationDate: The epoch time when protection for the task will expire.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.

Examples

In this example, we get the protection status for a single task.

To get the protection status of a task


var client = new AmazonECSClient();
var response = client.GetTaskProtection(new GetTaskProtectionRequest 
{
    Cluster = "test-task-protection",
    Tasks = new List<string> {
        "b8b1cf532d0e46ba8d44a40d1de16772"
    }
});

List<Failure> failures = response.Failures;
List<ProtectedTask> protectedTasks = response.ProtectedTasks;

            

Version Information

.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