MCPcopy Create free account
hub / github.com/coldbrewcloud/coldbrew-cli / ListServiceTaskARNs

Method ListServiceTaskARNs

aws/ecs/client.go:255–283  ·  view source on GitHub ↗
(clusterName, serviceName string)

Source from the content-addressed store, hash-verified

253}
254
255func (c *Client) ListServiceTaskARNs(clusterName, serviceName string) ([]string, error) {
256 var nextToken *string
257 taskARNs := []string{}
258
259 for {
260 params := &_ecs.ListTasksInput{
261 Cluster: _aws.String(clusterName),
262 ServiceName: _aws.String(serviceName),
263 NextToken: nextToken,
264 }
265
266 res, err := c.svc.ListTasks(params)
267 if err != nil {
268 return nil, err
269 }
270
271 for _, t := range res.TaskArns {
272 taskARNs = append(taskARNs, conv.S(t))
273 }
274
275 if res.NextToken == nil {
276 break
277 } else {
278 nextToken = res.NextToken
279 }
280 }
281
282 return taskARNs, nil
283}
284
285func (c *Client) RetrieveTasks(clusterName string, taskARNs []string) ([]*_ecs.Task, error) {
286 if len(taskARNs) == 0 {

Callers 1

RunMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected