Jackie-Jiang commented on a change in pull request #5902:
URL: https://github.com/apache/incubator-pinot/pull/5902#discussion_r474208985



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotInstanceRestletResource.java
##########
@@ -196,4 +197,25 @@ public SuccessResponse updateInstance(
     }
     return new SuccessResponse("Instance successfully updated");
   }
+
+  @PUT
+  @Path("/instances/{instanceName}/updateTags")
+  @Consumes(MediaType.APPLICATION_JSON)
+  @Produces(MediaType.APPLICATION_JSON)
+  @ApiOperation(value = "Update the tags of the specified instance", consumes 
= MediaType.APPLICATION_JSON, notes = "Update the tags of the specified 
instance")
+  @ApiResponses(value = {@ApiResponse(code = 200, message = "Success"), 
@ApiResponse(code = 500, message = "Internal error")})
+  public SuccessResponse updateInstanceTags(
+      @ApiParam(value = "Instance name", required = true, example = 
"Server_a.b.com_20000 | Broker_my.broker.com_30000") @PathParam("instanceName") 
String instanceName,
+      @ApiParam(value = "Comma separated tags list", required = true) 
@QueryParam("tags") String tags) {
+    LOGGER.info("Instance update request received for instance: {}", 
instanceName);
+    if (tags == null) {
+      throw new ControllerApplicationException(LOGGER, "Must provide tags to 
update", Response.Status.BAD_REQUEST);
+    }
+    PinotResourceManagerResponse response = 
pinotHelixResourceManager.updateInstanceTags(instanceName, tags);
+    if (!response.isSuccessful()) {
+      throw new ControllerApplicationException(LOGGER,
+          "Failure to update instance tags. Reason: " + response.getMessage(), 
Response.Status.INTERNAL_SERVER_ERROR);

Review comment:
       Seems the `updateInstance` has the same behavior. We should probably 
provide more status info in the `PinotResourceManagerResponse` besides 
success/failure. Not a blocker for this PR




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to