/** * Changes the status information of the ASG. * * @param asgName the name of the ASG for which the status needs to be changed. * @param newStatus the new status {@link ASGStatus} of the ASG. * @param isReplication a header parameter containing information whether this is replicated from other nodes. * * @return response which indicates if the operation succeeded or not. */ @PUT @Path("{asgName}/status") public Response statusUpdate(@PathParam("asgName") String asgName, @QueryParam("value") String newStatus, @HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication) { if (awsAsgUtil == null) { return Response.status(400).build(); } try { logger.info("Trying to update ASG Status for ASG {} to {}", asgName, newStatus); ASGStatus asgStatus = ASGStatus.valueOf(newStatus.toUpperCase()); awsAsgUtil.setStatus(asgName, (!ASGStatus.DISABLED.equals(asgStatus))); registry.statusUpdate(asgName, asgStatus, Boolean.valueOf(isReplication)); logger.debug("Updated ASG Status for ASG {} to {}", asgName, asgStatus); } catch (Throwable e) { logger.error("Cannot update the status {} for the ASG {}", newStatus, asgName, e); return Response.serverError().build(); } return Response.ok().build(); }
return Response.status(Status.NOT_FOUND).build(); boolean isSuccess = registry.statusUpdate(app.getName(), id, InstanceStatus.valueOf(newStatus), lastDirtyTimestamp, "true".equals(isReplication));
/** * Changes the status information of the ASG. * * @param asgName the name of the ASG for which the status needs to be changed. * @param newStatus the new status {@link ASGStatus} of the ASG. * @param isReplication a header parameter containing information whether this is replicated from other nodes. * * @return response which indicates if the operation succeeded or not. */ @PUT @Path("{asgName}/status") public Response statusUpdate(@PathParam("asgName") String asgName, @QueryParam("value") String newStatus, @HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication) { if (awsAsgUtil == null) { return Response.status(400).build(); } try { logger.info("Trying to update ASG Status for ASG {} to {}", asgName, newStatus); ASGStatus asgStatus = ASGStatus.valueOf(newStatus.toUpperCase()); awsAsgUtil.setStatus(asgName, (!ASGStatus.DISABLED.equals(asgStatus))); registry.statusUpdate(asgName, asgStatus, Boolean.valueOf(isReplication)); logger.debug("Updated ASG Status for ASG {} to {}", asgName, asgStatus); } catch (Throwable e) { logger.error("Cannot update the status {} for the ASG {}", newStatus, asgName, e); return Response.serverError().build(); } return Response.ok().build(); }
return Response.status(Status.NOT_FOUND).build(); boolean isSuccess = registry.statusUpdate(app.getName(), id, InstanceStatus.valueOf(newStatus), lastDirtyTimestamp, "true".equals(isReplication));