ListServiceDeployments
This operation lists all the service deployments that meet the specified filter criteria.
A service deployment happens when you release a software update for the service. You route traffic from the running service revisions to the new service revison and control the number of running tasks.
This API returns the values that you use for the request parameters in DescribeServiceRevisions.
Request Syntax
{
   "cluster": "string",
   "createdAt": { 
      "after": number,
      "before": number
   },
   "maxResults": number,
   "nextToken": "string",
   "service": "string",
   "status": [ "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 cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, defaultis used.Type: String Required: No 
- createdAt
- 
               An optional filter you can use to narrow the results by the service creation date. If you do not specify a value, the result includes all services created before the current time. The format is yyyy-MM-dd HH:mm:ss.SSSSSS. Type: CreatedAt object Required: No 
- maxResults
- 
               The maximum number of service deployment results that ListServiceDeploymentsreturned in paginated output. When this parameter is used,ListServiceDeploymentsonly returnsmaxResultsresults in a single page along with anextTokenresponse element. The remaining results of the initial request can be seen by sending anotherListServiceDeploymentsrequest with the returnednextTokenvalue. This value can be between 1 and 100. If this parameter isn't used, thenListServiceDeploymentsreturns up to 20 results and anextTokenvalue if applicable.Type: Integer Required: No 
- nextToken
- 
               The nextTokenvalue returned from aListServiceDeploymentsrequest indicating that more results are available to fulfill the request and further calls are needed. If you providedmaxResults, it's possible the number of results is fewer thanmaxResults.Type: String Required: No 
- service
- 
               The ARN or name of the service Type: String Required: Yes 
- status
- 
               An optional filter you can use to narrow the results. If you do not specify a status, then all status values are included in the result. Type: Array of strings Valid Values: PENDING | SUCCESSFUL | STOPPED | STOP_REQUESTED | IN_PROGRESS | ROLLBACK_REQUESTED | ROLLBACK_IN_PROGRESS | ROLLBACK_SUCCESSFUL | ROLLBACK_FAILEDRequired: No 
Response Syntax
{
   "nextToken": "string",
   "serviceDeployments": [ 
      { 
         "clusterArn": "string",
         "createdAt": number,
         "finishedAt": number,
         "serviceArn": "string",
         "serviceDeploymentArn": "string",
         "startedAt": number,
         "status": "string",
         "statusReason": "string",
         "targetServiceRevisionArn": "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.
- nextToken
- 
               The nextTokenvalue to include in a futureListServiceDeploymentsrequest. When the results of aListServiceDeploymentsrequest exceedmaxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.Type: String 
- serviceDeployments
- 
               An overview of the service deployment, including the following properties: - 
                     The ARN of the service deployment. 
- 
                     The ARN of the service being deployed. 
- 
                     The ARN of the cluster that hosts the service in the service deployment. 
- 
                     The time that the service deployment started. 
- 
                     The time that the service deployment completed. 
- 
                     The service deployment status. 
- 
                     Information about why the service deployment is in the current state. 
- 
                     The ARN of the service revision that is being deployed. 
 Type: Array of ServiceDeploymentBrief objects 
- 
                     
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
- 
               You don't have authorization to perform the requested action. HTTP Status Code: 400 
- ClientException
- 
               These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid. - message
- 
                        Message that describes the cause of the exception. 
 HTTP Status Code: 400 
- InvalidParameterException
- 
               The specified parameter isn't valid. Review the available parameters for the API request. For more information about service event errors, see Amazon ECS service event messages. HTTP Status Code: 400 
- ServerException
- 
               These errors are usually caused by a server issue. - message
- 
                        Message that describes the cause of the exception. 
 HTTP Status Code: 500 
- ServiceNotFoundException
- 
               The specified service wasn't found. You can view your available services with ListServices. Amazon ECS services are cluster specific and Region specific. HTTP Status Code: 400 
- UnsupportedFeatureException
- 
               The specified task isn't supported in this Region. HTTP Status Code: 400 
Examples
Example
This example request lists the service deployments for the
						sd-example service on the example cluster.
Sample Request
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
Content-Length: 55
X-Amz-Target: AmazonEC2ContainerServiceV20141113.DescribeServiceDeployments
X-Amz-Date: 20150528T163859Z
User-Agent: aws-cli/2.17 Python/3.11.9 Darwin/14.3.0
Content-Type: application/x-amz-json-1.1
Authorization: AUTHPARAMS
{
  "cluster": "example",
  "service": "sd-example"
}Sample Response
HTTP/1.1 200 OK
Server: Server
Date: Tue, 10 Sep 2024 18:50:14 GMT
Content-Type: application/x-amz-json-1.1
Content-Length: 220
Connection: keep-alive
RequestId: 360c5551-123e-4e74-9914-7582d3a28807
{
    "serviceDeployments": [
        {
            "serviceDeploymentArn": "arn:aws:ecs:us-west-2:123456789012:service-deployment/example/sd-example/NCWGC2ZR-taawPAYrIaU5",
            "serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/example/sd-example",
            "clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/example",
            "targetServiceRevisionArn": "arn:aws:ecs:us-west-2:123456789012:service-revision/example/sd-example/4980306466373577095",
            "status": "SUCCESSFUL"
        }
    ]
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: