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 +4 -4
- data/README.md +19 -4
- data/lib/opendaylight.rb +11 -0
- data/lib/opendaylight/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18f8d8a5b0b8158620c4dd474fb5bffd6312f8e6
|
4
|
+
data.tar.gz: ecffa1bd7c71eb387d79e09e153cd18623601951
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/opendaylight/version.rb
CHANGED