libraries/resource_providers/image_streamer/api300/artifact_bundle_provider.rb
# Call the 'add_<resource_type>' methods for based on the resource_type passed in to allow using names
# @param [String, Symbol] resource_type Type of resource to be loaded. e.g., :GoldenImage, :FCNetwork.
# @param [Array] resource_array Array containing the names of the resources and whether they are readonly or not. e.g., [{'DP', false}]
# @param [String] add_method String containing the name of the method which adds the arrays of resources to the artifact bundle.
Call the 'add_' methods for based on the resource_type passed in to allow using names
Call the ' add_ ' methods for based on the resource_type passed in to allow using names
def download_backup
          raise "#{@resource_name} #{@new_resource.file_path} must be specified for this action" unless @new_resource.file_path
          return Chef::Log.info("File '#{@new_resource.file_path}' already exists in specified location.") if File.file?(@new_resource.file_path)
          backup = @item.class.get_backups(@item.client).first
          raise 'There are no backups present in the appliance. Cannot run download_backup action.' unless backup
          @context.converge_by "Downloading appliance backup image to '#{@new_resource.file_path}' completed successfully" do
            @item.class.download_backup(@item.client, @new_resource.file_path, backup)
          end
        end
def download_backup raise "#{@resource_name} #{@new_resource.file_path} must be specified for this action" unless @new_resource . file_path return Chef :: Log . info ( "File '#{@new_resource.file_path}' already exists in specified location." ) if File . file? ( @new_resource . file_path ) backup = @item . class . get_backups ( @item . client ) . first raise 'There are no backups present in the appliance. Cannot run download_backup action.' unless backup @context . converge_by "Downloading appliance backup image to '#{@new_resource.file_path}' completed successfully" do @item . class . download_backup ( @item . client , @new_resource . file_path , backup ) end end
Call the 'add_<resource_type>' methods for based on the resource_type passed in to allow using names
Call the ' add_<resource_type > ' methods for based on the resource_type passed in to allow using names
add_method String containing the name of the method which adds the arrays of resources to the artifact bundle.
add_method String containing the name of the method which adds the arrays of resources to the artifact bundle .