|
|
|
@ -3,6 +3,7 @@ package org.gcube.resourcemanagement.manager.webapp.rs;
|
|
|
|
|
import javax.ws.rs.DELETE;
|
|
|
|
|
import javax.ws.rs.POST;
|
|
|
|
|
import javax.ws.rs.Path;
|
|
|
|
|
import javax.ws.rs.PathParam;
|
|
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
|
import javax.ws.rs.QueryParam;
|
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
@ -51,10 +52,11 @@ public class RMContext {
|
|
|
|
|
* e.g. DELETE /resource-manager/context/UUID?rrURL=http://registry:port//resource-registry
|
|
|
|
|
*/
|
|
|
|
|
@DELETE
|
|
|
|
|
@Path("{" + UUID_PARAM + "}")
|
|
|
|
|
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
|
|
|
|
|
public Response delete(String uuid, @QueryParam(FORCE_RRURL_PARAM) String rrURL) {
|
|
|
|
|
public Response delete(@PathParam(UUID_PARAM) String uuid, @QueryParam(FORCE_RRURL_PARAM) String rrURL) {
|
|
|
|
|
CalledMethodProvider.instance.set(String.format("DELETE /%s/%s/ID", APPLICATION_PATH, CONTEXT_ROOT));
|
|
|
|
|
logger.info("Requested to delete context {} with id {}", Context.NAME, uuid);
|
|
|
|
|
logger.info("Requested to delete context with id {}", uuid);
|
|
|
|
|
logger.info("Force URL: " + rrURL);
|
|
|
|
|
ResponseFromResourceRegistry returned = DeleteRequest.fromUUID(UUID.fromString(uuid)).forceURL(rrURL).submit();
|
|
|
|
|
return this.buildResponse(returned,"Context successfully deleted.","Failed to delete the context.");
|
|
|
|
|