Class: MotherBrain::Provisioner::Base
- Inherits:
-
Object
- Object
- MotherBrain::Provisioner::Base
- Includes:
- Celluloid, MB::Mixin::Services, Logging
- Defined in:
- lib/mb/provisioner.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.provisioner_id ⇒ Symbol
readonly
The identifier for the Provisioner.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
- .register_provisioner(provisioner_id, options = {}) ⇒ Object
-
.validate_create(created, manifest) ⇒ Object
Validate that the return created nodes contains the expected number of nodes and the proper instance types.
Instance Method Summary collapse
-
#down(job, environment_name, options = {}) ⇒ Boolean
Destroy a set of provisioned nodes.
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
-
#up(job, env_name, manifest, plugin, options = {}) ⇒ Array
Request a provisioner to generate a set of nodes described by the given manifest.
Methods included from Logging
add_argument_header, dev, filename, #log_exception, logger, #logger, reset, set_logger, setup
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
138 139 140 |
# File 'lib/mb/provisioner.rb', line 138 def initialize( = {}) @options = end |
Class Attribute Details
.provisioner_id ⇒ Symbol (readonly)
The identifier for the Provisioner
109 110 111 |
# File 'lib/mb/provisioner.rb', line 109 def provisioner_id @provisioner_id end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
136 137 138 |
# File 'lib/mb/provisioner.rb', line 136 def @options end |
Class Method Details
.register_provisioner(provisioner_id, options = {}) ⇒ Object
112 113 114 115 |
# File 'lib/mb/provisioner.rb', line 112 def register_provisioner(provisioner_id, = {}) @provisioner_id = provisioner_id.to_sym Provisioner.register(self, ) end |
.validate_create(created, manifest) ⇒ Object
Validate that the return created nodes contains the expected number of nodes and the proper instance types
125 126 127 128 129 |
# File 'lib/mb/provisioner.rb', line 125 def validate_create(created, manifest) unless created.length == manifest.node_count raise UnexpectedProvisionCount.new(manifest.node_count, created.length) end end |
Instance Method Details
#down(job, environment_name, options = {}) ⇒ Boolean
Destroy a set of provisioned nodes
181 182 183 |
# File 'lib/mb/provisioner.rb', line 181 def down(job, environment_name, = {}) raise AbstractFunction end |
#up(job, env_name, manifest, plugin, options = {}) ⇒ Array
Request a provisioner to generate a set of nodes described by the given manifest
166 167 168 |
# File 'lib/mb/provisioner.rb', line 166 def up(job, env_name, manifest, plugin, = {}) raise AbstractFunction end |