I would like to read the tasks running on a service through aws-sdk nodejs. I tried describeServices
API but there is no information about the tasks.
CodePudding user response:
Tasks are running on a cluster and managed by a service. You need to use the ListTasks API to get more information about the tasks in a cluster that belong to a certain service.
The API call should look something like this:
var params = {
cluster: '<cluster-name>',
serviceName: '<service-name>'
};
ecs.listTasks(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});