Jackie-Jiang commented on a change in pull request #4952: Adding new Controller
APIs for retrieving and setting tag for an instance
URL: https://github.com/apache/incubator-pinot/pull/4952#discussion_r374267251
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotInstanceRestletResource.java
##########
@@ -176,4 +178,20 @@ public SuccessResponse dropInstance(
}
return new SuccessResponse("Successfully dropped instance");
}
-}
+
+ @PUT
+ @Path("/instances/{instanceName}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "Update the specified instance", consumes =
MediaType.APPLICATION_JSON, notes = "Update specified instance with given
instance config")
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "Success"),
@ApiResponse(code = 500, message = "Internal error")})
+ public SuccessResponse updateInstance(
+ @ApiParam(value = "Instance name", required = true, example =
"Server_a.b.com_20000 | Broker_my.broker.com_30000") @PathParam("instanceName")
String instanceName,
+ Instance instance) {
+ LOGGER.info("Instance update request received for instance: {}",
instanceName);
+ if (!pinotHelixResourceManager.updateInstance(instanceName,
instance).isSuccessful()) {
+ throw new ControllerApplicationException(LOGGER, "Failure to update
instance", Response.Status.INTERNAL_SERVER_ERROR);
+ }
+ return new SuccessResponse("Instance successfully updated");
+ }
+}
Review comment:
(nit) new line
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]