lib/chef/provisioning/driver.rb in chef-provisioning-0.19 vs lib/chef/provisioning/driver.rb in chef-provisioning-0.20

- old
+ new

@@ -57,11 +57,11 @@ Chef::Provisioning.from_url(driver_url, config) end # # A URL representing the driver and the place where machines come from. - # This will be stuffed in machine_spec.location['driver_url'] so that the + # This will be stuffed in machine_spec.reference['driver_url'] so that the # machine can be re-inflated. URLs must have a unique scheme identifying the # driver class, and enough information to identify the place where created # machines can be found. For AWS, this is the account number; for lxc and # vagrant, it is the directory in which VMs and containers are. # @@ -92,23 +92,23 @@ end # Allocate a machine from the underlying service. This method # does not need to wait for the machine to boot or have an IP, but it must - # store enough information in machine_spec.location to find the machine + # store enough information in machine_spec.reference to find the machine # later in ready_machine. # # If a machine is powered off or otherwise unusable, this method may start # it, but does not need to wait until it is started. The idea is to get the # gears moving, but the job doesn't need to be done :) # # @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method - # @param [Chef::Provisioning::MachineSpec] machine_spec A machine specification representing this machine. + # @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine. # @param [Hash] machine_options A set of options representing the desired options when # constructing the machine # - # @return [Chef::Provisioning::MachineSpec] Modifies the passed-in machine_spec. Anything in here will be saved + # @return [Chef::Provisioning::ManagedEntry] Modifies the passed-in machine_spec. Anything in here will be saved # back after allocate_machine completes. # def allocate_machine(action_handler, machine_spec, machine_options) raise "#{self.class} does not implement allocate_machine" end @@ -119,11 +119,11 @@ # pointing at the machine, allowing useful actions like setup, converge, # execute, file and directory. # # # @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method - # @param [Chef::Provisioning::MachineSpec] machine_spec A machine specification representing this machine. + # @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine. # @param [Hash] machine_options A set of options representing the desired state of the machine # # @return [Machine] A machine object pointing at the machine, allowing useful actions like setup, # converge, execute, file and directory. # @@ -132,11 +132,11 @@ end # Connect to a machine without allocating or readying it. This method will # NOT make any changes to anything, or attempt to wait. # - # @param [Chef::Provisioning::MachineSpec] machine_spec MachineSpec representing this machine. + # @param [Chef::Provisioning::ManagedEntry] machine_spec ManagedEntry representing this machine. # @param [Hash] machine_options # @return [Machine] A machine object pointing at the machine, allowing useful actions like setup, # converge, execute, file and directory. # def connect_to_machine(machine_spec, machine_options) @@ -146,49 +146,52 @@ # Delete the given machine -- destroy the machine, # returning things to the state before allocate_machine was called. # # @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method - # @param [Chef::Provisioning::MachineSpec] machine_spec A machine specification representing this machine. + # @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine. # @param [Hash] machine_options A set of options representing the desired state of the machine def destroy_machine(action_handler, machine_spec, machine_options) raise "#{self.class} does not implement destroy_machine" end # Stop the given machine. # # @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method - # @param [Chef::Provisioning::MachineSpec] machine_spec A machine specification representing this machine. + # @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine. # @param [Hash] machine_options A set of options representing the desired state of the machine def stop_machine(action_handler, machine_spec, machine_options) raise "#{self.class} does not implement stop_machine" end # Allocate an image. Returns quickly with an ID that tracks the image. # # @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method - # @param [Chef::Provisioning::ImageSpec] image_spec A machine specification representing this machine. - # @param [Hash] image_options A set of options representing the desired state of the machine - def allocate_image(action_handler, image_spec, image_options, machine_spec) + # @param [Chef::Provisioning::ManagedEntry] image_spec An image specification representing this image. + # @param [Hash] image_options A set of options representing the desired state of the image + # @param [Chef::Provisioning::ManagedEntry] machine_spec A machine specification representing this machine. + # @param [Hash] machine_options A set of options representing the desired state of the machine used to create the image + def allocate_image(action_handler, image_spec, image_options, machine_spec, machine_options) raise "#{self.class} does not implement create_image" end # Ready an image, waiting till the point where it is ready to be used. # # @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method - # @param [Chef::Provisioning::ImageSpec] image_spec A machine specification representing this machine. - # @param [Hash] image_options A set of options representing the desired state of the machine + # @param [Chef::Provisioning::ManagedEntry] image_spec An image specification representing this image. + # @param [Hash] image_options A set of options representing the desired state of the image def ready_image(action_handler, image_spec, image_options) raise "#{self.class} does not implement ready_image" end # Destroy an image using this service. # # @param [Chef::Provisioning::ActionHandler] action_handler The action_handler object that is calling this method - # @param [Chef::Provisioning::ImageSpec] image_spec A machine specification representing this machine. - # @param [Hash] image_options A set of options representing the desired state of the machine - def destroy_image(action_handler, image_spec, image_options) + # @param [Chef::Provisioning::ManagedEntry] image_spec An image specification representing this image. + # @param [Hash] image_options A set of options representing the desired state of the image + # @param [Hash] machine_options A set of options representing the desired state of the machine used to create the image + def destroy_image(action_handler, image_spec, image_options, machine_options) raise "#{self.class} does not implement destroy_image" end # # Optional interface methods @@ -265,21 +268,25 @@ yield machine_spec if block_given? end.to_a end # Allocate a load balancer - # @param [ChefMetal::ActionHandler] action_handler The action handler - # @param [ChefMetal::LoadBalancerSpec] lb_spec Frozen LB specification + # @param [Chef::Provisioning::ActionHandler] action_handler The action handler + # @param [Chef::Provisioning::ManagedEntry] lb_spec Frozen LB specification # @param [Hash] lb_options A hash of options to pass the LB # @param [Array[ChefMetal::MachineSpec]] machine_specs An array of machine specs - # the load balancer should have + # the load balancer should have. `nil` indicates "leave the set of machines + # alone," or for new LBs, it means "no machines." def allocate_load_balancer(action_handler, lb_spec, lb_options, machine_specs) end # Make the load balancer ready - # @param [ChefMetal::ActionHandler] action_handler The action handler - # @param [ChefMetal::LoadBalancerSpec] lb_spec Frozen LB specification + # @param [Chef::Provisioning::ActionHandler] action_handler The action handler + # @param [Chef::Provisioning::ManagedEntry] lb_spec Frozen LB specification # @param [Hash] lb_options A hash of options to pass the LB + # @param [Array[ChefMetal::MachineSpec]] machine_specs An array of machine specs + # the load balancer should have. `nil` indicates "leave the set of machines + # alone," or for new LBs, it means "no machines." def ready_load_balancer(action_handler, lb_spec, lb_options, machine_specs) end # Destroy the load balancer # @param [ChefMetal::ActionHandler] action_handler The action handler