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!, find_from_config, #format_repos!, format_repos!, from_hash, from_url, has_attribute?, #initialize, #inspect, list_from_config, #set, #to_hash, #to_json, #to_matrix_properties, #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 92 93 94 95 |
# File 'lib/artifactory/resources/system.rb', line 88 def update_configuration(xml, = {}) client = extract_client!() # The Artifactory api requires a content type of 'application/xml'. # See http://bit.ly/1l2IvZY headers = { 'Content-Type' => 'application/xml' } client.post('/api/system/configuration', xml, headers) end |
.version(options = {}) ⇒ Hash
Get the version information from the server.
112 113 114 115 |
# File 'lib/artifactory/resources/system.rb', line 112 def version( = {}) client = extract_client!() client.get('/api/system/version') end |