Example usage for com.amazonaws.services.ecs.model Service getLoadBalancers

List of usage examples for com.amazonaws.services.ecs.model Service getLoadBalancers

Introduction

In this page you can find the example usage for com.amazonaws.services.ecs.model Service getLoadBalancers.

Prototype


public java.util.List<LoadBalancer> getLoadBalancers() 

Source Link

Document

A list of Elastic Load Balancing load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.

Usage

From source file:com.netflix.spinnaker.clouddriver.ecs.provider.agent.ServiceCachingAgent.java

License:Apache License

public static Map<String, Object> convertServiceToAttributes(String accountName, String region,
        Service service) {
    Map<String, Object> attributes = new HashMap<>();
    String applicationName = service.getServiceName().contains("-")
            ? StringUtils.substringBefore(service.getServiceName(), "-")
            : service.getServiceName();//from   www .j a  va 2  s . co m
    String clusterName = StringUtils.substringAfterLast(service.getClusterArn(), "/");

    attributes.put("account", accountName);
    attributes.put("region", region);
    attributes.put("applicationName", applicationName);
    attributes.put("serviceName", service.getServiceName());
    attributes.put("serviceArn", service.getServiceArn());
    attributes.put("clusterName", clusterName);
    attributes.put("clusterArn", service.getClusterArn());
    attributes.put("roleArn", service.getRoleArn());
    attributes.put("taskDefinition", service.getTaskDefinition());
    attributes.put("desiredCount", service.getDesiredCount());
    attributes.put("maximumPercent", service.getDeploymentConfiguration().getMaximumPercent());
    attributes.put("minimumHealthyPercent", service.getDeploymentConfiguration().getMinimumHealthyPercent());
    attributes.put("loadBalancers", service.getLoadBalancers());
    attributes.put("createdAt", service.getCreatedAt().getTime());

    return attributes;
}