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.
Namespace: Amazon.ECS.Model
Assembly: AWSSDK.ECS.dll
Version: 3.x.y.z
public class ExecuteCommandResponse : AmazonWebServiceResponse
The ExecuteCommandResponse type exposes the following members
Name | Description | |
---|---|---|
![]() |
ExecuteCommandResponse() |
Name | Type | Description | |
---|---|---|---|
![]() |
ClusterArn | System.String |
Gets and sets the property ClusterArn. The Amazon Resource Name (ARN) of the cluster. |
![]() |
ContainerArn | System.String |
Gets and sets the property ContainerArn. The Amazon Resource Name (ARN) of the container. |
![]() |
ContainerName | System.String |
Gets and sets the property ContainerName. The name of the container. |
![]() |
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
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 |
![]() |
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
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. |
![]() |
TaskArn | System.String |
Gets and sets the property TaskArn. The Amazon Resource Name (ARN) of the task. |
This example runs an interactive /bin/sh command on a container MyContainer.
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;
.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