Class: Artifactory::Resource::System
- Defined in:
- lib/artifactory/resources/system.rb
Class Method Summary collapse
-
.configuration(options = {}) ⇒ REXML::Document
Get the current system configuration as XML.
-
.info(options = {}) ⇒ String
Get general system information.
-
.ping(options = {}) ⇒ Boolean
Check the status of the Artifactory server and API.
-
.update_configuration(xml, options = {}) ⇒ Object
Update the configuration with the given XML.
-
.version(options = {}) ⇒ Hash
Get the version information from the server.
Methods inherited from Base
attribute, #attributes, attributes, #client, #client=, #client?, extract_client!, #extract_client!, format_repos!, #format_repos!, #initialize, #inspect, #set, #to_s, #url_safe, url_safe
Constructor Details
This class inherits a constructor from Artifactory::Resource::Base
Class Method Details
.configuration(options = {}) ⇒ REXML::Document
Get the current system configuration as XML.
66 67 68 69 70 71 |
# File 'lib/artifactory/resources/system.rb', line 66 def configuration( = {}) client = extract_client!() response = client.get('/api/system/configuration') REXML::Document.new(response) end |
.info(options = {}) ⇒ String
Get general system information.
19 20 21 22 |
# File 'lib/artifactory/resources/system.rb', line 19 def info( = {}) client = extract_client!() client.get('/api/system') end |
.ping(options = {}) ⇒ Boolean
Check the status of the Artifactory server and API. This method will always return a boolean response, so it’s safe to call without exception handling.
44 45 46 47 48 49 |
# File 'lib/artifactory/resources/system.rb', line 44 def ping( = {}) client = extract_client!() !!client.get('/api/system/ping') rescue Error::ConnectionError false end |
.update_configuration(xml, options = {}) ⇒ Object
Update the configuration with the given XML.
88 89 90 91 |
# File 'lib/artifactory/resources/system.rb', line 88 def update_configuration(xml, = {}) client = extract_client!() client.post('/api/system/configuration', xml) end |
.version(options = {}) ⇒ Hash
Get the version information from the server.
108 109 110 111 |
# File 'lib/artifactory/resources/system.rb', line 108 def version( = {}) client = extract_client!() client.get('/api/system/version') end |