Package com.netflix.eureka.resources
Class ASGResource
- java.lang.Object
-
- com.netflix.eureka.resources.ASGResource
-
@Path("/{version}/asg") @Produces({"application/xml","application/json"}) public class ASGResource extends java.lang.ObjectA jersey resource for handling updates toASGResource.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_SERVICEstate when they are refilled by the ASG and if the ASG is disabled by as indicated by a flag in the ASG as described inAwsAsgUtil.isASGEnabled(com.netflix.appinfo.InstanceInfo)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classASGResource.ASGStatus
-
Field Summary
Fields Modifier and Type Field Description protected AwsAsgUtilawsAsgUtilprotected PeerAwareInstanceRegistryregistry
-
Constructor Summary
Constructors Constructor Description ASGResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.ws.rs.core.ResponsestatusUpdate(java.lang.String asgName, java.lang.String newStatus, java.lang.String isReplication)Changes the status information of the ASG.
-
-
-
Field Detail
-
registry
protected final PeerAwareInstanceRegistry registry
-
awsAsgUtil
protected final AwsAsgUtil awsAsgUtil
-
-
Method Detail
-
statusUpdate
@PUT @Path("{asgName}/status") public jakarta.ws.rs.core.Response statusUpdate(@PathParam("asgName") java.lang.String asgName, @QueryParam("value") java.lang.String newStatus, @HeaderParam("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 statusASGResource.ASGStatusof 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.
-
-