blob: 37f5e0d4d229ef01c22441de19d733bf776f2c60 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "json_get_handler.h"
#include "state_explorer.h"
#include <vespa/vespalib/stllike/string.h>
#include <vector>
#include <map>
namespace vespalib {
/**
* An implementation of the json get handler interface that exposes
* the state represented by the given state explorer as a browsable
* REST sub-API located below the given root path.
**/
class GenericStateHandler : public JsonGetHandler
{
private:
std::vector<vespalib::string> _root;
const StateExplorer &_state;
public:
GenericStateHandler(const vespalib::string &root_path, const StateExplorer &state);
Response get(const vespalib::string &host,
const vespalib::string &path,
const std::map<vespalib::string,vespalib::string> ¶ms,
const net::ConnectionAuthContext &auth_ctx) const override;
};
} // namespace vespalib
|