@POST
@Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_SAVE)
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response addServiceDescriptor(ServiceDescriptor service) {
AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
try {
ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(service);
airavataRegistry.addServiceDescriptor(serviceDescription);
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity("Service descriptor saved successfully...");
return builder.build();
} catch (DescriptorAlreadyExistsException e) {
Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);