当前位置: 首页 > news >正文

网站虚拟主机公司全球虚拟主机论坛

网站虚拟主机公司,全球虚拟主机论坛,华为云建站官网,永康电子商务网站建设公司1.说明 本节是厘清openbmc的界面层web或者redfish到底层数据获取与展示。 不可或缺的是先阅读官方关于redfish的设计文档: 1.https://github.com/openbmc/docs/blob/master/designs/redfish-authorization.md2.https://github.com/openbmc/docs/blob/master/designs/redfish…1.说明 本节是厘清openbmc的界面层web或者redfish到底层数据获取与展示。 不可或缺的是先阅读官方关于redfish的设计文档: 1.https://github.com/openbmc/docs/blob/master/designs/redfish-authorization.md2.https://github.com/openbmc/docs/blob/master/designs/redfish-postcodes.md3.https://github.com/openbmc/docs/blob/master/development/web-ui.md 需要注意的是官方的文档一定要细读与分析背后的设计。 2.代码简单流程分析 2.1 大致总体流程 代码包包含web和redfish均在bmcweb中可以使用如下命令抽取代码: # devtool modify bmcweb调用关系如下: (bmcweb/src/webserver_main.cpp) int main(int /*argc*/, char** /*argv*/) noexcept(false) --- run() (bmcweb/src/webserver_run.cpp)--- server.add_interface(/xyz/openbmc_project/bmcweb,xyz.openbmc_project.bmcweb);--- if constexpr (BMCWEB_REDFISH)--- redfish::RedfishService redfish(app);--- redfish::EventServiceManager::getInstance(*io);--- crow::login_routes::requestRoutes(app);--- app.run();--- systemBus-request_name(xyz.openbmc_project.bmcweb);--- io-run();redfish()定义在文件bmcweb/redfish-core/src/redfish.cpp中关系如下: RedfishService::RedfishService(App app) --- requestRoutesMetadata(app); --- requestRoutesOdata(app); --- requestAccountServiceRoutes(app); --- requestRoutesRoles(app); --- ... --- requestRoutesManager(app); --- ... --- requestRoutesSystemsLogServicesPostCode(app); --- ... --- requestRoutesRedfish(app);因此如果需要添加自己的redfish功能可以在这里添加顶层函数功能。 拿一个函数调用:requestRoutesManager(app)举例: (bmcweb/redfish-core/lib/managers.hpp) inline void requestRoutesManager(App app) --- BMCWEB_ROUTE(app, /redfish/v1/Managers/str/)...调用返回数据。 2.2 web与redfish结合 openbmc的web与redfish怎么结合去服务用户呢 web理解就是前端展现给用户的网页redfish其实是与web进行沟通所以openbmc设计理念是redfish(bmcweb)作为后台与web(web-vue)作为前端搭配起来使用的。 顺便提一下openbmc是使用nghttp2作为web server的。 举一个简单例子在前端js中获取数据: async getChassisCollection() { --- ... --- .get(/redfish/v1/Chassis)2.3 针对官方文档简单分析一个例子 这一部分针对官方文档的内容看一下例子。 官方文档如下: https://github.com/openbmc/docs/blob/master/designs/redfish-postcodes.md 该文档说的bios postcode的事情可以找到代码位置: bmcweb/redfish-core/lib/systems_logservices_postcodes.hpp bmcweb/redfish-core/src/redfish.cpp在文件bmcweb/redfish-core/src/redfish.cpp中调用函数requestRoutesSystemsLogServicesPostCode()在文件bmcweb/redfish-core/lib/systems_logservices_postcodes.hpp中定义了函数:requestRoutesSystemsLogServicesPostCode(): inline void requestRoutesSystemsLogServicesPostCode(App app) --- BMCWEB_ROUTE(app, /redfish/v1/Systems/str/LogServices/PostCodes/)... --- BMCWEB_ROUTE(app,/redfish/v1/Systems/str/LogServices/PostCodes/Actions/LogService.ClearLog/) --- BMCWEB_ROUTE(app,/redfish/v1/Systems/str/LogServices/PostCodes/Entries/) --- BMCWEB_ROUTE(app, /redfish/v1/Systems/str/LogServices/PostCodes/Entries/str/) --- BMCWEB_ROUTE(app,/redfish/v1/Systems/str/LogServices/PostCodes/Entries/str/attachment/)比较关心的是对于设置操作如何处理。可以看到调用的是函数handleSystemsLogServicesPostCodesPost(): inline void handleSystemsLogServicesPostCodesPost() --- crow::connections::systemBus-async_method_call(..,xyz.openbmc_project.State.Boot.PostCode0, /xyz/openbmc_project/State/Boot/PostCode0, xyz.openbmc_project.Collection.DeleteAll, DeleteAll);因此采取的就是一种函数调用的办法去处理的。 2.4 web获取后台数据的例子 这一节借一个web例子可以看到web和后台是怎么交互的。 例如在web下可以看到如下内容: 因此明显看到后台以(redfish)json数据呈现给webweb解析即可。
http://www.dnsts.com.cn/news/265214.html

相关文章:

  • 免费行情网站推荐免费网站建设可信吗
  • 工商局网站建设方案四川省住房建设厅网站打不开
  • 局域网站开发三网合一网站建设报价
  • 教育机构排名全国十大教育机构排名北京seo案例
  • 长沙cms模板建站o2o网站 方案
  • 郑州哪家做网站便宜选择热门网站做推广的原因
  • 做网站后有人抢注品牌关键字广告文案策划
  • 路由器做php网站吗510企业网站系统源码
  • 芭乐站长统计 网站统计设计公司企业愿景
  • 年终总结ppt模板免费下载网站网站优化 合同
  • 凡科网站备案在线网页制作系统小彬
  • 松江网站设计cmsv6官方免费下载
  • 常州网站建设段新浩简单的wordpress模板下载
  • 要学做游戏上什么网站学好怎样手机做网站教程
  • 网站建设电话营销做家纺的网站
  • 建视频网站系统吗南京网站建设润洽
  • 网站建设可行性方案模板wordpress读取速度慢
  • 摄影做网站网站建设与管理 ppt模板
  • 手机网站大全12345wordpress网页实时更新数据
  • 企业网站优化与推广做网站和优化的公司
  • 做网站从哪里做网站更新了域名如何找到
  • 网站的建设模式是指什么如何接推广的单子
  • 专业做网站哪家便宜网站建设洛阳
  • 帝国cms做门户网站小程序开发平台哪家产品好
  • 企业网站建设费在会计上怎么做好网络推广销售
  • 广东网站建设怎么选网站建设需要哪些技术人员
  • html5网站价格开设类似于京东商城这类购物网站
  • 网站做edi认证有用没公众号怎么开通申请
  • 织梦网站最新漏洞入侵建筑网校排行榜
  • 过年做那些网站致富wordpress指定分类文章作者时间