Floodlight--REST-API控制器接口

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

TheFloodlightRESTAPITheRESTAPIistherecommendedinterfacetodevelopapplicationsutilizingFloodlightsupportedfeatures.FortheRESTcallsthatuseswitchDPID,youcanobtainitfromfloodlightUI.Afterthefloodlightisupandrunning,youcangotoyourbrowserandtypeinaURLasfollows(Replace192.168.110.2withtheproperinetaddress).WhilethefunctionsavailableinthisAPIareevolving,severalkeyfunctionsaresupportedtoday.TheAPIisavailableatport8080ofthecontroller.AnexampleRESTcallis:curl:URIMethodDescriptionArguments/wm/core/switch/all/statType/jsonGETRetrieveaggregatestatsacrossallswitchesstatType:port,queue,flow,aggregate,desc,table,features/wm/core/switch/switchId/statType/jsonGETRetrieveperswitchstatsswitchId:ValidSwitchDPID(XX:XX:XX:XX:XX:XX:XX:XX)statType:port,queue,flow,aggregate,desc,table,features/wm/core/controller/switches/jsonGETListofallswitchDPIDsconnectedtothecontrollernone/wm/core/controller/summary/jsonGETControllersummary(#ofSwitches,#ofLinks,etc)none/wm/core/counter/counterTitle/jsonGETListofglobaltrafficcountersinthecontroller(acrossallswitches)counterTitle:allorsomethingoftheformDPID_COUNTER_NAME_SUB_CATEGORYie.00:00:00:00:00:00:00:01_OFPacketIn_broadcast(SUB_CATEGORYbeingbroadcast)00:00:00:00:00:00:00:01_OFPacketIn_L3_ARP(SUB_CATEGORYbeingL3_ARP)L3sub_categoriestaketheformL3_ether-type,L4sub_categoriestaketheformL4_protocolFormoredetailslookatnet.floodlightcontroller.counter.CounterStore.java/wm/core/counter/switchId/counterName/jsonGETListoftrafficcountersperswitchswitchId:ValidSwitchDPIDCounterTitle:seeabove/wm/core/memory/jsonGETCurrentcontrollermemoryusagenone/wm/core/health/jsonGETStatus/HealthofRESTAPInone/wm/core/systen/uptime/jsonGETControlleruptimenone/wm/topology/links/jsonGETListalltheinter-switchlinks.Notethattheseareonlyforswitchesconnectedtothesamecontroller.noneThisisnotavailableinthe0.8release./wm/topology/switchclusters/jsonGETListofallswitchclustersconnectedtothecontroller.Thisisnotavailableinthe0.8release.none/wm/topology/external-links/jsonGETShowexternallinks,i.e.,multi-hoplinksdiscoveredbyBDDPinsteadofLLDPpacketsnone/wm/topology/links/jsonGETShowDIRECTandTUNNELlinksdiscoveredbasedonLLDPpacketsnone/wm/device/GETListofalldevicestrackedbythecontroller.ThisincludesMACs,IPs,andattachmentpoints.PassedasGETparameters:mac(colon-separatedhex-encoded),ipv4(dotteddecimal),vlan,dpidattachmentpointDPID(colon-separatedhex-encoded)andporttheattachmentpointport./wm/staticflowentrypusher/jsonPOST/DELETEAdd/DeletestaticflowHTTPPOSTdata(addflow),HTTPDELETE(fordeletion)/wm/staticflowentrypusher/list/switch/jsonGETListstaticflowsforaswitchorallswitchesswitch:ValidSwitchDPID(XX:XX:XX:XX:XX:XX:XX:XX)orall/wm/staticflowentrypusher/clear/switch/jsonGETClearstaticflowsforaswitchorallswitchesswitch:ValidSwitchDPID(XX:XX:XX:XX:XX:XX:XX:XX)orallMoreinformationavailableonHowtoUseStaticFlowPusherAPI/networkService/v1.1/tenants/tenant/networks/networkPUT/POST/DELETECreatesanewvirtualnetwork.NameandIDarerequired,gatewayisoptional.URIargument:tenant:Currentlyignored.network:ID(notname)ofthenetworkHTTPdata:{network:{gateway:IP,name:Name}}IP:GatewayIPin1.1.1.1format,canbenullName:Networknameasstring/networkService/v1.1/tenants/tenant/networks/network/ports/port/attachmentPUT/DELETEAttachesahosttoavirtualnetwork.URIargument:tenant:Currentlyignored.network:ID(notname)ofthenetwork.port:LogicalportnameHTTPdata:{attachment:{id:NetworkID,mac:MAC}}NetworkID:NetworkIDasstring,theoneassignedatcreateMAC:MACaddressinXX:XX:XX:XX:XX:XXformat/networkService/v1.1/tenants/tenant/networksGETShowsallnetworksandtheirgateway,ID,andhostsmacinURIargument:tenant:Currentlyignored.jsonformat.MoreinformationavailableonVirtualNetworkFilterRESTAPI/wm/firewall/module/op/jsonGETquerythestatusof,enable,anddisablethefirewall/wm/firewall/rules/jsonGET/POST/DELETEGET:NonePOST:{field1:value1,field2:value2,...}DELETE:{ruleid:int}ListallexistingrulesinjsonformatCreatenewfirewallruleDeletearulebyruleidfield:valuepairsbelowinanyorderandcombination:switchid:xx:xx:xx:xx:xx:xx:xx:xx,src-inport:short,src-mac:xx:xx:xx:xx:xx:xx,dst-mac:xx:xx:xx:xx:xx:xx,dl-type:ARPorIPv4,src-ip:A.B.C.D/M,dst-ip:A.B.C.D/M,nw-proto:TCPorUDPorICMP,tp-src:short,tp-dst:short,priority:int,action:ALLOWorDENYruleid:intMoreinformationavailableonFirewallRESTAPIForFloodlightdevelopers,checkouthowtoaddnewRESTAPIstoFloodlightservicesatHowtoAddServicestoaModule.FirewallRESTAPIAddedbyKuang-ChingWang,lasteditedbyJasonParragaonJun12,2013(viewchange)FirewallRESTInterfaceTheFirewallModuleexposesRESTinterfaceimplementedasRestletRoutableusingRestAPIService.FollowingisalistofRESTmethodsexposed:URIMethodURIArgumentsDataDataFieldsDescription/wm/firewall/module/op/jsonGETop:status,enable,disable,storageRules,subnet-maskNoneNonequerythestatusof,enable,anddisablethefirewall/wm/firewall/rules/jsonGETNoneNoneNoneLis

1 / 9
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功