Example usage for com.amazonaws.services.ecs AmazonECSClient stopTask

List of usage examples for com.amazonaws.services.ecs AmazonECSClient stopTask

Introduction

In this page you can find the example usage for com.amazonaws.services.ecs AmazonECSClient stopTask.

Prototype

@Override
public StopTaskResult stopTask(StopTaskRequest request) 

Source Link

Document

Stops a running task.

Usage

From source file:com.cloudbees.jenkins.plugins.amazonecs.ECSService.java

License:Open Source License

void deleteTask(String taskArn, String clusterArn) {
    final AmazonECSClient client = getAmazonECSClient();

    LOGGER.log(Level.INFO, "Delete ECS Slave task: {0}", taskArn);
    try {//  w w  w  .  j a va2 s.  co  m
        client.stopTask(new StopTaskRequest().withTask(taskArn).withCluster(clusterArn));
    } catch (ClientException e) {
        LOGGER.log(Level.SEVERE, "Couldn't stop task arn " + taskArn + " caught exception: " + e.getMessage(),
                e);
    }
}