Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

0

Meter Flow

asked 2016-02-20 23:54:48 -0800

aljoby gravatar image

I have a problem with meters. I can add normal flows by REST(using postman) and they work fine. I can see them on the switch and on the controller ( ...restconf/operational/...) but when i create a meter, it gives me success putting in but when i'm going to see it in ..restconf/operational... nothing appears and it gives me error - application data-missing Request could not be completed because the relevant data model content does not exist. It gives me the same error creating an flow using the meter (success-ok) but again when going to see it if it's operational , the same error... what you think it is? thanks

edit retag flag offensive close merge delete

Comments

Hi , i also want to use meter. May i know how did you create meter using RESTCONF? what is the content for sal-meter API? Can you paste it?

karthik330 ( 2016-03-22 23:47:08 -0800 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-03-23 03:14:43 -0800

aljoby gravatar image

updated 2016-03-23 03:17:14 -0800

Hi Karthik330

I have just used meter with RESTCONF flows, not through native jave code with MD-SAL. However, to make metering for specific flow, you may do two things: 1- Define the meter instruction. 2- Include the meter instruction defined in (1) as one of the instructions inside the flow that requires this meter to be achieved.

Example for point (1)

curl --user "admin":"admin" -H "Accept: application/xml" -H "Content-type: application/xml" -X PUT http://localhost:8181/restconf/config... -d

'<meter xmlns="urn:opendaylight:flow:inventory"> <meter-id>1</meter-id> <container-name>mymeter</container-name> <meter-name>mymeter</meter-name> <flags>meter-kbps</flags> <meter-band-headers> <meter-band-header> <band-id>0</band-id> <band-rate>600</band-rate> <meter-band-types> <flags>ofpmbt-drop</flags> </meter-band-types> <band-burst-size>0</band-burst-size> <drop-rate>600</drop-rate> <drop-burst-size>0</drop-burst-size> </meter-band-header> </meter-band-headers> </meter>'

Example for point (2)

curl --user "admin":"admin" -H "Accept: application/xml" -H "Content-type: application/xml" -X PUT http://localhost:8181/restconf/config... -d

'<flow xmlns="urn:opendaylight:flow:inventory"><hard-timeout>0</hard-timeout><idle-timeout>0</idle-timeout><priority>2</priority><flow-name>h2_ping</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ipv4-destination>10.0.0.1/32</ipv4-destination><ip-match><ip-dscp>10</ip-dscp></ip-match></match><id>21</id><table_id>0</table_id><instructions><instruction><order>1</order><apply-actions><action><output-action><output-node-connector>2</output-node-connector></output-action><order>0</order></action></apply-actions></instruction><instruction><order>0</order><meter><meter-id>1</meter-id></meter></instruction></instructions></flow>'

Regards, Walid

edit flag offensive delete publish link more

Comments

Thank u so much @aljoby .. It helped me a lot !!

karthik330 ( 2016-03-24 00:16:48 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2016-02-20 23:54:48 -0800

Seen: 168 times

Last updated: Mar 23 '16