opendaylight 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/.gitignore +22 -0
 - data/Gemfile +4 -0
 - data/LICENSE.txt +22 -0
 - data/README.md +147 -0
 - data/Rakefile +2 -0
 - data/lib/opendaylight.rb +73 -0
 - data/lib/opendaylight/version.rb +3 -0
 - data/opendaylight.gemspec +23 -0
 - metadata +81 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 8c9fbb5d75673daa8e54f4d7e58a5ad289d4581d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 0ca89291a52bb5b6cef888e3055c125b3bcf92c6
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 10e67c6c981ff1440b3eff97383c407bb0568450308c28ceb7f7eed5f0dca1d83dc4eb31c4615486c50192bac7e13b4b6fce2f468a8127b5cb6fb2dc3a3002f5
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 728b40b229396c5a655068d9fe2646fe110ae494eab542cdcacc2384d35836153a6b0c103019d98bd84cd3a616d5f0590d16c3ed33445a1c445a9159868ec7a2
         
     | 
    
        data/.gitignore
    ADDED
    
    | 
         @@ -0,0 +1,22 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            *.gem
         
     | 
| 
      
 2 
     | 
    
         
            +
            *.rbc
         
     | 
| 
      
 3 
     | 
    
         
            +
            .bundle
         
     | 
| 
      
 4 
     | 
    
         
            +
            .config
         
     | 
| 
      
 5 
     | 
    
         
            +
            .yardoc
         
     | 
| 
      
 6 
     | 
    
         
            +
            Gemfile.lock
         
     | 
| 
      
 7 
     | 
    
         
            +
            InstalledFiles
         
     | 
| 
      
 8 
     | 
    
         
            +
            _yardoc
         
     | 
| 
      
 9 
     | 
    
         
            +
            coverage
         
     | 
| 
      
 10 
     | 
    
         
            +
            doc/
         
     | 
| 
      
 11 
     | 
    
         
            +
            lib/bundler/man
         
     | 
| 
      
 12 
     | 
    
         
            +
            pkg
         
     | 
| 
      
 13 
     | 
    
         
            +
            rdoc
         
     | 
| 
      
 14 
     | 
    
         
            +
            spec/reports
         
     | 
| 
      
 15 
     | 
    
         
            +
            test/tmp
         
     | 
| 
      
 16 
     | 
    
         
            +
            test/version_tmp
         
     | 
| 
      
 17 
     | 
    
         
            +
            tmp
         
     | 
| 
      
 18 
     | 
    
         
            +
            *.bundle
         
     | 
| 
      
 19 
     | 
    
         
            +
            *.so
         
     | 
| 
      
 20 
     | 
    
         
            +
            *.o
         
     | 
| 
      
 21 
     | 
    
         
            +
            *.a
         
     | 
| 
      
 22 
     | 
    
         
            +
            mkmf.log
         
     | 
    
        data/Gemfile
    ADDED
    
    
    
        data/LICENSE.txt
    ADDED
    
    | 
         @@ -0,0 +1,22 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Copyright (c) 2014 rickpr
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            MIT License
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining
         
     | 
| 
      
 6 
     | 
    
         
            +
            a copy of this software and associated documentation files (the
         
     | 
| 
      
 7 
     | 
    
         
            +
            "Software"), to deal in the Software without restriction, including
         
     | 
| 
      
 8 
     | 
    
         
            +
            without limitation the rights to use, copy, modify, merge, publish,
         
     | 
| 
      
 9 
     | 
    
         
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         
     | 
| 
      
 10 
     | 
    
         
            +
            permit persons to whom the Software is furnished to do so, subject to
         
     | 
| 
      
 11 
     | 
    
         
            +
            the following conditions:
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be
         
     | 
| 
      
 14 
     | 
    
         
            +
            included in all copies or substantial portions of the Software.
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         
     | 
| 
      
 17 
     | 
    
         
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         
     | 
| 
      
 18 
     | 
    
         
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         
     | 
| 
      
 19 
     | 
    
         
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         
     | 
| 
      
 20 
     | 
    
         
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         
     | 
| 
      
 21 
     | 
    
         
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         
     | 
| 
      
 22 
     | 
    
         
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,147 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Opendaylight
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            This gem is made as a ruby wrapper for OpenDaylight's FlowProgrammer api
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            ## Installation
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            Add this line to your application's Gemfile:
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                gem 'opendaylight'
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            And then execute:
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                $ bundle
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            Or install it yourself as:
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                $ gem install opendaylight
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            ## Usage
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            Configure with an initializer in config/initializers as follows:
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                Opendaylight.configure do |config|
         
     | 
| 
      
 24 
     | 
    
         
            +
                  config.username = "your_username"
         
     | 
| 
      
 25 
     | 
    
         
            +
                  config.password = "your_password"
         
     | 
| 
      
 26 
     | 
    
         
            +
                  config.url = "http://yourserver.com:port/"
         
     | 
| 
      
 27 
     | 
    
         
            +
                end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            Then make a call to Opendaylight's OpenDaylight.makeflow:
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            For example:
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
                Opendaylight::OpenDaylight.makeflow(id: "00:00:00:00:00:00:00:02", name: "flow1", actions: "DROP")
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            Here are the possible arguments for makeflow. All the arguments default to nil unless otherwise specified:
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                #Server information
         
     | 
| 
      
 38 
     | 
    
         
            +
                url			#Your controller's web url, usually "http://yourserver.com:8080/" (defaults to config url in initializer)
         
     | 
| 
      
 39 
     | 
    
         
            +
                username		#OpenDaylight login username (defaults to config username in initializer)
         
     | 
| 
      
 40 
     | 
    
         
            +
                password		#OpenDaylight login password (defaults to config password in initializer)
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
                #Flow Parameters
         
     | 
| 
      
 43 
     | 
    
         
            +
                id			#Node ID (usually MAC address) *REQUIRED*
         
     | 
| 
      
 44 
     | 
    
         
            +
                name		#Flow Name *REQUIRED*
         
     | 
| 
      
 45 
     | 
    
         
            +
                actions		#OpenDaylight OpenFlow Action *REQUIRED*
         
     | 
| 
      
 46 
     | 
    
         
            +
                ingressPort		#Layer 1 (physical) Source Port
         
     | 
| 
      
 47 
     | 
    
         
            +
                dlSrc		#Layer 2 (MAC address) source
         
     | 
| 
      
 48 
     | 
    
         
            +
                dlDst		#Layer 2 (MAC address) Destination
         
     | 
| 
      
 49 
     | 
    
         
            +
                nwSrc		#Layer 3 (IP address) source
         
     | 
| 
      
 50 
     | 
    
         
            +
                nwDst		#Layer 3 (IP address) destination
         
     | 
| 
      
 51 
     | 
    
         
            +
                tpSrc		#Layer 4 (Network Socket Port) Source
         
     | 
| 
      
 52 
     | 
    
         
            +
                tpDst		#Layer 4 (Network Socket Port) destination
         
     | 
| 
      
 53 
     | 
    
         
            +
                installInHW		#Make the flow installed and active (default "true")
         
     | 
| 
      
 54 
     | 
    
         
            +
                type		#Node Type (default "OF")
         
     | 
| 
      
 55 
     | 
    
         
            +
                protocol		#IP Protocol Number (default "6")
         
     | 
| 
      
 56 
     | 
    
         
            +
                etherType		#Ethertype field (default "0x800")
         
     | 
| 
      
 57 
     | 
    
         
            +
                vlanId		#Virtual LAN ID
         
     | 
| 
      
 58 
     | 
    
         
            +
                vlanPriority	#Virtual LAN QoS Priotity
         
     | 
| 
      
 59 
     | 
    
         
            +
                idleTimeout		#Flow Idle Timeout
         
     | 
| 
      
 60 
     | 
    
         
            +
                priority		#Flow Priority
         
     | 
| 
      
 61 
     | 
    
         
            +
                tosBits		#Type of Service Bits
         
     | 
| 
      
 62 
     | 
    
         
            +
                hardTimeout		#Flow Hard Timeout
         
     | 
| 
      
 63 
     | 
    
         
            +
                cookie		#Cookie enhancements
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
            ## OpenDaylight Actions for the actions field
         
     | 
| 
      
 67 
     | 
    
         
            +
            CONTROLLER
         
     | 
| 
      
 68 
     | 
    
         
            +
            DROP
         
     | 
| 
      
 69 
     | 
    
         
            +
            ENQUEUE
         
     | 
| 
      
 70 
     | 
    
         
            +
            FLOOD
         
     | 
| 
      
 71 
     | 
    
         
            +
            FLOOD_ALL
         
     | 
| 
      
 72 
     | 
    
         
            +
            HW_PATH
         
     | 
| 
      
 73 
     | 
    
         
            +
            INTERFACE
         
     | 
| 
      
 74 
     | 
    
         
            +
            LOOPBACK
         
     | 
| 
      
 75 
     | 
    
         
            +
            OUTPUT
         
     | 
| 
      
 76 
     | 
    
         
            +
            POP_VLAN
         
     | 
| 
      
 77 
     | 
    
         
            +
            PUSH_VLAN
         
     | 
| 
      
 78 
     | 
    
         
            +
            SET_DL_DST
         
     | 
| 
      
 79 
     | 
    
         
            +
            SET_DL_SRC
         
     | 
| 
      
 80 
     | 
    
         
            +
            SET_DL_TYPE
         
     | 
| 
      
 81 
     | 
    
         
            +
            SET_NEXT_HOP
         
     | 
| 
      
 82 
     | 
    
         
            +
            SET_NW_DST
         
     | 
| 
      
 83 
     | 
    
         
            +
            SET_NW_SRC
         
     | 
| 
      
 84 
     | 
    
         
            +
            SET_NW_TOS
         
     | 
| 
      
 85 
     | 
    
         
            +
            SET_TP_DST
         
     | 
| 
      
 86 
     | 
    
         
            +
            SET_TP_SRC
         
     | 
| 
      
 87 
     | 
    
         
            +
            SET_VLAN_CFI
         
     | 
| 
      
 88 
     | 
    
         
            +
            SET_VLAN_ID
         
     | 
| 
      
 89 
     | 
    
         
            +
            SET_VLAN_PCP
         
     | 
| 
      
 90 
     | 
    
         
            +
            SW_PATH
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
            ##Topology
         
     | 
| 
      
 93 
     | 
    
         
            +
             
     | 
| 
      
 94 
     | 
    
         
            +
            To get your topology, use Opendaylight.topology:
         
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
      
 96 
     | 
    
         
            +
                Opendaylight::OpenDaylight.topology
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
            This returns a hash of all the edges (links). The hash is organized as follows (I have capitalized things that will come back as variables):
         
     | 
| 
      
 99 
     | 
    
         
            +
             
     | 
| 
      
 100 
     | 
    
         
            +
                "edgeProperties"=>[{
         
     | 
| 
      
 101 
     | 
    
         
            +
                        "properties"=>{
         
     | 
| 
      
 102 
     | 
    
         
            +
                            "timeStamp"=>{
         
     | 
| 
      
 103 
     | 
    
         
            +
                                "value"=>TIMESTAMP, "name"=>"NAME"
         
     | 
| 
      
 104 
     | 
    
         
            +
                            }
         
     | 
| 
      
 105 
     | 
    
         
            +
                            , "name"=>{
         
     | 
| 
      
 106 
     | 
    
         
            +
                                "value"=>"SWITCHNAME-PORTNAME"
         
     | 
| 
      
 107 
     | 
    
         
            +
                            }
         
     | 
| 
      
 108 
     | 
    
         
            +
                            , "state"=>{
         
     | 
| 
      
 109 
     | 
    
         
            +
                                "value"=>LINKSTATE
         
     | 
| 
      
 110 
     | 
    
         
            +
                            }
         
     | 
| 
      
 111 
     | 
    
         
            +
                            , "config"=>{
         
     | 
| 
      
 112 
     | 
    
         
            +
                                "value"=>CONFIGSTATE
         
     | 
| 
      
 113 
     | 
    
         
            +
                            }
         
     | 
| 
      
 114 
     | 
    
         
            +
                            , "bandwidth"=>{
         
     | 
| 
      
 115 
     | 
    
         
            +
                                "value"=>BANDWIDTH
         
     | 
| 
      
 116 
     | 
    
         
            +
                            }
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
      
 118 
     | 
    
         
            +
                        }
         
     | 
| 
      
 119 
     | 
    
         
            +
                        , "edge"=>{
         
     | 
| 
      
 120 
     | 
    
         
            +
                            "tailNodeConnector"=>{
         
     | 
| 
      
 121 
     | 
    
         
            +
                                "node"=>{
         
     | 
| 
      
 122 
     | 
    
         
            +
                                    "id"=>"SWITCHID", "type"=>"SWITCHTYPE" #Usually the switch ID is a MAC address and the type is OF for OpenFlow
         
     | 
| 
      
 123 
     | 
    
         
            +
                                }
         
     | 
| 
      
 124 
     | 
    
         
            +
                                , "id"=>"PORTID", "type"=>"LINKTYPE" #I believe the PORTID is the interface of the connected device, type is usually OF for OpenFlow
         
     | 
| 
      
 125 
     | 
    
         
            +
                            }
         
     | 
| 
      
 126 
     | 
    
         
            +
                            , "headNodeConnector"=>{
         
     | 
| 
      
 127 
     | 
    
         
            +
                                "node"=>{
         
     | 
| 
      
 128 
     | 
    
         
            +
                                    "id"=>"SWITCHID", "type"=>"SWITCHTYPE"
         
     | 
| 
      
 129 
     | 
    
         
            +
                                }
         
     | 
| 
      
 130 
     | 
    
         
            +
                                , "id"=>"PORTID", "type"=>"LINKTYPE"
         
     | 
| 
      
 131 
     | 
    
         
            +
                            }
         
     | 
| 
      
 132 
     | 
    
         
            +
             
     | 
| 
      
 133 
     | 
    
         
            +
                        }
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
      
 135 
     | 
    
         
            +
                    }
         
     | 
| 
      
 136 
     | 
    
         
            +
                        "properties" => {#This would be the next link
         
     | 
| 
      
 137 
     | 
    
         
            +
                        ....
         
     | 
| 
      
 138 
     | 
    
         
            +
                    }
         
     | 
| 
      
 139 
     | 
    
         
            +
                }]
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
            ## Contributing
         
     | 
| 
      
 142 
     | 
    
         
            +
             
     | 
| 
      
 143 
     | 
    
         
            +
            1. Fork it ( https://github.com/[my-github-username]/opendaylight/fork )
         
     | 
| 
      
 144 
     | 
    
         
            +
            2. Create your feature branch (`git checkout -b my-new-feature`)
         
     | 
| 
      
 145 
     | 
    
         
            +
            3. Commit your changes (`git commit -am 'Add some feature'`)
         
     | 
| 
      
 146 
     | 
    
         
            +
            4. Push to the branch (`git push origin my-new-feature`)
         
     | 
| 
      
 147 
     | 
    
         
            +
            5. Create a new Pull Request
         
     | 
    
        data/Rakefile
    ADDED
    
    
    
        data/lib/opendaylight.rb
    ADDED
    
    | 
         @@ -0,0 +1,73 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require "opendaylight/version"
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Opendaylight
         
     | 
| 
      
 4 
     | 
    
         
            +
                class Configuration
         
     | 
| 
      
 5 
     | 
    
         
            +
                attr_accessor :username, :password, :url
         
     | 
| 
      
 6 
     | 
    
         
            +
                def initialize
         
     | 
| 
      
 7 
     | 
    
         
            +
                  username = nil
         
     | 
| 
      
 8 
     | 
    
         
            +
                  password = nil
         
     | 
| 
      
 9 
     | 
    
         
            +
                  url = nil
         
     | 
| 
      
 10 
     | 
    
         
            +
                end
         
     | 
| 
      
 11 
     | 
    
         
            +
              end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
              class << self
         
     | 
| 
      
 14 
     | 
    
         
            +
                attr_accessor :configuration
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              def self.configure
         
     | 
| 
      
 18 
     | 
    
         
            +
                self.configuration ||= Configuration.new
         
     | 
| 
      
 19 
     | 
    
         
            +
                yield(configuration) if block_given?
         
     | 
| 
      
 20 
     | 
    
         
            +
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
              class OpenDaylight
         
     | 
| 
      
 23 
     | 
    
         
            +
                def self.makeflow(tpSrc: nil, protocol: "6", vlanId: nil, id: nil, type: "OF", vlanPriority: nil, idleTimeout: nil, priority: nil, ingressPort: nil, tosBits: nil, name: nil, hardTimeout: nil, dlDst: nil, installInHW: "true", etherType: "0x800", actions: nil, cookie: nil, dlSrc: nil, nwSrc: nil, nwDst: nil, tpDst: nil, username: OpenDaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default")
         
     | 
| 
      
 24 
     | 
    
         
            +
                  auth = {username: username, password: password}
         
     | 
| 
      
 25 
     | 
    
         
            +
                  options = {
         
     | 
| 
      
 26 
     | 
    
         
            +
                    headers: {"Content-Type" => "application/json"},
         
     | 
| 
      
 27 
     | 
    
         
            +
                    body: {
         
     | 
| 
      
 28 
     | 
    
         
            +
                      "tpSrc" => tpSrc,
         
     | 
| 
      
 29 
     | 
    
         
            +
                      "protocol" => protocol,
         
     | 
| 
      
 30 
     | 
    
         
            +
                      "vlanId" => vlanId,
         
     | 
| 
      
 31 
     | 
    
         
            +
                      "node" => {
         
     | 
| 
      
 32 
     | 
    
         
            +
                        "id" => id,
         
     | 
| 
      
 33 
     | 
    
         
            +
                        "type" => type
         
     | 
| 
      
 34 
     | 
    
         
            +
                      },
         
     | 
| 
      
 35 
     | 
    
         
            +
                      "vlanPriority" => vlanPriority,
         
     | 
| 
      
 36 
     | 
    
         
            +
                      "idleTimeout" => idleTimeout,
         
     | 
| 
      
 37 
     | 
    
         
            +
                      "priority" => priority,
         
     | 
| 
      
 38 
     | 
    
         
            +
                      "ingressPort" => ingressPort,
         
     | 
| 
      
 39 
     | 
    
         
            +
                      "tosBits" => tosBits,
         
     | 
| 
      
 40 
     | 
    
         
            +
                      "name" => name,
         
     | 
| 
      
 41 
     | 
    
         
            +
                      "hardTimeout" => hardTimeout,
         
     | 
| 
      
 42 
     | 
    
         
            +
                      "dlDst" => dlDst,
         
     | 
| 
      
 43 
     | 
    
         
            +
                      "installInHW" => installInHW,
         
     | 
| 
      
 44 
     | 
    
         
            +
                      "etherType" => etherType,
         
     | 
| 
      
 45 
     | 
    
         
            +
                      "actions" => [actions],
         
     | 
| 
      
 46 
     | 
    
         
            +
                      "cookie" => cookie,
         
     | 
| 
      
 47 
     | 
    
         
            +
                      "dlSrc" => dlSrc,
         
     | 
| 
      
 48 
     | 
    
         
            +
                      "nwSrc" => nwSrc,
         
     | 
| 
      
 49 
     | 
    
         
            +
                      "nwDst" => nwDst,
         
     | 
| 
      
 50 
     | 
    
         
            +
                      "tpDst" => tpDst
         
     | 
| 
      
 51 
     | 
    
         
            +
                      }.to_json,
         
     | 
| 
      
 52 
     | 
    
         
            +
                    basic_auth: auth
         
     | 
| 
      
 53 
     | 
    
         
            +
                  }
         
     | 
| 
      
 54 
     | 
    
         
            +
                  HTTParty.put("#{url}controller/nb/v2/flowprogrammer/#{containerName}/node/#{type}/#{id}/staticFlow/#{name}",options)
         
     | 
| 
      
 55 
     | 
    
         
            +
                end
         
     | 
| 
      
 56 
     | 
    
         
            +
                def self.topology(username: Opendaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default")
         
     | 
| 
      
 57 
     | 
    
         
            +
                    auth = {username: username, password: password}
         
     | 
| 
      
 58 
     | 
    
         
            +
                    HTTParty.get("#{url}controller/nb/v2/topology/#{containerName}", :basic_auth => auth)
         
     | 
| 
      
 59 
     | 
    
         
            +
                end
         
     | 
| 
      
 60 
     | 
    
         
            +
                def username
         
     | 
| 
      
 61 
     | 
    
         
            +
                  Opendaylight.configuration.username
         
     | 
| 
      
 62 
     | 
    
         
            +
                end
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                def password
         
     | 
| 
      
 65 
     | 
    
         
            +
                  Opendaylight.configuration.password
         
     | 
| 
      
 66 
     | 
    
         
            +
                end
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                def url
         
     | 
| 
      
 69 
     | 
    
         
            +
                  Opendaylight.configuration.url
         
     | 
| 
      
 70 
     | 
    
         
            +
                end
         
     | 
| 
      
 71 
     | 
    
         
            +
              end
         
     | 
| 
      
 72 
     | 
    
         
            +
              Opendaylight.configure
         
     | 
| 
      
 73 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,23 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # coding: utf-8
         
     | 
| 
      
 2 
     | 
    
         
            +
            lib = File.expand_path('../lib', __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'opendaylight/version'
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            Gem::Specification.new do |spec|
         
     | 
| 
      
 7 
     | 
    
         
            +
              spec.name          = "opendaylight"
         
     | 
| 
      
 8 
     | 
    
         
            +
              spec.version       = Opendaylight::VERSION
         
     | 
| 
      
 9 
     | 
    
         
            +
              spec.authors       = ["rickpr"]
         
     | 
| 
      
 10 
     | 
    
         
            +
              spec.email         = ["fdisk@fdisk.co"]
         
     | 
| 
      
 11 
     | 
    
         
            +
              spec.summary       = "Ruby Wrapper for OpenDaylight"
         
     | 
| 
      
 12 
     | 
    
         
            +
              spec.description   = "Makes writing Ruby apps for OpenDaylight easy"
         
     | 
| 
      
 13 
     | 
    
         
            +
              spec.homepage      = "http://fdisk.co"
         
     | 
| 
      
 14 
     | 
    
         
            +
              spec.license       = "MIT"
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              spec.files         = `git ls-files -z`.split("\x0")
         
     | 
| 
      
 17 
     | 
    
         
            +
              spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
         
     | 
| 
      
 18 
     | 
    
         
            +
              spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
         
     | 
| 
      
 19 
     | 
    
         
            +
              spec.require_paths = ["lib"]
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              spec.add_development_dependency "bundler", "~> 1.6"
         
     | 
| 
      
 22 
     | 
    
         
            +
              spec.add_development_dependency "rake"
         
     | 
| 
      
 23 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,81 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: opendaylight
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.1
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - rickpr
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-08-29 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: bundler
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '1.6'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '1.6'
         
     | 
| 
      
 27 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 28 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 29 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 30 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 34 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 37 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 38 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 39 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 40 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 41 
     | 
    
         
            +
            description: Makes writing Ruby apps for OpenDaylight easy
         
     | 
| 
      
 42 
     | 
    
         
            +
            email:
         
     | 
| 
      
 43 
     | 
    
         
            +
            - fdisk@fdisk.co
         
     | 
| 
      
 44 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 45 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 46 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 47 
     | 
    
         
            +
            files:
         
     | 
| 
      
 48 
     | 
    
         
            +
            - ".gitignore"
         
     | 
| 
      
 49 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 50 
     | 
    
         
            +
            - LICENSE.txt
         
     | 
| 
      
 51 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 52 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 53 
     | 
    
         
            +
            - lib/opendaylight.rb
         
     | 
| 
      
 54 
     | 
    
         
            +
            - lib/opendaylight/version.rb
         
     | 
| 
      
 55 
     | 
    
         
            +
            - opendaylight.gemspec
         
     | 
| 
      
 56 
     | 
    
         
            +
            homepage: http://fdisk.co
         
     | 
| 
      
 57 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 58 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 59 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 60 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 61 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 62 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 63 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 64 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 65 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 66 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 67 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 68 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 69 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 70 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 71 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 72 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 73 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 74 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 75 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 76 
     | 
    
         
            +
            rubygems_version: 2.4.1
         
     | 
| 
      
 77 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 78 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 79 
     | 
    
         
            +
            summary: Ruby Wrapper for OpenDaylight
         
     | 
| 
      
 80 
     | 
    
         
            +
            test_files: []
         
     | 
| 
      
 81 
     | 
    
         
            +
            has_rdoc: 
         
     |