一:推文

软件定义网络基础---REST API概述

软件定义网络基础---REST API的设计规范

二:掌握Ryu基本RESTAPI使用方法

(一)Ryu的RESTAPI

(二) REST应用样例:app/ofctl_rest.py

1.所提供的样例API接口

# REST API
# # Retrieve the switch stats
#
# get the list of all switches
# GET /stats/switches
#
# get the desc stats of the switch
# GET /stats/desc/<dpid>
#
# get flows desc stats of the switch
# GET /stats/flowdesc/<dpid>
#
# get flows desc stats of the switch filtered by the fields
# POST /stats/flowdesc/<dpid>
#
# get flows stats of the switch
# GET /stats/flow/<dpid>
#
# get flows stats of the switch filtered by the fields
# POST /stats/flow/<dpid>
#
# get aggregate flows stats of the switch
# GET /stats/aggregateflow/<dpid>
#
# get aggregate flows stats of the switch filtered by the fields
# POST /stats/aggregateflow/<dpid>
#
# get table stats of the switch
# GET /stats/table/<dpid>
#
# get table features stats of the switch
# GET /stats/tablefeatures/<dpid>
#
# get ports stats of the switch
# GET /stats/port/<dpid>[/<port>]
# Note: Specification of port number is optional
#
# get queues stats of the switch
# GET /stats/queue/<dpid>[/<port>[/<queue_id>]]
# Note: Specification of port number and queue id are optional
# If you want to omitting the port number and setting the queue id,
# please specify the keyword "ALL" to the port number
# e.g. GET /stats/queue//ALL/
#
# get queues config stats of the switch
# GET /stats/queueconfig/<dpid>[/<port>]
# Note: Specification of port number is optional
#
# get queues desc stats of the switch
# GET /stats/queuedesc/<dpid>[/<port>[/<queue_id>]]
# Note: Specification of port number and queue id are optional
# If you want to omitting the port number and setting the queue id,
# please specify the keyword "ALL" to the port number
# e.g. GET /stats/queuedesc//ALL/
#
# get meter features stats of the switch
# GET /stats/meterfeatures/<dpid>
#
# get meter config stats of the switch
# GET /stats/meterconfig/<dpid>[/<meter_id>]
# Note: Specification of meter id is optional
#
# get meter desc stats of the switch
# GET /stats/meterdesc/<dpid>[/<meter_id>]
# Note: Specification of meter id is optional
#
# get meters stats of the switch
# GET /stats/meter/<dpid>[/<meter_id>]
# Note: Specification of meter id is optional
#
# get group features stats of the switch
# GET /stats/groupfeatures/<dpid>
#
# get groups desc stats of the switch
# GET /stats/groupdesc/<dpid>[/<group_id>]
# Note: Specification of group id is optional (OpenFlow 1.5 or later)
#
# get groups stats of the switch
# GET /stats/group/<dpid>[/<group_id>]
# Note: Specification of group id is optional
#
# get ports description of the switch
# GET /stats/portdesc/<dpid>[/<port_no>]
# Note: Specification of port number is optional (OpenFlow 1.5 or later) # Update the switch stats
#
# add a flow entry
# POST /stats/flowentry/add
#
# modify all matching flow entries
# POST /stats/flowentry/modify
#
# modify flow entry strictly matching wildcards and priority
# POST /stats/flowentry/modify_strict
#
# delete all matching flow entries
# POST /stats/flowentry/delete
#
# delete flow entry strictly matching wildcards and priority
# POST /stats/flowentry/delete_strict
#
# delete all flow entries of the switch
# DELETE /stats/flowentry/clear/<dpid>
#
# add a meter entry
# POST /stats/meterentry/add
#
# modify a meter entry
# POST /stats/meterentry/modify
#
# delete a meter entry
# POST /stats/meterentry/delete
#
# add a group entry
# POST /stats/groupentry/add
#
# modify a group entry
# POST /stats/groupentry/modify
#
# delete a group entry
# POST /stats/groupentry/delete
#
# modify behavior of the physical port
# POST /stats/portdesc/modify
#
# modify role of controller
# POST /stats/role
#
#
# send a experimeter message
# POST /stats/experimenter/<dpid>

(三)Ryu官方文档:https://ryu.readthedocs.io/en/latest/app/ofctl_rest.html

三:实验开始

(一)开启Ryu控制器

ryu-manager ofctl_rest.py simple_switch_13.py --observe-links --verbose  #除了使用RESTAPI之外,我们还要保证ryu控制器正常处理交换机逻辑

(二)开启Mininet

sudo mn --controller=remote --mac --topo=tree,,

(三)使用Curl发送URL请求

1.获取到所有交换机Get the list of all switches which connected to the controller.

$ curl -X GET http://localhost:8080/stats/switches

2.获取交换机的描述信息Get the desc stats of the switch which specified with Datapath ID in URI.

$ curl -X GET http://localhost:8080/stats/desc/1

3.其他类似

(四)Postman实验(更美观)

1.安装postman

2.获取交换机信息

最新文章

  1. JDBC增加删除修改
  2. 【JS基础】算法
  3. Codeforces Round #335 (Div. 2)
  4. python自动化运维之路~DAY1
  5. 几款开源的图形化Redis客户端管理软件推荐
  6. [LeetCode#261] Graph Valid Tree
  7. HTML5 ArrayBuffer:类型化数组 (二)
  8. sql server在使用xp_cmdshell
  9. 面向接口可扩展框架之“Mvc扩展框架及DI”
  10. Vulkan Tutorial 05 逻辑设备与队列
  11. 使用tcpcopy复制线上流量进行测试
  12. VBR的部署
  13. 链接PDO
  14. iOS - 视频播放处理全屏/横屏时候遇见的坑
  15. LG1116 【车厢重组】
  16. VisulaVM 性能:分析 JVM 性能的免费工具
  17. android面试(1)----布局
  18. 001杰信-创建MyEclipse与maven项目
  19. WeQuant交易策略—EMV
  20. UTF-8 与 BIG-5 转码

热门文章

  1. 技术分享 | mysql 表数据校验
  2. Dapper: How to get return value ( output value) by call stored procedure
  3. 个人推荐的Java邮件配置
  4. Vuex之store仓库计算属性Getter
  5. HTML5游戏引擎深度测评
  6. LeetCode 1249. Minimum Remove to Make Valid Parentheses
  7. Python爬虫 | Selenium详解
  8. 关于singer elt 的几篇很不错的文章
  9. youtube 下载视频插件
  10. Fix multiple GPUs fails in training Mask_RCNN