Package org.graylog2.restclient.models

Examples of org.graylog2.restclient.models.Input


    }

    @Override
    public F.Promise<Result> onError(Http.RequestHeader request, Throwable t) {
        if (t.getCause() instanceof Graylog2MasterUnavailableException) {
            final ServerNodes serverNodes = injector.getInstance(ServerNodes.class);
            final List<Node> configuredNodes = serverNodes.getConfiguredNodes();
            final List<Node> nodesEverConnectedTo = serverNodes.all(true);

            return F.Promise.<Result>pure(internalServerError(
                            views.html.disconnected.no_master.render(Http.Context.current(), configuredNodes, nodesEverConnectedTo, serverNodes))
            );
        }
View Full Code Here


*/
public class VersionTest {

    @Test
    public void testGetName() throws Exception {
        assertTrue(new Version(0, 20, 0).toString().startsWith("0.20.0"));
        assertTrue(new Version(1, 0, 0, "preview.1").toString().startsWith("1.0.0-preview.1"));
    }
View Full Code Here

        assertTrue(new Version(1, 0, 0, "preview.1").toString().startsWith("1.0.0-preview.1"));
    }

    @Test
    public void testEquals() throws Exception {
        assertTrue(new Version(0, 20, 0).equals(new Version(0, 20, 0)));
        assertTrue(new Version(0, 20, 0, "preview.1").equals(new Version(0, 20, 0, "preview.1")));
        assertTrue(new Version(1, 2, 3).equals(new Version(1, 2, 3)));

        Version v = new Version(0, 20, 0);
        assertTrue(v.equals(v));

        assertFalse(new Version(0, 20, 0).equals(new Version(0, 20, 1)));
        assertFalse(new Version(0, 20, 0, "preview.1").equals(new Version(0, 20, 0, "preview.2")));
        assertFalse(new Version(0, 20, 0).equals(null));
    }
View Full Code Here

        String fields = Tools.stringSearchParamOrEmpty(request, "fields");
        int width = request.getQueryString("width") == null ? -1 : Integer.valueOf(request.getQueryString("width"));

        String filter = search.getFilter();
        String query = search.getQuery();
        TimeRange timeRange = search.getTimeRange();

        // TODO we desperately need to pass the streamid and then build the filter here, instead of passing the filter and then trying to reassemble the streamid.
        if (filter != null && filter.startsWith("streams:")) {
            return routes.StreamSearchController.index(
                    filter.split(":")[1],
                    query,
                    timeRange.getType().toString().toLowerCase(),
                    relative,
                    from,
                    to,
                    keyword,
                    interval,
                    page,
                    "",
                    sortField,
                    sortOrder,
                    fields,
                    width
            );
        } else {
            return routes.SearchController.index(
                    query,
                    timeRange.getType().toString().toLowerCase(),
                    relative,
                    from,
                    to,
                    keyword,
                    interval,
View Full Code Here

        String to = Tools.stringSearchParamOrEmpty(request, "to");
        String keyword = Tools.stringSearchParamOrEmpty(request, "keyword");
        String fields = Tools.stringSearchParamOrEmpty(request, "fields");

        String query = search.getQuery();
        TimeRange timeRange = search.getTimeRange();

        if (stream == null) {
            return routes.SearchController.exportAsCsv(
                    query,
                    "",
                    timeRange.getType().toString().toLowerCase(),
                    relative,
                    from,
                    to,
                    keyword,
                    fields
            );
        } else {
            return routes.StreamSearchController.exportAsCsv(
                    query,
                    stream.getId(),
                    timeRange.getType().toString().toLowerCase(),
                    relative,
                    from,
                    to,
                    keyword,
                    fields
View Full Code Here

    public Result io(String nodeId, String inputId) {
        try {
            Map<String, Object> result = Maps.newHashMap();

            final Node node = nodeService.loadNode(nodeId);
            final Input input = node.getInput(inputId);
            final Input.IoStats ioStats = input.getIoStats();

            result.put("total_rx", Tools.byteToHuman(ioStats.readBytesTotal));
            result.put("total_tx", Tools.byteToHuman(ioStats.writtenBytesTotal));
            result.put("rx", Tools.byteToHuman(ioStats.readBytes));
            result.put("tx", Tools.byteToHuman(ioStats.writtenBytes));
View Full Code Here

    }

    public Result globaIO(String inputId) {
        Map<String, Object> result = Maps.newHashMap();

        final Input globalInput;
        try {
            globalInput = nodeService.loadMasterNode().getInput(inputId);
            if (!globalInput.getGlobal()) {
                return badRequest();
            }
        } catch (IOException e) {
            log.error("Could not load input.");
            return internalServerError();
View Full Code Here

    public Result connections(String nodeId, String inputId) {
        try {
            Map<String, Object> result = Maps.newHashMap();

            final Node node = nodeService.loadNode(nodeId);
            final Input input = node.getInput(inputId);

            result.put("active", input.getConnections());
            result.put("total", input.getTotalConnections());

            return ok(Json.toJson(result));
        } catch (IOException e) {
            return internalServerError("io exception");
        } catch (APIException e) {
View Full Code Here

    private MessagesService messagesService;

    public Result manage(String nodeId, String inputId) {
        try {
            Node node = nodeService.loadNode(nodeId);
            Input input = node.getInput(inputId);

            return ok(views.html.system.inputs.extractors.manage.render(
                            currentUser(),
                            standardBreadcrumbs(node, input),
                            node,
View Full Code Here

    }

    public Result manageGlobal(String inputId) {
        try {
            Node node = nodeService.loadMasterNode();
            Input input = node.getInput(inputId);

            return ok(views.html.system.inputs.extractors.manage.render(
                            currentUser(),
                            standardBreadcrumbs(node, input),
                            node,
View Full Code Here

TOP

Related Classes of org.graylog2.restclient.models.Input

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.