def run_executable(tags, executable, options={})
      options = {
          :executable_type => "auto",
          :right_script_revision => "latest",
          :tag_match_strategy => "all",
          :inputs => {},
          :update_inputs => []
      }.merge(options)
      execute_params = {}
      tags = [tags] unless tags.is_a?(Array)
      options[:update_inputs] = [options[:update_inputs]] unless options[:update_inputs].is_a?(Array)

      case options[:executable_type]
        when "right_script_href"
          execute_params[:right_script_href] = executable
        when "right_script_name"
          scripts = find_right_script_lineage_by_name(executable)
          execute_params[:right_script_href] = right_script_revision_from_lineage(scripts, options[:right_script_revision]).href
        when "recipe_name"
          execute_params[:recipe_name] = executable
        when "auto"
          is_recipe = executable =~ /.*::.*/
          is_href = executable =~ /^\/api\/right_scripts\/[a-zA-Z0-9]*/
          if is_recipe
            execute_params[:recipe_name] = executable
          else
            if is_href
              execute_params[:right_script_href] = executable
            else
              scripts = find_right_script_lineage_by_name(executable)
              execute_params[:right_script_href] = right_script_revision_from_lineage(scripts, options[:right_script_revision]).href
            end
          end
        else
          raise ArgumentError.new("Unknown executable_type (#{options[:executable_type]})")
      end

      if options[:inputs].length > 0
        execute_params[:inputs] = options[:inputs]
      end

      resources_by_tag = @right_api_client.tags.by_tag(
        :resource_type => "instances",
        :tags => tags,
        :match_all => options[:tag_match_strategy] == "all" ? "true" : "false"
      )

      resources_by_tag.each do |res|
        instance = @right_api_client.resource(res.links.first["href"])
        instance.run_executable(execute_params)
        options[:update_inputs].each do |update_type|
          update_inputs(instance, options[:inputs], update_type)
        end
      end
    end
def run_executable(tags, executable, options={})
      options = {
          :executable_type => "auto",
          :right_script_revision => "latest",
          :tag_match_strategy => "all",
          :inputs => {},
          :update_inputs => []
      }.merge(options)
      execute_params = {}
      tags = [tags] unless tags.is_a?(Array)
      options[:update_inputs] = [options[:update_inputs]] unless options[:update_inputs].is_a?(Array)

      case options[:executable_type]
        when "right_script_href"
          execute_params[:right_script_href] = executable
        when "right_script_name"
          scripts = find_right_script_lineage_by_name(executable)
          execute_params[:right_script_href] = right_script_revision_from_lineage(scripts, options[:right_script_revision]).href
        when "recipe_name"
          execute_params[:recipe_name] = executable
        when "auto"
          is_recipe = executable =~ /.*::.*/
          is_href = executable =~ /^\/api\/right_scripts\/[a-zA-Z0-9]*/
          if is_recipe
            execute_params[:recipe_name] = executable
          else
            if is_href
              execute_params[:right_script_href] = executable
            else
              scripts = find_right_script_lineage_by_name(executable)
              execute_params[:right_script_href] = right_script_revision_from_lineage(scripts, options[:right_script_revision]).href
            end
          end
        else
          raise ArgumentError.new("Unknown executable_type (#{options[:executable_type]})")
      end

      if options[:inputs].length > 0
        execute_params[:inputs] = options[:inputs]
      end

      resources_by_tag = @right_api_client.tags.by_tag(
        :resource_type => "instances",
        :tags => tags,
        :match_all => options[:tag_match_strategy] == "all" ? "true" : "false"
      )

      resources_by_tag.each do |res|
        instance = @right_api_client.resource(res.links.first["href"])
        instance.run_executable(execute_params)
        options[:update_inputs].each do |update_type|
          update_inputs(instance, options[:inputs], update_type)
        end
      end
    end
Initializes a new RunExecutable

 @param [RightApi::Client] right_api_client An instantiated and authenticated
   RightApi::Client instance which will be used for making the request(s)
 Runs a RightScript or Chef Recipe on all instances which have all of the
 specified tags.

 @param [String|Array<String>] tags An array of tags.  If a string is
   supplied it will be converted to an array of Strings.
 @param [String] executable RightScript name or href, or the name of a
   recipe.  This method will attempt to auto detect which it is, or you
   can be friendly and provide a hint using the executable_type option.
 @param [Hash] options A list of options where the possible values are
   - executable_type [String] One of ["auto","right_script_name","right_script_href","recipe_name"].  When set
       to "auto" we will attempt to determine if an executable is a recipe,
       a RightScript name, or a RightScript href. Defaults to "auto"
   - right_script_revision [String] When a RightScript name or href is specified,
       this can be used to declare the revision to use.  Can be a specific
       revision number or "latest".  Defaults to "latest"
   - tag_match_strategy [String] If multiple tags are specified, this will
       determine how they are matched.  When set to "all" instances with all
       tags will be matched.  When set to "any" instances with any of the
       provided tags will be matched.  Defaults to "all"
   - inputs [Hash] A hash where the keys are the name of an input and the
       value is the desired value for that input.  Uses Inputs 2.0[http://reference.rightscale.com/api1.5/resources/ResourceInputs.html#multi_update]
       semantics.
   - update_inputs [Array<String>] An array of values indicating which
       objects should be updated with the inputs supplied.  Can be empty in
       which case the inputs will be used only for this execution.  Acceptable
       values are ["current_instance","next_instance","deployment"]
 @raise [RightScriptNotFound] If the specified RightScript lineage does
   not exist, or the specified revision is not available.