Class: JenkinsApi::Client::Root

Inherits:
Object
  • Object
show all
Includes:
UriHelper
Defined in:
lib/improved_jenkins_client/root.rb

Overview

This class communicates with Jenkins API at the root address to obtain details on the page displayed to users on the Jenkins’ ‘homepage,’ and other data items such as quietingDown

Instance Method Summary collapse

Methods included from UriHelper

#form_encode, #path_encode

Constructor Details

#initialize(client) ⇒ Root

Initializes a new root object

Parameters:

  • client (Client)

    the client object



37
38
39
40
# File 'lib/improved_jenkins_client/root.rb', line 37

def initialize(client)
  @client = client
  @logger = @client.logger
end

Instance Method Details

#descriptionString

Get message displayed to users on the homepage

Returns:

  • (String)

    description - message displayed to users



61
62
63
64
# File 'lib/improved_jenkins_client/root.rb', line 61

def description
  response_json = @client.api_get_request('', 'tree=description')
  response_json['description']
end

#quieting_down?Boolean

Check if Jenkins is in shutdown mode

Returns:

  • (Boolean)

    true if server in shutdown mode



52
53
54
55
# File 'lib/improved_jenkins_client/root.rb', line 52

def quieting_down?
  response_json = @client.api_get_request('', 'tree=quietingDown')
  response_json['quietingDown']
end

#to_sObject

Return a string representation of the object



44
45
46
# File 'lib/improved_jenkins_client/root.rb', line 44

def to_s
  "#<JenkinsApi::Client::Root>"
end