import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
import org.codehaus.enunciate.jaxrs.ResponseCode;
import org.codehaus.enunciate.jaxrs.StatusCodes;
@ResponseCode(code = 409, condition = "Unable to update configuration due to cluster conflict or conflicting description property"),
@ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
public Response addNodeProperty(
+ @Context UriInfo uriInfo,
@PathParam("containerName") String containerName,
@PathParam("nodeType") String nodeType,
@PathParam("nodeId") String nodeId,
SwitchConfig newSwitchConfig = new SwitchConfig(node.toString(), nodeProperties);
Status status = switchManager.updateNodeConfig(newSwitchConfig);
if (status.isSuccess()) {
- return Response.status(Response.Status.CREATED).build();
+ return Response.created(uriInfo.getRequestUri()).build();
}
return NorthboundUtils.getResponse(status);
}
@ResponseCode(code = 409, condition = "Unable to add property due to cluster conflict"),
@ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
public Response addNodeConnectorProperty(
+ @Context UriInfo uriInfo,
@PathParam("containerName") String containerName,
@PathParam("nodeType") String nodeType,
@PathParam("nodeId") String nodeId,
Status ret = switchManager.addNodeConnectorProp(nc, prop);
if (ret.isSuccess()) {
- return Response.status(Response.Status.CREATED).build();
+ return Response.created(uriInfo.getRequestUri()).build();
}
throw new InternalServerErrorException(ret.getDescription());
}