@Path(ResourcePathConstants.ConfigResourcePathConstants.UPDATE_CONFIGURATION)
@Produces(MediaType.TEXT_PLAIN)
public Response addConfiguration(@FormParam("key") String key,
@FormParam("value") String value,
@FormParam("date") String date) {
AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
try {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date formattedDate = dateFormat.parse(date);
airavataRegistry.addConfiguration(key, value, formattedDate);
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity("Configuration updated successfully...");
return builder.build();
} catch (Throwable e) {
return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.UPDATE_CONFIGURATION, e);