Example usage for com.amazonaws.services.ecs.model ContainerInstance getAttributes

List of usage examples for com.amazonaws.services.ecs.model ContainerInstance getAttributes

Introduction

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

Prototype


public java.util.List<Attribute> getAttributes() 

Source Link

Document

The attributes set for the container instance, either by the Amazon ECS container agent at instance registration or manually with the PutAttributes operation.

Usage

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

License:Apache License

public static Map<String, Object> convertContainerInstanceToAttributes(ContainerInstance containerInstance) {
    Map<String, Object> attributes = new HashMap<>();
    attributes.put("containerInstanceArn", containerInstance.getContainerInstanceArn());
    attributes.put("ec2InstanceId", containerInstance.getEc2InstanceId());
    for (Attribute containerAttribute : containerInstance.getAttributes()) {
        if (containerAttribute.getName().equals("ecs.availability-zone")) {
            attributes.put("availabilityZone", containerAttribute.getValue());
        }/*from   w ww.  j av  a2 s  .c o m*/
    }
    return attributes;
}