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.

Container for the parameters to the GetTaskProtection operation. Retrieves the protection status of tasks in an Amazon ECS service.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.ECS.AmazonECSRequest
      Amazon.ECS.Model.GetTaskProtectionRequest

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

Syntax

C#
public class GetTaskProtectionRequest : AmazonECSRequest
         IAmazonWebServiceRequest

The GetTaskProtectionRequest type exposes the following members

Constructors

NameDescription
Public Method GetTaskProtectionRequest()

Properties

NameTypeDescription
Public Property Cluster System.String

Gets and sets the property Cluster.

The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service that the task sets exist in.

Public Property Tasks System.Collections.Generic.List<System.String>

Gets and sets the property Tasks.

A list of up to 100 task IDs or full ARN entries.

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