summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2019-02-09 08:46:59 -0800
committerJames E. Blair <jeblair@redhat.com>2019-02-09 08:46:59 -0800
commit0101e1cd39f27a23bf4603d49103d34d35d14202 (patch)
tree8fe179ec9b31f8a93c836fa70fec587faaaa9a8d
parent1dbacebd70be8c67edb98356b1c0b49031d3385a (diff)
Use restclient to load a zuul build
-rw-r--r--zuul-preview/main.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/zuul-preview/main.cc b/zuul-preview/main.cc
index 5b7dc5b..9166198 100644
--- a/zuul-preview/main.cc
+++ b/zuul-preview/main.cc
@@ -18,22 +18,20 @@
18 */ 18 */
19 19
20#include <config.h> 20#include <config.h>
21
22#include <pthread.h> 21#include <pthread.h>
23
24#include <json.hpp> 22#include <json.hpp>
23#include <restclient-cpp/restclient.h>
25 24
26// for convenience 25// for convenience
27using json = nlohmann::json; 26using json = nlohmann::json;
28
29using namespace std; 27using namespace std;
30 28
31
32int main(int, char**) 29int main(int, char**)
33{ 30{
34 json j; 31
35 j["pi"] = 3.14; 32 RestClient::Response r = RestClient::get("http://zuul.opendev.org/api/tenant/openstack/build/75031cad206c4014ad7a3387091d15ab");
36 j["happy"] = true; 33
34 json j = json::parse(r.body);
37 35
38 cout << j.dump(4) << endl; 36 cout << j.dump(4) << endl;
39} 37}