X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=Bouncer%2Fsrc%2Fbouncer.cpp;fp=Bouncer%2Fsrc%2Fbouncer.cpp;h=bae582005389de551e12c843e0a0c878edb53688;hb=fbc7e3ad84fc7269233a2f0b5d416cb1c6f8a6ea;hp=0000000000000000000000000000000000000000;hpb=eb27c05c05b5042d115480c40cffa16e7d473d80;p=ric-app%2Fbouncer.git diff --git a/Bouncer/src/bouncer.cpp b/Bouncer/src/bouncer.cpp new file mode 100644 index 0000000..bae5820 --- /dev/null +++ b/Bouncer/src/bouncer.cpp @@ -0,0 +1,48 @@ +#include"bouncer.h" +//using namespace xapp; + +Bouncer::Bouncer(){ + set_gnb(); +} + +void Bouncer::set_gnb(){ + cpprestclient obj("http://service-ricplt-e2mgr-http.ricplt:3800"); + response_t res; + res=obj.do_get("/v1/nodeb/states"); + NodebListHandler handler; + + if( res.status_code == 200 ) + { + //Reader reader; + //StringStream ss( res.body.dump().c_str() ); + //reader.Parse( ss, handler ); + //std::cout << "[INFO] nodeb list is " << res.body.dump().c_str() << std::endl; + std::cout << "[INFO] nodeb list is " << res.body<< std::endl; + std::vector inventoryNames; + std::cout <<"pol"<gnb_list.push_back(inventoryName); + } + + } + + else + { + if( res.body.empty() ) + { + std::cout << "[ERROR] Unexpected HTTP code " << res.status_code << std::endl; + } + + else + { + std::cout << "[ERROR] Unexpected HTTP code " << res.status_code <<" HTTP payload is " << res.body.dump().c_str() << std::endl; + } + } + + //this->gnb_list= handler.nodeb_list; + +} +