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 update_name
          raise 'This action requires the new_name field to be specified.' unless @new_resource.new_name
          @item.retrieve! || raise("#{@resource_name} '#{@name}' not found!")
          return Chef::Log.info("#{@resource_name} '#{@name}' is up to date") if @item['name'] == @new_resource.new_name
          new_name_in_use = resource_named(:ArtifactBundle).new(@item.client, name: @new_resource.new_name).exists?
          raise "ArtifactBundle name '#{@new_resource.new_name}' is already in use." if new_name_in_use
          Chef::Log.debug "New name #{@new_resource.new_name} differs from current name'#{@name}' for resource."
          @context.converge_by "Update #{@resource_name}'s name from '#{@name}' to #{@new_resource.new_name} completed successfully" do
            @item.update_name(@new_resource.new_name)
          end
        end
def update_name raise 'This action requires the new_name field to be specified.' unless @new_resource . new_name @item . retrieve! || raise ( "#{@resource_name} '#{@name}' not found!" ) return Chef :: Log . info ( "#{@resource_name} '#{@name}' is up to date" ) if @item [ 'name' ] == @new_resource . new_name new_name_in_use = resource_named ( :ArtifactBundle ) . new ( @item . client , name : @new_resource . new_name ) . exists? raise "ArtifactBundle name '#{@new_resource.new_name}' is already in use." if new_name_in_use Chef :: Log . debug "New name #{@new_resource.new_name} differs from current name'#{@name}' for resource." @context . converge_by "Update #{@resource_name}'s name from '#{@name}' to #{@new_resource.new_name} completed successfully" do @item . update_name ( @new_resource . new_name ) 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 .