com.netflix.eureka.resources
Class ASGResource

java.lang.Object
  extended by com.netflix.eureka.resources.ASGResource

public class ASGResource
extends java.lang.Object

A jersey resource for handling updates to ASGResource.ASGStatus.

The ASG status is used in AWS environments to automatically enable/disable instance registration based on the status of the ASG. This is particularly useful in red/black deployment scenarios where it is easy to switch to a new version and incase of problems switch back to the old versions of the deployment.

During such a scenario, when an ASG is disabled and the instances go away and get refilled by an ASG - which is normal in AWS environments,the instances automatically go in the InstanceInfo.InstanceStatus.OUT_OF_SERVICE state when they are refilled by the ASG and if the ASG is disabled by as indicated by a flag in the ASG as described in AwsAsgUtil.isASGEnabled(String)


Nested Class Summary
static class ASGResource.ASGStatus
           
 
Constructor Summary
ASGResource()
           
 
Method Summary
 javax.ws.rs.core.Response statusUpdate(java.lang.String asgName, java.lang.String newStatus, java.lang.String isReplication)
          Changes the status information of the ASG.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASGResource

public ASGResource()
Method Detail

statusUpdate

public javax.ws.rs.core.Response statusUpdate(java.lang.String asgName,
                                              java.lang.String newStatus,
                                              @HeaderParam(value="x-netflix-discovery-replication")
                                              java.lang.String isReplication)
Changes the status information of the ASG.

Parameters:
asgName - the name of the ASG for which the status needs to be changed.
newStatus - the new status ASGResource.ASGStatus of the ASG.
isReplication - a header parameter containing information whether this is replicated from other nodes.
Returns:
response which indicates if the operation succeeded or not.