Module: Subordinate::Client::View

Included in:
Subordinate::Client
Defined in:
lib/subordinate/client/view.rb

Overview

View

Instance Method Summary collapse

Instance Method Details

#add_job_to_view(view_name, job, options = {}) ⇒ Integer

Add a job to the Jenkins view

Examples:

Add the selected Job to the Jenkins View

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

Parameters:

  • view_name (String)

    the name of the view you want inforamtion on

  • job (String)

    the name of the job you want to add

Returns:

  • (Integer)

    status the status of the request

See Also:

Author:

  • Jason Truluck



55
56
57
58
59
60
# 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 = {}) ⇒ Hashie::Mash

Returns all of the views with their corresponding jobs

Examples:

Get all the views

Subordinate::Client.all_views

Returns:

  • (Hashie::Mash)

    response containing all views on the server and their respective jobs

See Also:

Author:

  • Jason Truluck



34
35
36
37
38
39
# 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 = {}) ⇒ Integer

Remove a job to the Jenkins view

Examples:

Remove the selected job from the Jenkins View

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

Parameters:

  • view_name (String)

    the name of the view you want inforamtion on

  • job (String)

    the name of the job you want to remove

Returns:

  • (Integer)

    status the status of the request

See Also:

Author:

  • Jason Truluck



75
76
77
78
79
80
# 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 = {}) ⇒ Hashie::Mash

Returns the specified view

Examples:

Get the current view

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

Parameters:

  • view_name (String)

    the name of the view you want inforamtion on

Returns:

  • (Hashie::Mash)

    response from the specified view

See Also:

Author:

  • Jason Truluck



20
21
22
# File 'lib/subordinate/client/view.rb', line 20

def view(view_name, options = {})
  get("view/#{view_name}/api/json", options)
end