2 //using namespace xapp;
8 void Bouncer::set_gnb(){
9 cpprestclient obj("http://service-ricplt-e2mgr-http.ricplt:3800");
11 res=obj.do_get("/v1/nodeb/states");
12 NodebListHandler handler;
14 if( res.status_code == 200 )
17 //StringStream ss( res.body.dump().c_str() );
18 //reader.Parse( ss, handler );
19 //std::cout << "[INFO] nodeb list is " << res.body.dump().c_str() << std::endl;
20 std::cout << "[INFO] nodeb list is " << res.body<< std::endl;
21 std::vector<std::string> inventoryNames;
22 std::cout <<"pol"<<std::endl;
23 for (const auto& item : res.body)
26 std::string inventoryName = item["inventoryName"];
27 this->gnb_list.push_back(inventoryName);
34 if( res.body.empty() )
36 std::cout << "[ERROR] Unexpected HTTP code " << res.status_code << std::endl;
41 std::cout << "[ERROR] Unexpected HTTP code " << res.status_code <<" HTTP payload is " << res.body.dump().c_str() << std::endl;
45 //this->gnb_list= handler.nodeb_list;