class MotherBrain::Provisioner::Base
Attributes
provisioner_id[R]
The identifier for the Provisioner
@return [Symbol]
options[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/mb/provisioner.rb, line 138 def initialize(options = {}) @options = options end
register_provisioner(provisioner_id, options = {})
click to toggle source
@param [#to_sym] provisioner_id
# File lib/mb/provisioner.rb, line 112 def register_provisioner(provisioner_id, options = {}) @provisioner_id = provisioner_id.to_sym Provisioner.register(self, options) end
validate_create(created, manifest)
click to toggle source
Validate that the return created nodes contains the expected number of nodes and the proper instance types
@param [Array<Hash>] created @param [Provisioner::Manifest] manifest
@raise [UnexpectedProvisionCount] if an unexpected amount of nodes was returned by the
request to the provisioner
# 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
Public Instance Methods
down(job, environment_name, options = {})
click to toggle source
Destroy a set of provisioned nodes
@param [MB::Job] job @param [String] environment_name
name of the set of nodes to destroy
@param [Hash] options
@raise [MB::ProvisionError]
if a caught error occurs during provisioning
@return [Boolean]
# File lib/mb/provisioner.rb, line 181 def down(job, environment_name, options = {}) raise AbstractFunction end
up(job, env_name, manifest, plugin, options = {})
click to toggle source
Request a provisioner to generate a set of nodes described by the given manifest
@param [MB::Job] job @param [String] env_name
name of the set of nodes to be created
@param [MB::Provisioner::Manifest] manifest
manifest describing how many and what kind of nodes to create
@param [MB::Plugin] plugin @param [Hash] options
@example
[ { instance_type: "m1.large", public_hostname: "cloud-1.riotgames.com" }, { instance_type: "m1.small", public_hostname: "cloud-2.riotgames.com" } ]
@return [Array]
an array of hashes representing nodes generated of given sizes
# File lib/mb/provisioner.rb, line 166 def up(job, env_name, manifest, plugin, options = {}) raise AbstractFunction end