Method: ArtRest::System#ping

Defined in:
lib/artrest/system.rb

#pingObject

Get this system resource’s ping subresource, i.e. issue a ping request to test whether the Artifactory server this resource represents is still in a healthy state.

Returns the plain RestClient::Response object returned by the server. In case the server is functioning properly this response will carry an HTTP 200 return code, and its body will contain the string “OK”. Otherwise, the response returned will carry a return code from the 5xx family, and its body will be a text describing the problem.

  • Returns :

    • The plain RestClient::Response object as returned by the server



53
54
55
56
57
58
59
60
# File 'lib/artrest/system.rb', line 53

def ping
    # Directly accessing the ping resource from this resource contravenes
    # our design. For consistency reasons, we ought to explicitly model
    # this ping resource as e.g. an instance of ArtRest::SystemPing.
    # However, here we try to strike a balance between perfectionism
    # and pragmatism and lean towards the latter.
    RestClient::Resource.new("#{base_url}/api/system/ping", user, password).get
end