opendaylight 0.0.9 → 0.1.0
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 +4 -4
- data/lib/opendaylight.rb +37 -35
- data/lib/opendaylight/version.rb +1 -1
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 542700d95226acf495a0bbc6f2b5f311f3b566c7
         | 
| 4 | 
            +
              data.tar.gz: efa31a0355fb5cf466402b600c62aacf4e8c57fd
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2f3a90902dcc3c582908fd52a047e0615dd92493b48faf94eaf9e0e3d9af86693b05b2e56225645214f2b76dfd9e543eb96c8bb4cabccc421c0e166fdd831843
         | 
| 7 | 
            +
              data.tar.gz: 7faec067f7c28bf7a1a875768c15fb763495c335b5ee8935472c862377cca2b42203cf3d6d163e5a3d0dff6e40b3ee6d1d933c1ccaf08ae47aac6b812e9717f9
         | 
    
        data/lib/opendaylight.rb
    CHANGED
    
    | @@ -2,7 +2,7 @@ require "opendaylight/version" | |
| 2 2 | 
             
            require "httparty"
         | 
| 3 3 |  | 
| 4 4 | 
             
            module Opendaylight
         | 
| 5 | 
            -
             | 
| 5 | 
            +
              class Configuration
         | 
| 6 6 | 
             
                attr_accessor :username, :password, :url
         | 
| 7 7 | 
             
                def initialize
         | 
| 8 8 | 
             
                  username = nil
         | 
| @@ -21,10 +21,40 @@ module Opendaylight | |
| 21 21 | 
             
              end
         | 
| 22 22 |  | 
| 23 23 | 
             
              class API
         | 
| 24 | 
            -
             | 
| 24 | 
            +
             | 
| 25 | 
            +
                def self.makeflow **params
         | 
| 26 | 
            +
                  options = build_options params
         | 
| 27 | 
            +
                  HTTParty.put("#{options[:url]}controller/nb/v2/flowprogrammer/#{options[:containerName]}/node/#{options[:type]}/#{options[:id]}/staticFlow/#{options[:name]}",options[:request])
         | 
| 28 | 
            +
                end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                def self.topology(username: Opendaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default")
         | 
| 31 | 
            +
                    auth = {username: username, password: password}
         | 
| 32 | 
            +
                    HTTParty.get("#{url}controller/nb/v2/topology/#{containerName}", basic_auth: auth)
         | 
| 33 | 
            +
                end
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                def self.hostTracker(username: Opendaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default")
         | 
| 36 | 
            +
                    auth = {username: username, password: password}
         | 
| 37 | 
            +
                    HTTParty.get("#{url}controller/nb/v2/hosttracker/#{containerName}/hosts/active", basic_auth: auth)
         | 
| 38 | 
            +
                end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                def self.listFlows(username: Opendaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default")
         | 
| 41 | 
            +
                    auth = {username: username, password: password}
         | 
| 42 | 
            +
                    HTTParty.get("#{url}controller/nb/v2/flowprogrammer/#{containerName}", basic_auth: auth)
         | 
| 43 | 
            +
                end
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                def self.statistics(username: Opendaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default", stats: "flow")
         | 
| 25 46 | 
             
                  auth = {username: username, password: password}
         | 
| 26 | 
            -
                   | 
| 27 | 
            -
             | 
| 47 | 
            +
                  HTTParty.get("#{url}controller/nb/v2/statistics/#{containerName}/#{stats}", basic_auth: auth)
         | 
| 48 | 
            +
                end
         | 
| 49 | 
            +
             | 
| 50 | 
            +
                def self.build_options(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")
         | 
| 51 | 
            +
                  auth = {username: username, password: password}
         | 
| 52 | 
            +
                  options = { url: url,
         | 
| 53 | 
            +
                    containerName: containerName,
         | 
| 54 | 
            +
                    type: type,
         | 
| 55 | 
            +
                    id: id,
         | 
| 56 | 
            +
                    name: name,
         | 
| 57 | 
            +
                    request: { headers: {"Content-Type" => "application/json"},
         | 
| 28 58 | 
             
                    body: {
         | 
| 29 59 | 
             
                      "tpSrc" => tpSrc,
         | 
| 30 60 | 
             
                      "protocol" => protocol,
         | 
| @@ -51,39 +81,11 @@ module Opendaylight | |
| 51 81 | 
             
                      "tpDst" => tpDst
         | 
| 52 82 | 
             
                      }.to_json,
         | 
| 53 83 | 
             
                    basic_auth: auth
         | 
| 54 | 
            -
                  }
         | 
| 55 | 
            -
                  HTTParty.put("#{url}controller/nb/v2/flowprogrammer/#{containerName}/node/#{type}/#{id}/staticFlow/#{name}",options)
         | 
| 56 | 
            -
                end
         | 
| 57 | 
            -
                def self.topology(username: Opendaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default")
         | 
| 58 | 
            -
                    auth = {username: username, password: password}
         | 
| 59 | 
            -
                    HTTParty.get("#{url}controller/nb/v2/topology/#{containerName}", :basic_auth => auth)
         | 
| 60 | 
            -
                end
         | 
| 61 | 
            -
                def self.hostTracker(username: Opendaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default")
         | 
| 62 | 
            -
                    auth = {username: username, password: password}
         | 
| 63 | 
            -
                    HTTParty.get("#{url}controller/nb/v2/hosttracker/#{containerName}/hosts/active", :basic_auth => auth)
         | 
| 64 | 
            -
                end
         | 
| 65 | 
            -
             | 
| 66 | 
            -
                def self.listFlows(username: Opendaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default")
         | 
| 67 | 
            -
                    auth = {username: username, password: password}
         | 
| 68 | 
            -
                    HTTParty.get("#{url}controller/nb/v2/flowprogrammer/#{containerName}", :basic_auth => auth)
         | 
| 69 | 
            -
                end
         | 
| 70 | 
            -
             | 
| 71 | 
            -
                def self.statistics(username: Opendaylight.configuration.username, password: Opendaylight.configuration.password, url: Opendaylight.configuration.url, containerName: "default", stats: "flow")
         | 
| 72 | 
            -
                  auth = {username: username, password: password}
         | 
| 73 | 
            -
                  HTTParty.get("#{url}controller/nb/v2/statistics/#{containerName}/#{stats}", :basic_auth => auth)
         | 
| 74 | 
            -
                end
         | 
| 75 | 
            -
             | 
| 76 | 
            -
                def username
         | 
| 77 | 
            -
                  Opendaylight.configuration.username
         | 
| 84 | 
            +
                  } }
         | 
| 78 85 | 
             
                end
         | 
| 79 86 |  | 
| 80 | 
            -
             | 
| 81 | 
            -
                  Opendaylight.configuration.password
         | 
| 82 | 
            -
                end
         | 
| 87 | 
            +
              Opendaylight.configure
         | 
| 83 88 |  | 
| 84 | 
            -
                def url
         | 
| 85 | 
            -
                  Opendaylight.configuration.url
         | 
| 86 | 
            -
                end
         | 
| 87 89 | 
             
              end
         | 
| 88 | 
            -
             | 
| 90 | 
            +
             | 
| 89 91 | 
             
            end
         | 
    
        data/lib/opendaylight/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: opendaylight
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0 | 
| 4 | 
            +
              version: 0.1.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - rickpr
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014- | 
| 11 | 
            +
            date: 2014-12-15 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 87 87 | 
             
                  version: '0'
         | 
| 88 88 | 
             
            requirements: []
         | 
| 89 89 | 
             
            rubyforge_project: 
         | 
| 90 | 
            -
            rubygems_version: 2. | 
| 90 | 
            +
            rubygems_version: 2.4.4
         | 
| 91 91 | 
             
            signing_key: 
         | 
| 92 92 | 
             
            specification_version: 4
         | 
| 93 93 | 
             
            summary: Ruby Wrapper for OpenDaylight
         |