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

REST XML syntax documentation

asked 2015-01-28 13:45:07 -0800

whabeck gravatar image

Does anyone know where to find documentation and/or examples for using XML to program flows? I am using Postman to push flows to a Helium controller.

The ODL Wiki has the following page: http://goo.gl/HnRcQd

This shows examples, but mostly for Matching and not Actions. There must be something out there, but I have not been able to find it.

Example... I need to set the VLAN ID as an action, but cannot find how to do this.

Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-01-29 01:50:11 -0800

mawil gravatar image

There are other examples in the Openflowplugin repository. You can clone the repository with:

git clone https://git.opendaylight.org/gerrit/p/openflowplugin.git

The examples are used for Openflowplugin test-scripts and located in "test-scripts" -> "xmls". If you want to push a vlan id, you can look at "test-scripts" -> "xmls" -> "f110.xml"

For example (quoting from f110.xml):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
    <strict>false</strict>
    <flow-name>push-vlan-action</flow-name>
    <id>256</id>
    <cookie_mask>255</cookie_mask>
    <cookie>201</cookie>
    <table_id>2</table_id>
    <priority>2</priority>
    <hard-timeout>1200</hard-timeout>
    <idle-timeout>3400</idle-timeout>
    <installHw>false</installHw>
    <instructions>
        <instruction>
            <order>0</order>
            <apply-actions>
                <action>
                    <order>0</order>
                    <push-vlan-action>
                        <ethernet-type>33024</ethernet-type>
                        <vlan-id>1234</vlan-id>
                    </push-vlan-action>
                </action>
            </apply-actions>
        </instruction>
    </instructions>
    <match>
        <ethernet-match>
            <ethernet-type>
                <type>34525</type>
            </ethernet-type>
        </ethernet-match>
        <ipv6-source>1234:5678:9ABC:DEF0:FDCD:A987:6543:210F/76</ipv6-source>
        <ipv6-destination>fe80:2acf:e9ff:fe21::6431/94</ipv6-destination>
        <ip-match>
            <ip-protocol>6</ip-protocol>
            <ip-ecn>3</ip-ecn>
        </ip-match>
        <tcp-source-port>183</tcp-source-port>
        <tcp-destination-port>8080</tcp-destination-port>
    </match>
</flow>
edit flag offensive delete publish link more

Comments

Thank you. I will test this on my system and let everyone know how it goes.

whabeck ( 2015-01-29 08:09:32 -0800 )edit

@whabeck did the example work for you? If yes any chance you can accept (above little tick on the left) and upvote the answer?

mawil ( 2015-02-03 05:33:59 -0800 )edit

did not get to test, but i believe this is what I was looking for.

whabeck ( 2015-02-05 10:43:40 -0800 )edit

I've tried this example and others of my own. None of them seem to work correctly. The flow that is entered into ovs does not reflect the vlan-id that is provided. Here is the resulting flow from ovs: cookie=0x0, duration=39.439s, table=0, n_packets=n/a, n_bytes=656, priority=1,in_port=12 actions=push_vlan:0x88a8,set_field:4162->vlan_vid,output:1 Note that the vlan-id is set to 4162. This is not the id I provided in the xml. Any ideas on how to correct this? And where does 4162 come from? Is there some encoding issue? Thanks

jpete2477 ( 2015-07-28 10:14:49 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-01-28 13:45:07 -0800

Seen: 549 times

Last updated: Mar 18 '15