Menu
Amazon EC2 Container Service
API Reference (API Version 2014-11-13)

RegisterContainerInstance

Note

This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.

Registers an EC2 instance into the specified cluster. This instance becomes available to place containers on.

Request Syntax

{
   "attributes": [ 
      { 
         "name": "string",
         "targetId": "string",
         "targetType": "string",
         "value": "string"
      }
   ],
   "cluster": "string",
   "containerInstanceArn": "string",
   "instanceIdentityDocument": "string",
   "instanceIdentityDocumentSignature": "string",
   "totalResources": [ 
      { 
         "doubleValue": number,
         "integerValue": number,
         "longValue": number,
         "name": "string",
         "stringSetValue": [ "string" ],
         "type": "string"
      }
   ],
   "versionInfo": { 
      "agentHash": "string",
      "agentVersion": "string",
      "dockerVersion": "string"
   }
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

attributes

The container instance attributes that this container instance supports.

Type: Array of Attribute objects

Required: No

cluster

The short name or full Amazon Resource Name (ARN) of the cluster with which to register your container instance. If you do not specify a cluster, the default cluster is assumed.

Type: String

Required: No

containerInstanceArn

The ARN of the container instance (if it was previously registered).

Type: String

Required: No

instanceIdentityDocument

The instance identity document for the EC2 instance to register. This document can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/

Type: String

Required: No

instanceIdentityDocumentSignature

The instance identity document signature for the EC2 instance to register. This signature can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/signature/

Type: String

Required: No

totalResources

The resources available on the instance.

Type: Array of Resource objects

Required: No

versionInfo

The version information for the Amazon ECS container agent and Docker daemon running on the container instance.

Type: VersionInfo object

Required: No

Response Syntax

{
   "containerInstance": { 
      "agentConnected": boolean,
      "agentUpdateStatus": "string",
      "attachments": [ 
         { 
            "details": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "id": "string",
            "status": "string",
            "type": "string"
         }
      ],
      "attributes": [ 
         { 
            "name": "string",
            "targetId": "string",
            "targetType": "string",
            "value": "string"
         }
      ],
      "containerInstanceArn": "string",
      "ec2InstanceId": "string",
      "pendingTasksCount": number,
      "registeredAt": number,
      "registeredResources": [ 
         { 
            "doubleValue": number,
            "integerValue": number,
            "longValue": number,
            "name": "string",
            "stringSetValue": [ "string" ],
            "type": "string"
         }
      ],
      "remainingResources": [ 
         { 
            "doubleValue": number,
            "integerValue": number,
            "longValue": number,
            "name": "string",
            "stringSetValue": [ "string" ],
            "type": "string"
         }
      ],
      "runningTasksCount": number,
      "status": "string",
      "version": number,
      "versionInfo": { 
         "agentHash": "string",
         "agentVersion": "string",
         "dockerVersion": "string"
      }
   }
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

containerInstance

The container instance that was registered.

Type: ContainerInstance object

Errors

For information about the errors that are common to all actions, see Common Errors.

ClientException

These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid.

HTTP Status Code: 400

InvalidParameterException

The specified parameter is invalid. Review the available parameters for the API request.

HTTP Status Code: 400

ServerException

These errors are usually caused by a server issue.

HTTP Status Code: 500

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: