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

DescribeServices

Describes the specified services running in your cluster.

Request Syntax

{
   "cluster": "string",
   "services": [ "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.

cluster

The short name or full Amazon Resource Name (ARN)the cluster that hosts the service to describe. If you do not specify a cluster, the default cluster is assumed.

Type: String

Required: No

services

A list of services to describe. You may specify up to 10 services to describe in a single operation.

Type: Array of strings

Required: Yes

Response Syntax

{
   "failures": [ 
      { 
         "arn": "string",
         "reason": "string"
      }
   ],
   "services": [ 
      { 
         "clusterArn": "string",
         "createdAt": number,
         "deploymentConfiguration": { 
            "maximumPercent": number,
            "minimumHealthyPercent": number
         },
         "deployments": [ 
            { 
               "createdAt": number,
               "desiredCount": number,
               "id": "string",
               "launchType": "string",
               "networkConfiguration": { 
                  "awsvpcConfiguration": { 
                     "assignPublicIp": "string",
                     "securityGroups": [ "string" ],
                     "subnets": [ "string" ]
                  }
               },
               "pendingCount": number,
               "platformVersion": "string",
               "runningCount": number,
               "status": "string",
               "taskDefinition": "string",
               "updatedAt": number
            }
         ],
         "desiredCount": number,
         "events": [ 
            { 
               "createdAt": number,
               "id": "string",
               "message": "string"
            }
         ],
         "launchType": "string",
         "loadBalancers": [ 
            { 
               "containerName": "string",
               "containerPort": number,
               "loadBalancerName": "string",
               "targetGroupArn": "string"
            }
         ],
         "networkConfiguration": { 
            "awsvpcConfiguration": { 
               "assignPublicIp": "string",
               "securityGroups": [ "string" ],
               "subnets": [ "string" ]
            }
         },
         "pendingCount": number,
         "placementConstraints": [ 
            { 
               "expression": "string",
               "type": "string"
            }
         ],
         "placementStrategy": [ 
            { 
               "field": "string",
               "type": "string"
            }
         ],
         "platformVersion": "string",
         "roleArn": "string",
         "runningCount": number,
         "serviceArn": "string",
         "serviceName": "string",
         "status": "string",
         "taskDefinition": "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.

failures

Any failures associated with the call.

Type: Array of Failure objects

services

The list of services described.

Type: Array of Service objects

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

ClusterNotFoundException

The specified cluster could not be found. You can view your available clusters with ListClusters. Amazon ECS clusters are region-specific.

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

Example

In the following example or examples, the Authorization header contents (AUTHPARAMS) must be replaced with an AWS Signature Version 4 signature. For more information, see Signature Version 4 Signing Process in the AWS General Reference.

You only need to learn how to sign HTTP requests if you intend to create them manually. When you use the AWS Command Line Interface (AWS CLI) or one of the AWS SDKs to make requests to AWS, these tools automatically sign the requests for you, with the access key that you specify when you configure the tools. When you use these tools, you don't have to sign requests yourself.

Example

This example request provides a full description of the bunker_buster service in the telemetry cluster.

Sample Request

POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 55
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeServices
X-Amz-Date: 20150528T163859Z
User-Agent: aws-cli/1.7.30 Python/2.7.9 Darwin/14.3.0
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS

{
  "services": [
    "bunker-buster"
  ],
  "cluster": "telemetry"
}

Sample Response

HTTP/1.1 200 OK
Server: Server
Date: Wed, 29 Apr 2015 19:02:59 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 2449
Connection: keep-alive
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f

{
  "failures": [],
  "services": [
    {
      "clusterArn": "arn:aws:ecs:us-west-2:012345678910:cluster/telemetry",
      "deploymentConfiguration": {
          "maximumPercent": 200,
          "minimumHealthyPercent": 100
      },
      "deployments": [
        {
          "createdAt": 1432829320.611,
          "desiredCount": 4,
          "id": "ecs-svc/9223370604025455196",
          "pendingCount": 0,
          "runningCount": 4,
          "status": "PRIMARY",
          "taskDefinition": "arn:aws:ecs:us-west-2:012345678910:task-definition/hpcc-t2-medium:1",
          "updatedAt": 1432829320.611
        }
      ],
      "desiredCount": 4,
      "events": [],
      "loadBalancers": [],
      "pendingCount": 0,
      "runningCount": 4,
      "serviceArn": "arn:aws:ecs:us-west-2:012345678910:service/bunker-buster",
      "serviceName": "bunker-buster",
      "status": "ACTIVE",
      "taskDefinition": "arn:aws:ecs:us-west-2:012345678910:task-definition/hpcc-t2-medium:1"
    }
  ]
}

See Also

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