FLOW API 格式紀錄 XML or JSON
http://IP_ADDR:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/10
Method : PUT or DELETE
Content-Type application/xml
Accept application/xml
Authorization blah__blah_blah
XML
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>
<flow xmlns=”urn:opendaylight:flow:inventory”>
<instructions>
<instruction>
<order>0</order>
<apply-actions>
<action>
<order>0</order>
<drop-action/>
</action>
</apply-actions>
</instruction>
</instructions>
<table_id>0</table_id>
<id>10</id>
<cookie_mask>255</cookie_mask>
<installHw>true</installHw>
<match>
<ethernet-match>
<ethernet-type>
<type>2048</type>
</ethernet-type>
</ethernet-match>
<ipv4-source>10.0.0.1/32</ipv4-source>
<in-port>1</in-port>
</match>
<idle-timeout>0</idle-timeout>
<hard-timeout>0</hard-timeout>
<cookie>0</cookie>
<flow-name>test</flow-name>
<priority>99</priority>
</flow>
JSON
{
“flow”:
{
“instructions”:
{
“instruction”:
{
“order”: “0”,
“apply-actions”:
{
“action”:
{
“order”: “0”,
“drop-action”: {}
}
}
}
},
“table_id”: “0”,
“id”: “10”,
“cookie_mask”: “255”,
“installHw”: “true”,
“match”:
{
“ethernet-match”:
{
“ethernet-type”: { “type”: “2048” }
},
“ipv4-source”: “10.0.0.1/32”,
“in-port”: “1”
},
“idle-timeout”: “0”,
“hard-timeout”: “0”,
“cookie”: “0”,
“flow-name”: “test”,
“priority”: “97”
}
}
<ipv4-source>必須要有網路遮罩 /32故等於單個IP
<idle-timeout> 閒置未使用時間 0視為無限
<hard-timeout> 應該是最大時間 0視為無限
<drop-action/> 就是DROP
<table_id>與<id> 需要分別對應URL的 table_id以及flow_id
其他設定參考下列網址
https://wiki.opendaylight.org/view/Editing_OpenDaylight_OpenFlow_Plugin:End_to_End_Flows:Example_Flows
其他可用API Documentation
http://IP_ADDR:8181/apidoc/explorer/index.html
搶先發佈留言