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_query_string_parameters, #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.
82 83 84 85 86 87 |
# File 'lib/artifactory/resources/system.rb', line 82 def configuration( = {}) client = extract_client!() response = client.get('/api/system/configuration') REXML::Document.new(response) end |
.info(options = {}) ⇒ String
Get general system information.
35 36 37 38 |
# File 'lib/artifactory/resources/system.rb', line 35 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.
60 61 62 63 64 65 |
# File 'lib/artifactory/resources/system.rb', line 60 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.
104 105 106 107 108 109 110 111 |
# File 'lib/artifactory/resources/system.rb', line 104 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.
128 129 130 131 |
# File 'lib/artifactory/resources/system.rb', line 128 def version( = {}) client = extract_client!() client.get('/api/system/version') end |