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

Inheritance Hierarchy

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

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

Syntax

C#
public class ExecuteCommandResponse : AmazonWebServiceResponse

The ExecuteCommandResponse type exposes the following members

Constructors

NameDescription
Public Method ExecuteCommandResponse()

Properties

NameTypeDescription
Public Property ClusterArn System.String

Gets and sets the property ClusterArn.

The Amazon Resource Name (ARN) of the cluster.

Public Property ContainerArn System.String

Gets and sets the property ContainerArn.

The Amazon Resource Name (ARN) of the container.

Public Property ContainerName System.String

Gets and sets the property ContainerName.

The name of the container.

Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property Interactive System.Boolean

Gets and sets the property Interactive.

Determines whether the execute command session is running in interactive mode. Amazon ECS only supports initiating interactive sessions, so you must specify true for this value.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property Session Amazon.ECS.Model.Session

Gets and sets the property Session.

The details of the SSM session that was created for this instance of execute-command.

Public Property TaskArn System.String

Gets and sets the property TaskArn.

The Amazon Resource Name (ARN) of the task.

Examples

This example runs an interactive /bin/sh command on a container MyContainer.

To run a command remotely on a container in a task


var client = new AmazonECSClient();
var response = client.ExecuteCommand(new ExecuteCommandRequest 
{
    Cluster = "MyCluster",
    Command = "/bin/sh",
    Container = "MyContainer",
    Interactive = true,
    Task = "arn:aws:ecs:us-east-1:123456789012:task/MyCluster/d789e94343414c25b9f6bd59eEXAMPLE"
});

string clusterArn = response.ClusterArn;
string containerArn = response.ContainerArn;
string containerName = response.ContainerName;
bool interactive = response.Interactive;
Session session = response.Session;
string taskArn = response.TaskArn;

            

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