Module: Subordinate::Client::System

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

Overview

System level tasks for Jenkins Server. These functions typically require admin level privileges to execute.

Instance Method Summary collapse

Instance Method Details

#cancel_quiet_down(options = {}) ⇒ Integer

Cancel a shut down request to the Jenkins Server

Examples:

Send a quiet down request to the Jenkins server

Subordinate::Client.cancel_quiet_down

Returns:

  • (Integer)

    response code

See Also:



42
43
44
# File 'lib/subordinate/client/system.rb', line 42

def cancel_quiet_down(options = {})
  post('/cancelQuietDown', options)
end

#quiet_down(options = {}) ⇒ Integer

Shuts down Jenkins Server

Examples:

Send a quiet down request to the Jenkins server

Subordinate::Client.quiet_down

Returns:

  • (Integer)

    response code

See Also:



30
31
32
# File 'lib/subordinate/client/system.rb', line 30

def quiet_down(options = {})
  post('/quietDown', options)
end

#restart(options = {}) ⇒ Integer

Restarts the jenkins server, will not wait for jobs to finish

Examples:

Sends a force restart request to the Jenkins server

Subordinate::Client.restart(true)

Returns:

  • (Integer)

    response code

See Also:



54
55
56
# File 'lib/subordinate/client/system.rb', line 54

def restart(options = {})
  post("restart", options)
end

#root(options = {}) ⇒ Hashie::Mash

Returns the response from the root api

Examples:

Get the root api response

Subordinate::Client.root

Returns:

  • (Hashie::Mash)

    State is the server is currently up

See Also:



18
19
20
# File 'lib/subordinate/client/system.rb', line 18

def root(options = {})
  get('/api/json', options)
end

#safe_restart(options = {}) ⇒ Integer

Safely Restarts the jenkins server, will wait for jobs to finish

Examples:

Sends a restart request to the Jenkins server (defaults to no force)

Subordinate::Client.restart

Returns:

  • (Integer)

    response code

See Also:



66
67
68
# File 'lib/subordinate/client/system.rb', line 66

def safe_restart(options = {})
  post("safeRestart", options)
end