Class: Jenkins2API::Endpoint::Configuration

Inherits:
BaseEndpoint show all
Defined in:
lib/endpoints/configuration.rb

Overview

This class contains all the calls to reach Jenkins2 Configuration

Instance Method Summary collapse

Methods inherited from BaseEndpoint

#initialize

Constructor Details

This class inherits a constructor from Jenkins2API::Endpoint::BaseEndpoint

Instance Method Details

#plugin_install(name, short) ⇒ Object

Install a plugin



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/endpoints/configuration.rb', line 14

def plugin_install(name, short)
  json = { name => { default: true } }
  @client.api_request(
    :post,
    '/pluginManager/install',
    :raw,
    json: json.to_json,
    dynamicLoad: 'Install without restart',
    :"plugin.#{short}.default" => 'on'
  )
end

#plugin_listObject

list all installed plugin



9
10
11
# File 'lib/endpoints/configuration.rb', line 9

def plugin_list
  @client.api_request(:get, '/pluginManager', depth: 10)['plugins']
end

#safe_restartObject

Safe-restart jenkins



27
28
29
30
31
32
33
# File 'lib/endpoints/configuration.rb', line 27

def safe_restart
  @client.api_request(
    :post,
    '/updateCenter/safeRestart',
    :raw
  )
end