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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
// systemtap compile-server web api header
// Copyright (C) 2017-2018 Red Hat Inc.
//
// This file is part of systemtap, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
#ifndef __API_H__
#define __API_H__
#include "server.h"
#include <string>
#include <vector>
#include <memory>
extern "C" {
#include "../privilege.h"
#include <json-c/json_object.h>
}
struct file_info
{
std::string name;
std::string pkg;
std::string build_id;
};
class client_request_data
{
public:
~client_request_data();
struct json_object *get_json_object() const;
std::string kver;
std::string arch;
std::string distro_name;
std::string distro_version;
std::vector<std::string> cmd_args;
std::vector<std::string> files;
std::vector<std::shared_ptr<struct file_info> > file_info;
std::vector<std::string> env_vars;
unsigned verbose;
privilege_t privilege;
std::string server_dir;
std::string client_dir;
};
//extern bool
//api_handler(const char *url, const map<string, string> &url_args,
// const char *method, ostringstream &output);
void api_add_request_handlers(server &httpd);
void api_cleanup();
#endif /* __API_H__ */
|