Browse Source

Use restclient to load a zuul build

changes/91/636791/1
James E. Blair 3 months ago
parent
commit
0101e1cd39
1 changed files with 5 additions and 7 deletions
  1. 5
    7
      zuul-preview/main.cc

+ 5
- 7
zuul-preview/main.cc View File

@@ -18,22 +18,20 @@
18 18
  */
19 19
 
20 20
 #include <config.h>
21
-
22 21
 #include <pthread.h>
23
-
24 22
 #include <json.hpp>
23
+#include <restclient-cpp/restclient.h>
25 24
 
26 25
 // for convenience
27 26
 using json = nlohmann::json;
28
-
29 27
 using namespace std;
30 28
 
31
-
32 29
 int main(int, char**)
33 30
 {
34
-  json j;
35
-  j["pi"] = 3.14;
36
-  j["happy"] = true;
31
+
32
+  RestClient::Response r = RestClient::get("http://zuul.opendev.org/api/tenant/openstack/build/75031cad206c4014ad7a3387091d15ab");
33
+
34
+  json j = json::parse(r.body);
37 35
 
38 36
   cout << j.dump(4) << endl; 
39 37
 }

Loading…
Cancel
Save