oxidized 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +2 -0
  3. data/Gemfile +3 -0
  4. data/README.md +133 -0
  5. data/Rakefile +46 -0
  6. data/TODO.md +20 -0
  7. data/bin/oxidized +13 -0
  8. data/extra/rest_client.rb +25 -0
  9. data/extra/syslog.rb +110 -0
  10. data/lib/oxidized.rb +6 -0
  11. data/lib/oxidized/cli.rb +42 -0
  12. data/lib/oxidized/config.rb +55 -0
  13. data/lib/oxidized/config/vars.rb +10 -0
  14. data/lib/oxidized/core.rb +41 -0
  15. data/lib/oxidized/input/cli.rb +48 -0
  16. data/lib/oxidized/input/input.rb +19 -0
  17. data/lib/oxidized/input/ssh.rb +111 -0
  18. data/lib/oxidized/input/telnet.rb +145 -0
  19. data/lib/oxidized/job.rb +14 -0
  20. data/lib/oxidized/jobs.rb +24 -0
  21. data/lib/oxidized/log.rb +21 -0
  22. data/lib/oxidized/manager.rb +57 -0
  23. data/lib/oxidized/model/acos.rb +69 -0
  24. data/lib/oxidized/model/aireos.rb +55 -0
  25. data/lib/oxidized/model/aos.rb +38 -0
  26. data/lib/oxidized/model/aos7.rb +58 -0
  27. data/lib/oxidized/model/aosw.rb +43 -0
  28. data/lib/oxidized/model/eos.rb +32 -0
  29. data/lib/oxidized/model/fortios.rb +44 -0
  30. data/lib/oxidized/model/ios.rb +63 -0
  31. data/lib/oxidized/model/iosxr.rb +47 -0
  32. data/lib/oxidized/model/ironware.rb +33 -0
  33. data/lib/oxidized/model/junos.rb +56 -0
  34. data/lib/oxidized/model/model.rb +152 -0
  35. data/lib/oxidized/model/powerconnect.rb +38 -0
  36. data/lib/oxidized/model/procurve.rb +45 -0
  37. data/lib/oxidized/model/timos.rb +45 -0
  38. data/lib/oxidized/node.rb +169 -0
  39. data/lib/oxidized/node/stats.rb +33 -0
  40. data/lib/oxidized/nodes.rb +143 -0
  41. data/lib/oxidized/output/file.rb +42 -0
  42. data/lib/oxidized/output/git.rb +78 -0
  43. data/lib/oxidized/output/output.rb +5 -0
  44. data/lib/oxidized/source/csv.rb +42 -0
  45. data/lib/oxidized/source/source.rb +11 -0
  46. data/lib/oxidized/source/sql.rb +61 -0
  47. data/lib/oxidized/string.rb +13 -0
  48. data/lib/oxidized/worker.rb +54 -0
  49. data/oxidized.gemspec +20 -0
  50. data/spec/nodes_spec.rb +46 -0
  51. metadata +136 -0
data/oxidized.gemspec ADDED
@@ -0,0 +1,20 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'oxidized'
3
+ s.version = '0.1.1'
4
+ s.licenses = ['Apache-2.0']
5
+ s.platform = Gem::Platform::RUBY
6
+ s.authors = [ 'Saku Ytti' ]
7
+ s.email = %w( saku@ytti.fi )
8
+ s.homepage = 'http://github.com/ytti/oxidized'
9
+ s.summary = 'feeble attempt at rancid'
10
+ s.description = 'software to fetch configuration from network devices and store them'
11
+ s.rubyforge_project = s.name
12
+ s.files = `git ls-files`.split("\n")
13
+ s.executables = %w( oxidized )
14
+ s.require_path = 'lib'
15
+
16
+ s.required_ruby_version = '>= 1.9.3'
17
+ s.add_dependency 'asetus', '~> 0.1'
18
+ s.add_dependency 'slop', '~> 3.5'
19
+ s.add_dependency 'net-ssh', '~> 2.8'
20
+ end
@@ -0,0 +1,46 @@
1
+ require 'oxidized'
2
+ Oxidized.mgr = Oxidized::Manager.new
3
+
4
+ describe Oxidized::Nodes do
5
+ before(:each) do
6
+ @nodes_org = %w(ltt-pe1.hel kes2-rr1.tku tor-peer1.oul
7
+ hal-p2.tre sav-gr1-sw1.kuo psl-sec-pe1.hel).map { |e| Oxidized::Node.new(:name=>e) }
8
+ @nodes = Oxidized::Nodes.new @nodes_org.dup
9
+ end
10
+
11
+ describe '#put' do
12
+ it 'adds node to top of queue' do
13
+ node = Oxidized::Node.new(:name=>'kst-p1.sto')
14
+ @nodes.put node
15
+ expect(@nodes).to eq [node] + @nodes_org
16
+ end
17
+ end
18
+
19
+ describe '#get' do
20
+ it 'returns node from top of queue' do
21
+ expect(@nodes.get).to eq @nodes_org.first
22
+ end
23
+ it 'moves node from top to bottom' do
24
+ @nodes.get
25
+ expect(@nodes).to end_with [@nodes_org.first]
26
+ end
27
+ it 'does not change node count' do
28
+ before = @nodes.size
29
+ @nodes.get
30
+ expect(before).to eq @nodes.size
31
+ end
32
+ end
33
+
34
+ describe '#next' do
35
+ it 'moves node to top of queue' do
36
+ node = @nodes[3]
37
+ @nodes.next node.name
38
+ expect(@nodes).to start_with [node]
39
+ end
40
+ it 'does not change node count' do
41
+ before = @nodes.size
42
+ @nodes.next @nodes[3].name
43
+ expect(before).to eq @nodes.size
44
+ end
45
+ end
46
+ end
metadata ADDED
@@ -0,0 +1,136 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: oxidized
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Saku Ytti
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: asetus
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: slop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '3.5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '3.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: net-ssh
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '2.8'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.8'
55
+ description: software to fetch configuration from network devices and store them
56
+ email:
57
+ - saku@ytti.fi
58
+ executables:
59
+ - oxidized
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - CHANGELOG.md
64
+ - Gemfile
65
+ - README.md
66
+ - Rakefile
67
+ - TODO.md
68
+ - bin/oxidized
69
+ - extra/rest_client.rb
70
+ - extra/syslog.rb
71
+ - lib/oxidized.rb
72
+ - lib/oxidized/cli.rb
73
+ - lib/oxidized/config.rb
74
+ - lib/oxidized/config/vars.rb
75
+ - lib/oxidized/core.rb
76
+ - lib/oxidized/input/cli.rb
77
+ - lib/oxidized/input/input.rb
78
+ - lib/oxidized/input/ssh.rb
79
+ - lib/oxidized/input/telnet.rb
80
+ - lib/oxidized/job.rb
81
+ - lib/oxidized/jobs.rb
82
+ - lib/oxidized/log.rb
83
+ - lib/oxidized/manager.rb
84
+ - lib/oxidized/model/acos.rb
85
+ - lib/oxidized/model/aireos.rb
86
+ - lib/oxidized/model/aos.rb
87
+ - lib/oxidized/model/aos7.rb
88
+ - lib/oxidized/model/aosw.rb
89
+ - lib/oxidized/model/eos.rb
90
+ - lib/oxidized/model/fortios.rb
91
+ - lib/oxidized/model/ios.rb
92
+ - lib/oxidized/model/iosxr.rb
93
+ - lib/oxidized/model/ironware.rb
94
+ - lib/oxidized/model/junos.rb
95
+ - lib/oxidized/model/model.rb
96
+ - lib/oxidized/model/powerconnect.rb
97
+ - lib/oxidized/model/procurve.rb
98
+ - lib/oxidized/model/timos.rb
99
+ - lib/oxidized/node.rb
100
+ - lib/oxidized/node/stats.rb
101
+ - lib/oxidized/nodes.rb
102
+ - lib/oxidized/output/file.rb
103
+ - lib/oxidized/output/git.rb
104
+ - lib/oxidized/output/output.rb
105
+ - lib/oxidized/source/csv.rb
106
+ - lib/oxidized/source/source.rb
107
+ - lib/oxidized/source/sql.rb
108
+ - lib/oxidized/string.rb
109
+ - lib/oxidized/worker.rb
110
+ - oxidized.gemspec
111
+ - spec/nodes_spec.rb
112
+ homepage: http://github.com/ytti/oxidized
113
+ licenses:
114
+ - Apache-2.0
115
+ metadata: {}
116
+ post_install_message:
117
+ rdoc_options: []
118
+ require_paths:
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: 1.9.3
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - '>='
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ requirements: []
131
+ rubyforge_project: oxidized
132
+ rubygems_version: 2.0.14
133
+ signing_key:
134
+ specification_version: 4
135
+ summary: feeble attempt at rancid
136
+ test_files: []