Class: Spice::Node
- Inherits:
-
Object
- Object
- Spice::Node
- Extended by:
- Persistence
- Includes:
- Persistence, Toy::Store
- Defined in:
- lib/spice/node.rb
Instance Attribute Summary (collapse)
-
- (Hash) automatic
The automatic attribute.
-
- (String) chef_type
The chef_type attribute.
-
- (Hash) default
The default attribute.
-
- (String) json_class
The json_class attribute.
-
- (String) name
The name attribute.
-
- (Hash) normal
The normal attribute.
-
- (Hash) override
The override attribute.
-
- (Array) run_list
The run_list attribute.
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Boolean) new_record?
Check if the node exists on the Chef server.
Methods included from Persistence
all, connection, do_delete, do_post, do_put, endpoint, get, included
Instance Attribute Details
- (Hash) automatic
The automatic attribute
20 |
# File 'lib/spice/node.rb', line 20 attribute :automatic, Hash, :default => {} |
- (String) chef_type
The chef_type attribute
15 |
# File 'lib/spice/node.rb', line 15 attribute :chef_type, String, :default => "node" |
- (Hash) default
The default attribute
19 |
# File 'lib/spice/node.rb', line 19 attribute :default, Hash, :default => {} |
- (String) json_class
The json_class attribute
16 |
# File 'lib/spice/node.rb', line 16 attribute :json_class, String, :default => "Chef::Node" |
- (String) name
The name attribute
14 |
# File 'lib/spice/node.rb', line 14 attribute :name, String |
- (Hash) normal
The normal attribute
17 |
# File 'lib/spice/node.rb', line 17 attribute :normal, Hash, :default => {} |
- (Hash) override
The override attribute
18 |
# File 'lib/spice/node.rb', line 18 attribute :override, Hash, :default => {} |
- (Array) run_list
The run_list attribute
21 |
# File 'lib/spice/node.rb', line 21 attribute :run_list, Array, :default => [] |
Class Method Details
+ (Object) get(name)
25 26 27 |
# File 'lib/spice/node.rb', line 25 def self.get(name) connection.node(name) end |
Instance Method Details
- (Boolean) new_record?
Check if the node exists on the Chef server
30 31 32 33 34 35 36 37 |
# File 'lib/spice/node.rb', line 30 def new_record? begin connection.get("/nodes/#{name}") return false rescue Spice::Error::NotFound return true end end |