Class: Skewer::AWS::Node
- Inherits:
-
Object
- Object
- Skewer::AWS::Node
- Defined in:
- lib/aws/node.rb
Overview
Build out an AWS node using Fog.
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Class Method Summary collapse
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(aws_id, group_names, options = {}) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(aws_id, group_names, options = {}) ⇒ Node
Returns a new instance of Node.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/aws/node.rb', line 10 def initialize(aws_id, group_names, = {}) if [:aws_node] @node = [:aws_node] else @service = self.class.find_service() = { :image_id => aws_id, :flavor_id => SkewerConfig.get('flavor_id'), :username => SkewerConfig.get('aws_username'), :groups => group_names } if [:key_name] [:key_name] = [:key_name] end if SkewerConfig.instance.get('key_name') [:key_name] = SkewerConfig.get('key_name') end @node = @service.servers.bootstrap() end end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
8 9 10 |
# File 'lib/aws/node.rb', line 8 def node @node end |
Class Method Details
.find_by_name(dns_name, service = self.find_service({})) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/aws/node.rb', line 42 def self.find_by_name(dns_name, service = self.find_service({})) node = service.servers.select { |server| server.dns_name == dns_name }[0] if node return self.new(nil, nil, {:aws_node => node}) else return false end end |
Instance Method Details
#destroy ⇒ Object
38 39 40 |
# File 'lib/aws/node.rb', line 38 def destroy @node.destroy end |