Search in sources :

Example 11 with Container

use of org.batfish.common.Container in project batfish by batfish.

the class ContainerResource method getContainer.

/**
 * Returns information about the given {@link Container}, provided this user can access it.
 */
@GET
public Response getContainer() {
    _logger.infof("WMS2: getContainer '%s'\n", _name);
    checkAccessToContainer();
    Container container = Main.getWorkMgr().getContainer(_name);
    return Response.ok(container).build();
}
Also used : Container(org.batfish.common.Container) GET(javax.ws.rs.GET)

Example 12 with Container

use of org.batfish.common.Container in project batfish by batfish.

the class Client method getContainer.

/**
 * Get information of the container (first element in {@code parameters}).
 *
 * <p>Returns {@code true} if successfully get container information, {@code false} otherwise
 */
private boolean getContainer(List<String> options, List<String> parameters) {
    if (!isValidArgument(options, parameters, 0, 1, 1, Command.GET_CONTAINER)) {
        return false;
    }
    String containerName = parameters.get(0);
    Container container = _workHelper.getContainer(containerName);
    if (container != null) {
        _logger.output(container.getTestrigs() + "\n");
        return true;
    }
    return false;
}
Also used : Container(org.batfish.common.Container)

Aggregations

Container (org.batfish.common.Container)12 Response (javax.ws.rs.core.Response)7 Path (java.nio.file.Path)5 BatfishException (org.batfish.common.BatfishException)5 Test (org.junit.Test)5 IOException (java.io.IOException)4 Nullable (javax.annotation.Nullable)4 ProcessingException (javax.ws.rs.ProcessingException)4 WebTarget (javax.ws.rs.client.WebTarget)4 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 ObjectWriter (com.fasterxml.jackson.databind.ObjectWriter)3 ImmutableSortedSet (com.google.common.collect.ImmutableSortedSet)3 ActiveSpan (io.opentracing.ActiveSpan)3 References (io.opentracing.References)3 SpanContext (io.opentracing.SpanContext)3 GlobalTracer (io.opentracing.util.GlobalTracer)3 InputStream (java.io.InputStream)3 Files (java.nio.file.Files)3 Paths (java.nio.file.Paths)3 Instant (java.time.Instant)3