module Subordinate::Client::View

View

@see ci.jenkins-ci.org/view/All%20Unstable/api/

Public Instance Methods

add_job_to_view(view_name, job, options = {}) click to toggle source

Add a job to the Jenkins view

@see ci.jenkins-ci.org/view/All%20Unstable/api/

@param view_name [String] the name of the view you want inforamtion on @param job [String] the name of the job you want to add

@return [Integer] status the status of the request

@example Add the selected Job to the Jenkins View

Subordinate::Client.add_job_to_view("My-Awesome-View", "My-Awesome-Job")

@author Jason Truluck

# File lib/subordinate/client/view.rb, line 55
def add_job_to_view(view_name, job, options = {})
  options.merge!(
    :name => job
  )
  post("view/#{view_name}/addJobToView", options)
end
all_views(options = {}) click to toggle source

Returns all of the views with their corresponding jobs

@see ci.jenkins-ci.org/api/json?tree=views[name,jobs[name]]

@return [Hashie::Mash] response containing all views on the server and their respective jobs

@example Get all the views

Subordinate::Client.all_views

@author Jason Truluck

# File lib/subordinate/client/view.rb, line 34
def all_views(options = {})
  options.merge!(
    :tree => "views[name,url,jobs[name,url]]"
  )
  get("api/json", options)
end
remove_job_from_view(view_name, job, options = {}) click to toggle source

Remove a job to the Jenkins view

@see ci.jenkins-ci.org/view/All%20Unstable/api/

@param view_name [String] the name of the view you want inforamtion on @param job [String] the name of the job you want to remove

@return [Integer] status the status of the request

@example Remove the selected job from the Jenkins View

Subordinate::Client.remove_job_from_view("My-Awesome-View", "My-Awesome-Job")

@author Jason Truluck

# File lib/subordinate/client/view.rb, line 75
def remove_job_from_view(view_name, job, options = {})
  options.merge!(
   :name => job
  )
  post("view/#{view_name}/removeJobFromView", options)
end
view(view_name, options = {}) click to toggle source

Returns the specified view

@see ci.jenkins-ci.org/view/All%20Unstable/api/json?pretty=true

@param view_name [String] the name of the view you want inforamtion on

@return [Hashie::Mash] response from the specified view

@example Get the current view

Subordinate::Client.view("My-Awesome-View")

@author Jason Truluck

# File lib/subordinate/client/view.rb, line 20
def view(view_name, options = {})
  get("view/#{view_name}/api/json", options)
end