lib/jenkins_pipeline_builder/view.rb
# Creates a listview by accepting the given parameters hash
#
# @param [Hash] params options to create the new view
# @option params [String] :name Name of the view
# @option params [String] :type Description of the view
# @option params [String] :description Description of the view
# @option params [String] :status_filter Filter jobs based on the status.
#         Valid options: all_selected_jobs, enabled_jobs_only,
#         disabled_jobs_only. Default: all_selected_jobs
# @option params [Boolean] :filter_queue true or false
# @option params [Boolean] :filter_executors true or false
# @option params [String] :regex Regular expression to filter jobs that
#         are to be added to the view
#
# @raise [ArgumentError] if the required parameter +:name+ is not
#   specified
#
Creates a listview by accepting the given parameters hash
Creates a listview by accepting the given parameters hash
def create(params)
      raise ArgumentError, 'Name is required for creating view' unless params.is_a?(Hash) && params[:name]
      clean_up_views(params) unless JenkinsPipelineBuilder.debug
      params[:type] ||= 'listview'
      create_base_view(params[:name], params[:type], params[:parent_view])
      @logger.debug "Creating a #{params[:type]} view with params: #{params.inspect}"
      return if JenkinsPipelineBuilder.debug
      view_path = params[:parent_view].nil? ? '' : "/view/#{params[:parent_view]}"
      view_path += "/view/#{params[:name]}/configSubmit"
      @client.api_post_request(view_path, post_params(params))
    end
def create ( params ) raise ArgumentError , 'Name is required for creating view' unless params . is_a? ( Hash ) && params [ :name ] clean_up_views ( params ) unless JenkinsPipelineBuilder . debug params [ :type ] ||= 'listview' create_base_view ( params [ :name ] , params [ :type ] , params [ :parent_view ] ) @logger . debug "Creating a #{params[:type]} view with params: #{params.inspect}" return if JenkinsPipelineBuilder . debug view_path = params [ :parent_view ] . nil? ? '' : "/view/#{params[:parent_view]}" view_path += "/view/#{params[:name]}/configSubmit" @client . api_post_request ( view_path , post_params ( params ) ) end
Creates a listview by accepting the given parameters hash
Creates a listview by accepting the given parameters hash
# Name is a required parameter. Raise an error if not specified
[ArgumentError] if the required parameter +:name+ is not specified
[ ArgumentError ] if the required parameter + : name + is not specified
params
:regex Regular expression to filter jobs that are to be added to the view
: regex Regular expression to filter jobs that are to be added to the view
params options to create the new view
params options to create the new view