libraries/resource_providers/image_streamer/api300/artifact_bundle_provider.rb
def backup_from_file
          raise "#{@resource_name} #{@new_resource.file_path} must be specified for this action" unless @new_resource.file_path
          raise "'#{@new_resource.file_path}' file does not exist." unless File.file?(@new_resource.file_path)
          raise 'A deployment_group field is required for this action.' unless @new_resource.deployment_group
          deployment_group = load_resource(:DeploymentGroup, @new_resource.deployment_group)
          Chef::Log.info("Starting upload of backup file #{@new_resource.file_path}...")
          @context.converge_by "Upload of backup file '#{@new_resource.file_path}' completed successfully" do
            return @item.class.create_backup_from_file!(@item.client, deployment_group, @new_resource.file_path, @name) unless @new_resource.timeout
            return @item.class.create_backup_from_file!(@item.client, deployment_group, @new_resource.file_path, @name, @new_resource.timeout)
          end
        end
# 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 backup_from_file
          raise "#{@resource_name} #{@new_resource.file_path} must be specified for this action" unless @new_resource.file_path
          raise "'#{@new_resource.file_path}' file does not exist." unless File.file?(@new_resource.file_path)
          raise 'A deployment_group field is required for this action.' unless @new_resource.deployment_group
          deployment_group = load_resource(:DeploymentGroup, @new_resource.deployment_group)
          Chef::Log.info("Starting upload of backup file #{@new_resource.file_path}...")
          @context.converge_by "Upload of backup file '#{@new_resource.file_path}' completed successfully" do
            return @item.class.create_backup_from_file!(@item.client, deployment_group, @new_resource.file_path, @name) unless @new_resource.timeout
            return @item.class.create_backup_from_file!(@item.client, deployment_group, @new_resource.file_path, @name, @new_resource.timeout)
          end
        end
def backup_from_file raise "#{@resource_name} #{@new_resource.file_path} must be specified for this action" unless @new_resource . file_path raise "'#{@new_resource.file_path}' file does not exist." unless File . file? ( @new_resource . file_path ) raise 'A deployment_group field is required for this action.' unless @new_resource . deployment_group deployment_group = load_resource ( :DeploymentGroup , @new_resource . deployment_group ) Chef :: Log . info ( "Starting upload of backup file #{@new_resource.file_path}..." ) @context . converge_by "Upload of backup file '#{@new_resource.file_path}' completed successfully" do return @item . class . create_backup_from_file! ( @item . client , deployment_group , @new_resource . file_path , @name ) unless @new_resource . timeout return @item . class . create_backup_from_file! ( @item . client , deployment_group , @new_resource . file_path , @name , @new_resource . timeout ) 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 .