brocade_vrouter 0.1.0 → 0.1.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 +4 -4
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +93 -0
- data/Rakefile +6 -0
- data/bin/console +7 -0
- data/bin/setup +8 -0
- data/brocade_vrouter.gemspec +31 -0
- data/lib/brocade_vrouter/client.rb +36 -0
- data/lib/brocade_vrouter/config.rb +60 -0
- data/lib/brocade_vrouter/configuration.rb +98 -0
- data/lib/brocade_vrouter/path_builder.rb +61 -0
- data/lib/brocade_vrouter/version.rb +3 -0
- data/lib/brocade_vrouter.rb +19 -0
- metadata +28 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76417369286937151d5ddd98715ef88e04f131e6
|
4
|
+
data.tar.gz: 6ff812dbe66810fdb2f3881efbdf8d8849a7064e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74a8c1d98504b427f5abf52589da092d90a2c3905c4d6838116d8a23fc97efbedef6558d176bbd48e6030a3153b21d73ef8226def7070273772f7c0f886c1e07
|
7
|
+
data.tar.gz: 3410cefe4c69f069c61552885678e4607d7a68f0eb68e32aeed53904058255aa72296710a66c1eab841efadd98f8631d1455bf83e45188814af68e6ae18d1536
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at key@kosmatov.ru. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Konstantin Kosmatov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
# Brocade vRouter client
|
2
|
+
|
3
|
+
[](https://travis-ci.org/serverscom/brocade_vrouter)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'brocade_vrouter'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
### Configure
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
BrocadeVRouter.configure do |conf|
|
23
|
+
conf.url 'https://examplerouter.com'
|
24
|
+
conf.basic_auth ['routeruser', 'routerpassword']
|
25
|
+
conf.ssl verify: false
|
26
|
+
end
|
27
|
+
|
28
|
+
router = BrocadeVRouter::Client.new
|
29
|
+
```
|
30
|
+
|
31
|
+
### Or pass config to client instance
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
router = BrocadeVRouter::Client.new url: 'https://examplerouter.com',
|
35
|
+
basic_auth: ['routeruser', 'routerpassword'],
|
36
|
+
connection_options: {ssl: {verify: false}}
|
37
|
+
```
|
38
|
+
|
39
|
+
### Example router configuration
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
router.configure do
|
43
|
+
set security do
|
44
|
+
vpn l2tp remote_access authentication local_users do
|
45
|
+
username testuser do
|
46
|
+
password 'testpass'
|
47
|
+
static_ip '10.0.2.1'
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
firewall name 'testfw', true do # pass `true` to perform command without block at first
|
52
|
+
default_action drop
|
53
|
+
rule 100 do
|
54
|
+
action accept
|
55
|
+
source address '10.0.2.1'
|
56
|
+
destination address '10.0.2.0/24'
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
commit
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
CLI equivalent:
|
66
|
+
|
67
|
+
```
|
68
|
+
configure
|
69
|
+
set security vpn l2tp remote-access authentication local-users username 'testuser' password 'testpass'
|
70
|
+
set security vpn l2tp remote-access authentication local-users username 'testuser' static-ip '10.0.2.1'
|
71
|
+
set security firewall name 'testfw'
|
72
|
+
set security firewall name 'testfw' default-action drop
|
73
|
+
set security firewall name 'testfw' rule 100 action accept
|
74
|
+
set security firewall name 'testfw' rule 100 source address '10.0.2.1'
|
75
|
+
set security firewall name 'testfw' rule 100 destination address '10.0.2.0/24'
|
76
|
+
commit
|
77
|
+
```
|
78
|
+
|
79
|
+
## Development
|
80
|
+
|
81
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
82
|
+
|
83
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
84
|
+
|
85
|
+
## Contributing
|
86
|
+
|
87
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/serverscom/brocade_vrouter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
88
|
+
|
89
|
+
|
90
|
+
## License
|
91
|
+
|
92
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
93
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
data/bin/setup
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'brocade_vrouter/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'brocade_vrouter'
|
8
|
+
spec.version = BrocadeVRouter::VERSION
|
9
|
+
spec.authors = ['Konstantin Kosmatov']
|
10
|
+
spec.email = ['key@kosmatov.ru']
|
11
|
+
|
12
|
+
spec.summary = %q{Brocade 5600 vRouter client}
|
13
|
+
spec.description = %q{Brocade 5600 vRouter REST API 2.0 client}
|
14
|
+
spec.homepage = 'https://github.com/serverscom/brocade_vrouter'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_dependency 'faraday', '~> 0'
|
23
|
+
spec.add_dependency 'multi_json', '~> 1'
|
24
|
+
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.11'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
|
+
spec.add_development_dependency 'pry', '~> 0'
|
29
|
+
spec.add_development_dependency 'coveralls', '~> 0'
|
30
|
+
spec.add_development_dependency 'webmock', '~> 1'
|
31
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module BrocadeVRouter
|
2
|
+
class Client
|
3
|
+
attr_reader :connection
|
4
|
+
|
5
|
+
def initialize(url: nil, connection_options: nil, basic_auth: nil)
|
6
|
+
config = BrocadeVRouter.config
|
7
|
+
url ||= config.url
|
8
|
+
connection_options ||= config.connection_options
|
9
|
+
basic_auth ||= config.basic_auth
|
10
|
+
|
11
|
+
@connection = Faraday.new(url, connection_options) do |f|
|
12
|
+
f.adapter config.adapter
|
13
|
+
f.basic_auth(*basic_auth) if basic_auth
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def configuration(&blk)
|
18
|
+
@current_conf ||= Configuration.new connection
|
19
|
+
block_given? ? @current_conf.perform(&blk) : @current_conf
|
20
|
+
end
|
21
|
+
|
22
|
+
alias_method :configure, :configuration
|
23
|
+
|
24
|
+
def close(commit: false, save: false)
|
25
|
+
close_configuration(commit: commit, save: save) if @current_conf
|
26
|
+
end
|
27
|
+
|
28
|
+
def close_configuration(commit:, save:)
|
29
|
+
@current_conf.commit if commit
|
30
|
+
@current_conf.save if save
|
31
|
+
@current_conf.close
|
32
|
+
@current_conf = nil
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module BrocadeVRouter
|
2
|
+
class Config
|
3
|
+
attr_reader :connection_opts, :request_opts
|
4
|
+
|
5
|
+
def self.define_opts_methods(opts)
|
6
|
+
opts.each do |name, _|
|
7
|
+
define_method name do |value = nil|
|
8
|
+
value ? (opts[name] = value) : opts[name]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
@connection_opts = {
|
15
|
+
ssl: {}
|
16
|
+
}
|
17
|
+
|
18
|
+
@request_opts = {
|
19
|
+
timeout: 5,
|
20
|
+
open_timeout: nil
|
21
|
+
}
|
22
|
+
|
23
|
+
self.class.define_opts_methods @connection_opts
|
24
|
+
self.class.define_opts_methods @request_opts
|
25
|
+
|
26
|
+
@raise_on_fail = true
|
27
|
+
end
|
28
|
+
|
29
|
+
def url(value = nil)
|
30
|
+
@url ||= value
|
31
|
+
end
|
32
|
+
|
33
|
+
def logger(logdev = nil)
|
34
|
+
@logger ||= logdev
|
35
|
+
end
|
36
|
+
|
37
|
+
def adapter(value = nil)
|
38
|
+
@adapter ||= value || Faraday.default_adapter
|
39
|
+
end
|
40
|
+
|
41
|
+
def raise_on_fail(value = nil)
|
42
|
+
@raise_on_fail = value unless value.nil?
|
43
|
+
@raise_on_fail
|
44
|
+
end
|
45
|
+
|
46
|
+
def basic_auth(value = nil)
|
47
|
+
@basic_auth ||= value
|
48
|
+
end
|
49
|
+
|
50
|
+
def connection_options
|
51
|
+
@connection_opts.map { |op, _| (value = send(op)) && [op, value] }.to_h
|
52
|
+
.merge request: request_options
|
53
|
+
end
|
54
|
+
|
55
|
+
def request_options
|
56
|
+
request_opts.map { |op, _| (value = send(op)) && [op, value] }
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module BrocadeVRouter
|
2
|
+
class Configuration
|
3
|
+
CONF_PATH = '/rest/conf'.freeze
|
4
|
+
|
5
|
+
attr_reader :connection, :last_response
|
6
|
+
|
7
|
+
def initialize(connection, base_path = nil)
|
8
|
+
@connection = connection
|
9
|
+
@base_path = base_path
|
10
|
+
end
|
11
|
+
|
12
|
+
def base_path
|
13
|
+
@base_path ||= handle_response(connection.post CONF_PATH).headers['location']
|
14
|
+
end
|
15
|
+
|
16
|
+
def perform(&blk)
|
17
|
+
@context = eval 'self', blk.binding
|
18
|
+
instance_eval(&blk) if block_given?
|
19
|
+
end
|
20
|
+
|
21
|
+
def set(paths = nil, &blk)
|
22
|
+
res = build_paths(paths, &blk).map do |p|
|
23
|
+
handle_response connection.put("#{base_path}/set/#{p}")
|
24
|
+
end
|
25
|
+
|
26
|
+
res.size > 1 ? res : res.first
|
27
|
+
end
|
28
|
+
|
29
|
+
def get(paths = nil, &blk)
|
30
|
+
all_res = build_paths(paths, &blk).map do |p|
|
31
|
+
res = handle_response connection.get "#{base_path}/#{p}"
|
32
|
+
res.success? ? MultiJson.load(res.body) : nil
|
33
|
+
end
|
34
|
+
|
35
|
+
all_res.size > 1 ? all_res : all_res.first
|
36
|
+
end
|
37
|
+
|
38
|
+
def delete(paths = nil, &blk)
|
39
|
+
res = build_paths(paths, &blk).map do |p|
|
40
|
+
handle_response connection.put "#{base_path}/delete/#{p}"
|
41
|
+
end
|
42
|
+
|
43
|
+
res.size > 1 ? res : res.first
|
44
|
+
end
|
45
|
+
|
46
|
+
def commit(path = nil)
|
47
|
+
handle_response connection.post "#{path || base_path}/commit"
|
48
|
+
end
|
49
|
+
|
50
|
+
def save(path = nil)
|
51
|
+
handle_response connection.post "#{path || base_path}/save"
|
52
|
+
end
|
53
|
+
|
54
|
+
def close(path = nil)
|
55
|
+
handle_response connection.delete(path || base_path)
|
56
|
+
end
|
57
|
+
|
58
|
+
def close_all_sessions!(commit: false, save: false)
|
59
|
+
sessions.each do |session|
|
60
|
+
path = "#{CONF_PATH}/#{session['id']}"
|
61
|
+
commit path if commit
|
62
|
+
save path if save
|
63
|
+
close path
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def sessions
|
68
|
+
(MultiJson.load (handle_response connection.get CONF_PATH).body)
|
69
|
+
.fetch('session', [])
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
def handle_response(resp)
|
75
|
+
@last_response = resp
|
76
|
+
if BrocadeVRouter.config.logger
|
77
|
+
BrocadeVRouter.config.logger.info "#{resp.env.method} #{resp.env.url} #{resp.env.status}\n#{resp.body}"
|
78
|
+
end
|
79
|
+
if BrocadeVRouter.config.raise_on_fail && !resp.success?
|
80
|
+
raise RequestError.new "Request #{resp.env.method.upcase} #{resp.env.url} failed with code #{resp.status}: #{resp.body}"
|
81
|
+
end
|
82
|
+
resp
|
83
|
+
end
|
84
|
+
|
85
|
+
def method_missing(name, value = nil, exec = false, &blk)
|
86
|
+
PathBuilder.new(@context) { public_send name, value, exec, &blk }.to_a
|
87
|
+
end
|
88
|
+
|
89
|
+
def build_paths(paths, &blk)
|
90
|
+
paths = Array(paths)
|
91
|
+
if block_given?
|
92
|
+
paths.map { |p| PathBuilder.new(@context, p, &blk).to_a }.flatten
|
93
|
+
else
|
94
|
+
paths
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module BrocadeVRouter
|
2
|
+
class PathBuilder
|
3
|
+
SEPARATOR = '/'.freeze
|
4
|
+
SNAKE_TRANSFORM = ['_', '-'].map(&:freeze).freeze
|
5
|
+
|
6
|
+
attr_reader :base_path
|
7
|
+
|
8
|
+
def initialize(context = nil, base_path = nil, &blk)
|
9
|
+
@base_path, @paths, @context = base_path, [], context
|
10
|
+
|
11
|
+
if block_given?
|
12
|
+
@context ||= eval 'self', blk.binding
|
13
|
+
instance_eval(&blk)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_a
|
18
|
+
return @paths.flatten if !base_path || base_path.empty?
|
19
|
+
@paths.flatten.map { |p| "#{base_path}/#{p}" }
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def address(value)
|
25
|
+
generate_paths! :address, Array(value).map { |v| URI.escape v.to_s, SEPARATOR }
|
26
|
+
end
|
27
|
+
|
28
|
+
def method_missing(*args, &blk)
|
29
|
+
return @context.send(*args) if @context.respond_to?(args.first, true)
|
30
|
+
@paths << generate_paths!(*args, &blk)
|
31
|
+
@paths.last
|
32
|
+
end
|
33
|
+
|
34
|
+
def generate_paths!(name, value = nil, exec = nil, &blk)
|
35
|
+
path = URI.escape name.to_s.gsub(*SNAKE_TRANSFORM)
|
36
|
+
|
37
|
+
value_is_path = @paths.pop if @paths.last == value
|
38
|
+
@paths << "#{path}/#{value_is_path ? value : to_path(value)}" if exec
|
39
|
+
|
40
|
+
if value.is_a?(Array)
|
41
|
+
value.map { |v| "#{path}/#{v}" }
|
42
|
+
else
|
43
|
+
path = "#{path}/#{value_is_path ? value : to_path(value)}" if value
|
44
|
+
block_given? ? PathBuilder.new(@context, path, &blk).to_a : path
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def to_path(value)
|
49
|
+
val = value.is_a?(Hash) ? hash_to_ary(value) : value
|
50
|
+
Array(val).flatten.map { |e| URI.escape e.to_s }.join SEPARATOR
|
51
|
+
end
|
52
|
+
|
53
|
+
def hash_to_ary(hash)
|
54
|
+
hash.reduce([]) do |m, (k, v)|
|
55
|
+
m << k.to_s.gsub(*SNAKE_TRANSFORM)
|
56
|
+
m << v
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'multi_json'
|
3
|
+
|
4
|
+
module BrocadeVRouter
|
5
|
+
autoload 'Client', 'brocade_vrouter/client'
|
6
|
+
autoload 'Config', 'brocade_vrouter/config'
|
7
|
+
autoload 'Configuration', 'brocade_vrouter/configuration'
|
8
|
+
autoload 'PathBuilder', 'brocade_vrouter/path_builder'
|
9
|
+
|
10
|
+
RequestError = Class.new StandardError
|
11
|
+
|
12
|
+
def self.config
|
13
|
+
@config ||= Config.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.configure
|
17
|
+
yield config
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brocade_vrouter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Kosmatov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,21 +114,40 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '1'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '1'
|
125
125
|
description: Brocade 5600 vRouter REST API 2.0 client
|
126
126
|
email:
|
127
127
|
- key@kosmatov.ru
|
128
|
-
executables:
|
128
|
+
executables:
|
129
|
+
- console
|
130
|
+
- setup
|
129
131
|
extensions: []
|
130
132
|
extra_rdoc_files: []
|
131
|
-
files:
|
133
|
+
files:
|
134
|
+
- ".gitignore"
|
135
|
+
- ".rspec"
|
136
|
+
- ".travis.yml"
|
137
|
+
- CODE_OF_CONDUCT.md
|
138
|
+
- Gemfile
|
139
|
+
- LICENSE.txt
|
140
|
+
- README.md
|
141
|
+
- Rakefile
|
142
|
+
- bin/console
|
143
|
+
- bin/setup
|
144
|
+
- brocade_vrouter.gemspec
|
145
|
+
- lib/brocade_vrouter.rb
|
146
|
+
- lib/brocade_vrouter/client.rb
|
147
|
+
- lib/brocade_vrouter/config.rb
|
148
|
+
- lib/brocade_vrouter/configuration.rb
|
149
|
+
- lib/brocade_vrouter/path_builder.rb
|
150
|
+
- lib/brocade_vrouter/version.rb
|
132
151
|
homepage: https://github.com/serverscom/brocade_vrouter
|
133
152
|
licenses:
|
134
153
|
- MIT
|
@@ -149,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
168
|
version: '0'
|
150
169
|
requirements: []
|
151
170
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.
|
171
|
+
rubygems_version: 2.5.1
|
153
172
|
signing_key:
|
154
173
|
specification_version: 4
|
155
174
|
summary: Brocade 5600 vRouter client
|