invoracle 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ CHANGELOG
2
+ ---------
3
+ - **2014-03-05**: 0.0.3
4
+ - Retreive Systems from Cluster via SysRoles
5
+ - Inflate System SysRoles
6
+
7
+ - **2014-02-15**: 0.0.2
8
+ - Invoracle::Cluster is now a JsonDoc subclass
9
+ - Inforacle::Infra::IostatParser added
10
+
11
+ - **2014-01-01**: 0.0.1
12
+ - Initial release
13
+ - JsonDoc subclass for Invoracle::System
File without changes
data/README.md ADDED
@@ -0,0 +1,104 @@
1
+ Invoracle: DevOps Inventory Reporting System
2
+ ============================================
3
+
4
+ Synopsis
5
+ --------
6
+
7
+ Invoracle (short for Inventory Oracle), provides the basis of a flexible inventory reporting system that can be used to build custom reports for managing large numbers of computer systems. It is designed to provide a foundation of reporting for thousands of systems using a generic, extensible JSON schema.
8
+
9
+ The Invoracle::System class is a subclass of the JsonDoc Ruby gem and adds a default JSON schema for computer systems to the functionality available in JsonDoc. It can be used as is or it can be further subclassed to add additional custom attributes.
10
+
11
+ Primary use cases include use as a core document object that various parsers can leverage to populate a strict schema JSON document and to build reporting systems such as CSV/Excel reports.
12
+
13
+ Installing
14
+ ----------
15
+
16
+ To install SalesforceCache, use the following command:
17
+
18
+ $ gem install invoracle
19
+
20
+ #Examples
21
+ ---------
22
+
23
+ require 'invoracle'
24
+
25
+ system = Invoracle::System.new
26
+
27
+ schema = generic_system.dSchema
28
+
29
+ system.setAttr(:sSysFqdn, system_fqdn)
30
+
31
+ system_fqdn = system.getAttr(:sSysFqdn)
32
+ system_hash = system.asHash
33
+ system_json = system.asJson
34
+
35
+ #Documentation
36
+ --------------
37
+
38
+ This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:
39
+
40
+ $ gem install yard
41
+ $ yard server -g
42
+
43
+ Notes
44
+ -----
45
+
46
+ 1. Default Schema
47
+
48
+ To view the default schema, you can use pretty print the default schema using the dSchema accessor. The default schema uses Hungarian CamelCase (HCC) names which are described below. These names are still in development so please provide feedback.
49
+
50
+ 2. Schema Property Formats
51
+
52
+ The default properties, which can be overridden, use a short form of "Hungarian CamelCase" where properties are prefixed with type abbreviations including ['a','d','f','i','j','s','x'] for:
53
+
54
+ a = array,
55
+ d = dictionary / hash,
56
+ f = float / number,
57
+ h = html / string,
58
+ i = integer / number,
59
+ j = JSON / string,
60
+ s = string,
61
+ x = XML / string
62
+
63
+ 3. Subclassing
64
+
65
+ To subclass this module, override the getDefaultSchema() method and add your own schema. To add a schema on to the default schema see the Usage section above.
66
+
67
+ 4. Schema Validation
68
+
69
+ Schema validation is not provided in this version.
70
+
71
+ #Change Log
72
+ -----------
73
+
74
+ - **2014-03-05**: 0.0.3
75
+ - Retreive Systems from Cluster via SysRoles
76
+ - Inflate System SysRoles
77
+
78
+ - **2014-02-15**: 0.0.2
79
+ - Invoracle::Cluster is now a JsonDoc subclass
80
+ - Inforacle::Infra::IostatParser added
81
+
82
+ - **2014-01-01**: 0.0.1
83
+ - Initial release
84
+ - JsonDoc subclass for Invoracle::System
85
+
86
+ Please see the {file:CHANGELOG.md} document for additional release information.
87
+
88
+ #Links
89
+ ------
90
+
91
+ * JSON: http://www.json.org/
92
+ * JSON Schema: http://json-schema.org/
93
+
94
+ #Copyright and License
95
+ ----------------------
96
+
97
+ Invoracle © 2014 by [John Wang](mailto:johncwang@gmail.com).
98
+
99
+ Invoracle is licensed under the MIT license. Please see the {file:LICENSE} document for more information.
100
+
101
+ Warranty
102
+ --------
103
+
104
+ This software is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -61,5 +61,31 @@ module Invoracle
61
61
  end
62
62
  return oSystem
63
63
  end
64
+
65
+ def inflateSysRoles()
66
+ @dSystems.each do |sSysUid,oSystem|
67
+ oSystem.inflateSysRoles
68
+ end
69
+ end
70
+
71
+ def getSystems(aSysRoles=nil)
72
+ aSysRoles = nil unless aSysRoles.kind_of?(Array)
73
+ aSystems = []
74
+ if aSysRoles.nil?
75
+ @dSystems.each do |sSysUid,oSystem|
76
+ aSystems.push(oSystem)
77
+ end
78
+ else
79
+ @dSystems.each do |sSysUid,oSystem|
80
+ aSysRoles.each do |sSysRole|
81
+ if oSystem.hasSysRole(sSysRole)
82
+ aSystems.push(oSystem)
83
+ break
84
+ end
85
+ end
86
+ end
87
+ end
88
+ return aSystems
89
+ end
64
90
  end
65
91
  end
@@ -61,6 +61,7 @@ module Invoracle
61
61
  :sRaidControllerName => { :default => '', :type => 'string', :description => 'RAID Controler' },
62
62
  :iRaidDrivesNumAll => { :default => -1, :type => 'number', :description => 'RAID Drives All' },
63
63
  :iRaidDrivesNumBad => { :default => -1, :type => 'number', :description => 'RAID Drives Bad' },
64
+ :sRaidVolumesRaw => { :default => '', :type => 'string', :description => 'RAID Volumes Raw' },
64
65
 
65
66
  :sVirType => { :default => '', :type => 'string', :description => 'VM Type' },
66
67
  :sVirHostFqdn => { :default => '', :type => 'string', :description => 'VM Host FQDN' },
@@ -77,5 +78,28 @@ module Invoracle
77
78
  }
78
79
  return dSchema
79
80
  end
81
+
82
+ def inflateSysRoles()
83
+ sSysRoles = self.getAttr(:sSysRoles)
84
+ aSysRoles = self.getAttr(:aSysRoles)
85
+ dSysRoles = self.getAttr(:dSysRoles)
86
+ aSysRoles.each do |sSysRole|
87
+ dSysRoles[sSysRole] = 1
88
+ end
89
+ sSysRoles.split(',').each do |sSysRole|
90
+ dSysRoles[sSysRole] = 1
91
+ end
92
+ self.setAttr(:dSysRoles,dSysRoles)
93
+ self.setAttr(:aSysRoles,dSysRoles.keys)
94
+ self.setAttr(:sSysRoles,dSysRoles.keys.join(','))
95
+ end
96
+
97
+ def hasSysRole(sSysRole=nil)
98
+ return false if sSysRole.nil?
99
+ if self.getAttr(:dSysRoles).has_key?(sSysRole)
100
+ return true
101
+ end
102
+ return false
103
+ end
80
104
  end
81
105
  end
metadata CHANGED
@@ -1,54 +1,64 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: invoracle
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.3
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - John Wang
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-02-15 00:00:00.000000000 Z
12
+
13
+ date: 2014-03-05 00:00:00 Z
12
14
  dependencies: []
15
+
13
16
  description: A simple generic inventory system for managing computer systems.
14
17
  email: john@johnwang.com
15
18
  executables: []
19
+
16
20
  extensions: []
21
+
17
22
  extra_rdoc_files: []
18
- files:
19
- - CHANGELOG
20
- - MIT-LICENSE
21
- - README.rdoc
23
+
24
+ files:
25
+ - CHANGELOG.md
26
+ - LICENSE
27
+ - README.md
22
28
  - Rakefile
23
29
  - VERSION
24
30
  - lib/invoracle.rb
25
31
  - lib/invoracle/cluster.rb
32
+ - lib/invoracle/system.rb
26
33
  - lib/invoracle/infra.rb
27
34
  - lib/invoracle/infra/iostat_parser.rb
28
- - lib/invoracle/system.rb
29
35
  - test/test_setup.rb
30
36
  homepage: http://johnwang.com/
31
- licenses:
37
+ licenses:
32
38
  - MIT
33
- metadata: {}
34
39
  post_install_message:
35
40
  rdoc_options: []
36
- require_paths:
41
+
42
+ require_paths:
37
43
  - lib
38
- required_ruby_version: !ruby/object:Gem::Requirement
39
- requirements:
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
40
47
  - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '0'
43
- required_rubygems_version: !ruby/object:Gem::Requirement
44
- requirements:
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
45
53
  - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
48
56
  requirements: []
57
+
49
58
  rubyforge_project:
50
- rubygems_version: 2.2.1
59
+ rubygems_version: 1.8.11
51
60
  signing_key:
52
- specification_version: 4
61
+ specification_version: 3
53
62
  summary: Inventory Oracle - inventory management system
54
63
  test_files: []
64
+
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 84308907a4cb30a7945bb2c4ce410a18ca449a58
4
- data.tar.gz: 64380199c2ef77130ddb1c9891c30db2ced9c301
5
- SHA512:
6
- metadata.gz: b15f3895c76951e812fb6ab3e2aa229a8e657a83dd4a732313ddf462888f3a402536ffe614b11c229eda0d232d9282e46ea98b3067a94d204658034b79cb801a
7
- data.tar.gz: e7131a8eaa268971d6705a65172de81ef392c2bd4495392bcc134acd5500cebdb43fae3170423394d59280b19fdb616f8854b476880165932cae8715df80db29
data/CHANGELOG DELETED
@@ -1,7 +0,0 @@
1
- = 0.0.2
2
- - Invoracle::Cluster is now a JsonDoc subclass
3
- - Inforacle::Infra::IostatParser added
4
-
5
- = 0.0.1
6
- - Initial release
7
- - JsonDoc subclass for Invoracle::System
data/README.rdoc DELETED
@@ -1,84 +0,0 @@
1
- = Invoracle
2
-
3
- Invoracle (short for Inventory Oracle), is the basis of a flexible inventory reporting system that can be used to build custom reports for managing large numbers of computer systems. It is designed to provide a basis of reporting for thousands of systems using a generic, extensible JSON schema.
4
-
5
- The Invoracle::System class is a subclass of the JsonDoc Ruby gem and adds a default JSON schema for computer systems to the functionality available in JsonDoc. It can be used as is or it can be further subclassed to add additional custom attributes.
6
-
7
- Primary use cases include use as a core document object that various parsers can leverage to populate a strict schema JSON document and to build reporting systems such as CSV/Excel reports.
8
-
9
- == Installation
10
-
11
- === Gem Installation
12
-
13
- Download and install invoracle with the following:
14
-
15
- gem install invoracle
16
-
17
- == Usage
18
-
19
- require 'invoracle'
20
-
21
- system = Invoracle::System.new()
22
-
23
- schema = generic_system.dSchema
24
-
25
- system.setAttr(:sSysFqdn, system_fqdn)
26
-
27
- system_fqdn = system.getAttr(:sSysFqdn)
28
- system_hash = system.asHash
29
- system_json = system.asJson
30
-
31
- == Notes
32
-
33
- === Default Schema
34
-
35
- To view the default schema, you can use pretty print the default schema using the dSchema accessor. The default schema uses Hungarian CamelCase (HCC) names which are described below. These names are still in development so please provide feedback.
36
-
37
- === Schema Property Formats
38
-
39
- The default properties, which can be overridden, use a short form of "Hungarian CamelCase" where properties are prefixed with type abbreviations including ['a','d','f','i','j','s','x'] for:
40
-
41
- a = array
42
- d = dictionary / hash
43
- f = float / number
44
- h = html / string
45
- i = integer / number
46
- j = JSON / string
47
- s = string
48
- x = XML / string
49
-
50
- === Subclassing
51
-
52
- To subclass this module, override the getDefaultSchema() method and add your own schema. To add a schema on to the default schema see the Usage section above.
53
-
54
- === Schema Validation
55
-
56
- Schema validation is not provided in this version.
57
-
58
- == Links
59
-
60
- JSON
61
-
62
- http://www.json.org/
63
-
64
- JSON Schema
65
-
66
- http://json-schema.org/
67
-
68
- == Problems, Comments, Suggestions?
69
-
70
- All of the above are most welcome. mailto:johncwang@gmail.com
71
-
72
- == Credits
73
-
74
- John Wang - http://johnwang.com
75
-
76
- == License
77
-
78
- JsonDoc is available under an MIT-style license.
79
-
80
- :include: MIT-LICENSE
81
-
82
- == Warranty
83
-
84
- This software is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.