学习 The Floodlight REST API


高级

How can I measure link bandwidth and latency in Floodlight?

如何在Floodlight里测量连接带宽和延时

通过查询 REST API一个端口特征值查询理想化最大连接带宽。用OpenFlow实现的话需要为网络中的交换机建立阶段性的流状态查询,问题是状态不准确 最好的测量是第三方应用

How can I implement VLANs using Floodlight?

VirtualNetworkFilter 可以实现虚拟子网,他建立了虚拟网络并可以为虚拟网络加入主机。Controller使用主机的 mac 地址来绑定所在的虚拟网络,并允许同一虚拟网络内主机交互。 

 

 

Listen Address and Port Configuration 

监听地址和端口配置

在属性文件中使用如下配置参数,可以改变某一特定服务监听的主机地址和端头

net.floodlightcontroller.restserver.RestApiServer.host

net.floodlightcontroller.restserver.RestApiServer.port

net.floodlightcontroller.core.FloodlightProvider.openflowhost

net.floodlightcontroller.core.FloodlightProvider.openflowport

net.floodlightcontroller.jython.JythonDebugInterface.host

net.floodlightcontroller.jython.JythonDebugInterface.port

 

Floodlight自带的默认的属性文件(i.e., floodlightdefault.properties) 只指定了服务端口号 然而服务监听的地址是0.0.0.0/0一次设置为接收所有可能的链接。通过设定openflowhost参数,这一参数也可以影响RestApiServer 以及 JythonDebugInterface 服务的监听地址。可以通过明确这些服务的主机参数来修改RestApiServer 和JythonDebugInterface监听的地址。

Example Configurations

All 3 servers listen on 192.168.1.1:

net.floodlightcontroller.core.FloodlightProvider.openflowhost = 192.168.1.1

All 3 servers listen on different hosts:

net.floodlightcontroller.restserver.RestApiServer.host = 192.168.1.1

net.floodlightcontroller.core.FloodlightProvider.openflowhost = 192.168.1.2

net.floodlightcontroller.jython.JythonDebugInterface.host = 192.168.1.3

 

Controller and REST API server listen on 192.168.1.1, Jython server listens on 192.168.1.2:

net.floodlightcontroller.core.FloodlightProvider.openflowhost = 192.168.1.1

net.floodlightcontroller.jython.JythonDebugInterface.host = 192.168.1.2

 

The Floodlight REST API

 

一个稳定的REST APIA框架很快就会提出。下面总结的API可能会有小小的改变。

REST API是推荐大家使用Floodlight 的特性开发应用的接口, controller.的8080

端口支持API

一个REST调用的例子是:

curl http://192.168.110.2:8080/wm/core/controller/switches/json

通过REST:提供的其他功能有

URI

Method

Description

Arguments参数

/wm/core/switch/all/<statType>/json 

GET

Retrieve aggregate stats across all switches检索统计所有交换机的状态

statType: port, queue, flow, aggregate, desc, table, features 

/wm/core/switch/<switchId>/<statType>/json 

GET

Retrieve per switch stats

检索单个交换机的状态

switchId: Valid Switch DPID (XX:XX:XX:XX:XX:XX:XX:XX) 
statType: port, queue, flow, aggregate, desc, table, features 

/wm/core/controller/switches/json

GET

List of all switch DPIDs connected to the controller

连接 controller的所有交换机的DPIDs列表

none

/wm/core/counter/<counterTitle>/json

GET

List of global traffic counters in the controller (across all switches)

Controller的所有交换机的全局通信数量

counterTitle: "all" or something of the form DPID_Port#OFEventL3/4_Type.  See CounterStore.java for details.

/wm/core/counter/<switchId>/<counterName>/json

GET

List of traffic counters per switch

 

switchId: Valid Switch DPID 
CounterTitle: see above

/wm/core/memory/json 

GET

Current controller memory usage当前controller 内存使用

none

/wm/topology/links/json

GET

List all the inter-switch links. Note that these are only for switches connected to the same controller. This is not available in the 0.8 release.

连接在一个controller上的.交换机之间的连接列表

none

/wm/topology/switchclusters/json

GET

List of all switch clusters connected to the controller. This is not available in the 0.8 release.

连接于 controller上的所有交换机列表

none

/wm/topology/external-links/json

GET

Show "external" links, i.e., multi-hop links discovered by BDDP instead of LLDP packets

显示外部链接比如BDDP而不是LLDP 发现的多跳连接 

none

/wm/topology/links/json

GET

Show DIRECT and TUNNEL links discovered based on LLDP packets

显示基于 LLDP包发现的的DIRECT和TUNNEL连接

none

/wm/device/

GET

List of all devices tracked by the controller. This includes MACs, IPs, and attachment points.

Controller追踪到的所有设备列表含MACs, IPs, and attachment points.

Passed as GET parameters: mac (colon-separated hex-encoded), ipv4 (dotted decimal), vlan, dpid attachment point DPID (colon-separated hex-encoded) and port the attachment point port.

/wm/staticflowentrypusher/json

POST/DELETE

Add/Delete static flow

增加、删除静态流

HTTP POST data (add flow), HTTP DELETE (for deletion)

/wm/staticflowentrypusher/list/<switch>/json

GET

List static flows for a switch or all switches

一个或所有交换机的静态流列表

switch: Valid Switch DPID (XX:XX:XX:XX:XX:XX:XX:XX) or "all"

/wm/staticflowentrypusher/clear/<switch>/json

GET

Clear static flows for a switch or all switches清除一个或所有交换机的静态流列表

switch: Valid Switch DPID (XX:XX:XX:XX:XX:XX:XX:XX) or "all"

  

 More information available on How to Use Static Flow Pusher API

/networkService/v1.1/tenants/<tenant>/networks/<network>

PUT/POST/DELETE

Creates a new virtual network. Name and ID are required, gateway is optional.

生成一个新的虚拟网络,需要Name and ID,网关可选

URI argument: tenant: Currently ignored. network: ID (not name) of the network

HTTP data: {"network": { "gateway": "<IP>", "name": "<Name>" }}
IP: Gateway IP in "1.1.1.1" format, can be null  
Name: N

  • 0
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值