Example usage for com.amazonaws.services.autoscaling.model Instance Instance

List of usage examples for com.amazonaws.services.autoscaling.model Instance Instance

Introduction

In this page you can find the example usage for com.amazonaws.services.autoscaling.model Instance Instance.

Prototype

Instance

Source Link

Usage

From source file:com.netflix.simianarmy.client.chef.ChefGroups.java

License:Apache License

/**
 * Add the given instance to the named group.
 *///w  w w .  j a  v  a 2 s.  c o m
public void addInstance(final String instanceId, final String groupName) {
    if (!map.containsKey(groupName)) {
        final AutoScalingGroup asg = new AutoScalingGroup();
        asg.setAutoScalingGroupName(groupName);
        map.put(groupName, asg);
    }

    final AutoScalingGroup asg = map.get(groupName);
    Instance instance = new Instance();
    instance.setInstanceId(instanceId);

    asg.getInstances().add(instance);
}