opendaylight 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32436da244883969448551b377af784a623665f2
4
- data.tar.gz: 8392f4dca0cb733ee0bd5c0a6825c21763b99a1b
3
+ metadata.gz: 18f8d8a5b0b8158620c4dd474fb5bffd6312f8e6
4
+ data.tar.gz: ecffa1bd7c71eb387d79e09e153cd18623601951
5
5
  SHA512:
6
- metadata.gz: 27d0ec0319e34e095a1a66ab8d0f1b1982270c8697bf9b21f4d977725786c601cdddad06d3ce69e8ee3a8245029962346be9fd38fa1a0dd33910ca639eecf3cd
7
- data.tar.gz: f6ad43773750b12575ba856db131bd43c6e746f14d28f84ecb9e471de2c773fc278a323733341622a8cd87b0eb7f4e580d3daff1d22ee3e014a6eb1fb69d3b6f
6
+ metadata.gz: a402ad53f2c559eaae5cde5773ce5a284f2686deae10ad35bd20c5944f19a090c9142fe0b80da8e34a6d4a52e224ce84807f627638f509d4116717cb555f7233
7
+ data.tar.gz: 93931c338c9b6343c71def6705bfea1f1d5dbe7dae8293b8cd6bd75a7bec700e5c1781a8f16bd38c5ee7d345fa930552a9de5f026ee6ec8694ffc24173b69a17
data/README.md CHANGED
@@ -95,10 +95,6 @@ To get your topology, use API.topology:
95
95
 
96
96
  Opendaylight::API.topology
97
97
 
98
- For a list of hosts, use API.hostTracker:
99
-
100
- Opendaylight::API.hostTracker
101
-
102
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):
103
99
 
104
100
  "edgeProperties"=>[{
@@ -142,6 +138,25 @@ This returns a hash of all the edges (links). The hash is organized as follows (
142
138
  }
143
139
  }]
144
140
 
141
+ For a list of hosts, use API.hostTracker:
142
+
143
+ Opendaylight::API.hostTracker
144
+
145
+ To list all flows, use listFlows:
146
+
147
+ Opendaylight::API.listFlows
148
+
149
+ For statistics, use statistics:
150
+
151
+ Opendaylight::API.statistics #Optional statistics("node") or statistics("port")
152
+
153
+ Defaults to flow statistics.
154
+
155
+ TODO:
156
+ DRY up code by adding "options" and "auth" methods.
157
+ Make the code prettier by splitting into files.
158
+ Finish covering the API.
159
+
145
160
  ## Contributing
146
161
 
147
162
  1. Fork it ( https://github.com/[my-github-username]/opendaylight/fork )
data/lib/opendaylight.rb CHANGED
@@ -62,6 +62,17 @@ module Opendaylight
62
62
  auth = {username: username, password: password}
63
63
  HTTParty.get("#{url}controller/nb/v2/hosttracker/#{containerName}/hosts/active", :basic_auth => auth)
64
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
+
65
76
  def username
66
77
  Opendaylight.configuration.username
67
78
  end
@@ -1,3 +1,3 @@
1
1
  module Opendaylight
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opendaylight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - rickpr