2016-09-19 57 views
0

我想通過下面的RPC調用來獲取統計信息,而不是通過默認的統計管理器。OpenDaylight使用RPC調用的流量統計

POST/restconf/operations/opendaylight - flow - statistics: get - all - flows - statistics - from - all - flow - tables { 
    "input": { 
     "node": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id=\"openflow:1000\"]" 
    } 
} 

但是,該請求的響應僅爲transaction-id。雖然我可以看到OpenFlow Flow Stat RequestFlow Stat Reply消息在控制器和交換機之間交換,但操作數據存儲似乎不會因調用上述RPC而更新。

GET /restconf/operational/opendaylight-inventory:nodes/node/openflow:1000/table/0 

我的問題是::

  • 我怎樣才能通過交換機發送到控制器上面RPC(get-all-flows-statistics-from-all-flow-tables)的結果的流量統計我使用檢查操作數據存儲?爲什麼操作數據存儲沒有更新?

謝謝!邁克爾。

回答

1

使用硼,您正在嘗試使用已經過時的東西,因此你應該使用下列內容:

  1. 安裝odl-openflowplugin-flow-services
  2. 連接交換機
  3. 發送以下請求:
POST /restconf/operations/opendaylight-direct-statistics:get-node-connector-statistics 
    Host: localhost:8181 
    Content-Type: application/json 
    Authorization: Basic YWRtaW46YWRtaW4= 

    { 
     "input": 
     { 
      "node" : "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id=\"openflow:187811733353539\"]" , 
      "store-stats" : false 
     } 
    } 
  1. 將商店統計信息設置爲true如果您想將它們保留在數據存儲中。

您還可以得到統計數據僅限於指定的端口,但在嘗試,但似乎沒有很好地工作 此添加到上述有效載荷:

"node-connector-id" : "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id=\"openflow:187811733353539\"]/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:187811733353539:LOCAL']", 

相反的LOCAL,指定你想要的端口。

希望這會有所幫助, Alexis