Package org.graylog2.plugin.configuration

Examples of org.graylog2.plugin.configuration.ConfigurationRequest


        final String userName = credString[0];
        final String password = credString[1];

        try {
            SessionCreateResponse session = sessionService.create(userName, password, request.remoteAddress());
            return userService.retrieveUserWithSessionId(userName, session.sessionId);
        } catch (IOException e) {
            log.error("Could not reach graylog2 server", e);
        } catch (APIException e) {
            log.error("Unauthorized to load user " + userName, e);
View Full Code Here


    private SplitAndIndexTest(ApiClient api) {
        this.api = api;
    }

    public Map<String, Object> test(String splitBy, int index, String string) throws IOException, APIException {
        SplitAndIndexTestResponse r = api.get(SplitAndIndexTestResponse.class)
                .path("/tools/split_and_index_tester")
                .queryParam("split_by", splitBy)
                .queryParam("index", index)
                .queryParam("string", string)
                .execute();
View Full Code Here

    private SubstringTest(ApiClient api) {
        this.api = api;
    }

    public Map<String, Object> test(int start, int end, String string) throws IOException, APIException {
        SubstringTestResponse r = api.get(SubstringTestResponse.class)
                .path("/tools/substring_tester")
                .queryParam("begin_index", start)
                .queryParam("end_index", end)
                .queryParam("string", string)
                .execute();
View Full Code Here

            int time = (alertCondition.getParameters().get("time") == null ? 0 : Integer.parseInt(alertCondition.getParameters().get("time").toString()));
            int grace = (alertCondition.getParameters().get("grace") == null ? 0 : Integer.parseInt(alertCondition.getParameters().get("grace").toString()));
            int since = Math.round(new DateTime().minusMinutes((time + grace == 0 ? 1 : time + grace)).getMillis()/1000);
            total += getAlertsInformation(since).alerts.size();
        }*/
        CheckConditionResponse response = streamService.activeAlerts(this.getId());
        int size = (response.results == null ? 0 : response.results.size());

        return size;
    }
View Full Code Here

        }
        assertNotNull("Should have thrown an Graylog2ServerUnavailableException", t);
        assertEquals("First node failure count should be 1", 1, firstNode.getFailureCount());

        final Node.Factory nodeFactory = injector.getInstance(Node.Factory.class);
        final NodeSummaryResponse r1 = new NodeSummaryResponse();
        r1.transportAddress = "http://localhost:65534";
        r1.id = UUID.randomUUID().toString();

        final Node newNode = nodeFactory.fromSummaryResponse(r1);
        newNode.touch();
        final NodeSummaryResponse r2 = new NodeSummaryResponse();
        r2.transportAddress = firstNode.getTransportAddress();
        r2.id = firstNode.getNodeId();
        final Node sameAsInitialNode = nodeFactory.fromSummaryResponse(r2);
        sameAsInitialNode.touch();
        serverNodes.put(ImmutableList.of(newNode, sameAsInitialNode));
View Full Code Here

    }

    public void registerNodes(ServerNodes serverNodes, Node.Factory factory, AddressNodeId[] nodeDesc) {
        final ArrayList<Node> nodes = Lists.newArrayList();
        for (AddressNodeId n : nodeDesc) {
            NodeSummaryResponse r = new NodeSummaryResponse();
            r.transportAddress = n.address;
            r.id = n.nodeId;
            final Node node = factory.fromSummaryResponse(r);
            node.touch();
            nodes.add(node);
View Full Code Here

        return streamFactory.fromSummaryResponse(streamResponse);
    }

    public String create(CreateStreamRequest request) throws APIException, IOException {
        CreateStreamResponse csr = api.path(resource.create(), CreateStreamResponse.class)
                .body(request).expect(Http.Status.CREATED).execute();
        return csr.streamId;
    }
View Full Code Here

                .body(request).expect(Http.Status.OK).execute();
        return testMatchResponse;
    }

    public String cloneStream(String streamId, CreateStreamRequest request) throws APIException, IOException {
        CreateStreamResponse csr = api.path(resource.cloneStream(streamId), CreateStreamResponse.class)
                .body(request).expect(Http.Status.CREATED).execute();
        return csr.streamId;
    }
View Full Code Here

        this.streamFactory = streamFactory;
        this.outputFactory = outputFactory;
    }

    public List<Stream> all() throws IOException, APIException {
        GetStreamsResponse r = null;
        r = api.path(resource.get(), GetStreamsResponse.class).execute();

        List<Stream> streams = Lists.newArrayList();

        for (StreamSummaryResponse stream : r.streams) {
View Full Code Here

        //return new StreamsResult(r.total, r.streams);
        return streams;
    }

    public List<Stream> allEnabled() throws IOException, APIException {
        GetStreamsResponse r = null;
        r = api.path(resource.getEnabled(), GetStreamsResponse.class).execute();

        List<Stream> streams = Lists.newArrayList();

        for (StreamSummaryResponse stream : r.streams) {
View Full Code Here

TOP

Related Classes of org.graylog2.plugin.configuration.ConfigurationRequest

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.