Kagome
Polkadot Runtime Engine in C++17
health.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_API_SYSTEM_REQUEST_HEALTH
7 #define KAGOME_API_SYSTEM_REQUEST_HEALTH
8 
9 #include <jsonrpc-lean/request.h>
10 
11 #include "outcome/outcome.hpp"
12 
13 namespace kagome::api {
14  class SystemApi;
15 }
16 
18 
23  class Health final {
24  public:
25  Health(const Health &) = delete;
26  Health &operator=(const Health &) = delete;
27 
28  Health(Health &&) = default;
29  Health &operator=(Health &&) = default;
30 
31  explicit Health(std::shared_ptr<SystemApi> api);
32  ~Health() = default;
33 
34  outcome::result<void> init(const jsonrpc::Request::Parameters &params);
35 
36  outcome::result<jsonrpc::Value::Struct> execute();
37 
38  private:
39  std::shared_ptr<SystemApi> api_;
40  };
41 
42 } // namespace kagome::api::system::request
43 
44 #endif // KAGOME_API_SYSTEM_REQUEST_HEALTH
Return health status of the node.
Definition: health.hpp:23
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
Definition: health.cpp:17
std::shared_ptr< SystemApi > api_
Definition: health.hpp:39
Health & operator=(const Health &)=delete
outcome::result< jsonrpc::Value::Struct > execute()
Definition: health.cpp:25