Class: StatusClient
- Inherits:
-
Object
- Object
- StatusClient
- Defined in:
- lib/lockstep_sdk/clients/status.rb
Instance Method Summary collapse
-
#error_test(err:) ⇒ Object
Generates an error code that your program may use to test handling of common types of error conditions.
-
#initialize(lockstepsdk) ⇒ StatusClient
constructor
Initialize the StatusClient class with a lockstepsdk instance.
-
#ping ⇒ Object
Verifies that your application can successfully call the Lockstep Platform API and returns a successful code regardless of your authentication status or permissions.
Constructor Details
#initialize(lockstepsdk) ⇒ StatusClient
Initialize the StatusClient class with a lockstepsdk instance.
24 25 26 |
# File 'lib/lockstep_sdk/clients/status.rb', line 24 def initialize(lockstepsdk) @lockstepsdk = lockstepsdk end |
Instance Method Details
#error_test(err:) ⇒ Object
Generates an error code that your program may use to test handling of common types of error conditions.
-
If you specify `?err=500`, you will receive a 500 internal server error. * If you specify `?err=timeout`, the API will stall for 90 seconds and then return 200 OK. Many network connections will drop after 60 seconds of no activity. * If you do not specify any of these errors, the API will return 200 OK.
The Error Test API allows you to test whether your client program is capable of handling certain types of error codes. Developers writing libraries may find it useful to create integration tests that verify that their code can correctly detect the difference between a validation error resulting in a 400 error code, a network timeout resulting in a broken network connection, and a server error resulting in a 500 error code. You may use the Error Test API to verify that your code is able to identify and handle these cases correctly.
43 44 45 46 47 |
# File 'lib/lockstep_sdk/clients/status.rb', line 43 def error_test(err:) path = "/api/v1/Status/testing" params = {:err => err} @lockstepsdk.request(:get, path, nil, params) end |
#ping ⇒ Object
Verifies that your application can successfully call the Lockstep Platform API and returns a successful code regardless of your authentication status or permissions.
The Ping API can be used to verify that your app is working correctly. The Ping API will always return 200 OK. If you call this API and you receive a code other than 200 OK, you should check your network connectivity. A response code of anything other than 200 means that a routing issue or proxy issue may prevent your application from reaching the Lockstep API
32 33 34 35 |
# File 'lib/lockstep_sdk/clients/status.rb', line 32 def ping() path = "/api/v1/Status" @lockstepsdk.request(:get, path, nil, nil) end |