Class: Dogapi::V1::SyntheticsService
- Inherits:
-
APIService
- Object
- APIService
- Dogapi::V1::SyntheticsService
- Defined in:
- lib/dogapi/v1/synthetics.rb
Overview
SyntheticsService is the class responsible for dealing with the synthetics
Constant Summary collapse
- API_VERSION =
'v1'
Instance Attribute Summary
Attributes inherited from APIService
Instance Method Summary collapse
-
#create_synthetics_test(type, config, options = {}) ⇒ Object
Create a synthetics test: POST /v1/synthetics/tests/.
-
#delete_synthetics_tests(test_ids) ⇒ Object
Delete synthetics tests.
-
#get_all_synthetics_tests ⇒ Object
Get all synthetics tests: GET /v1/synthetics/tests.
-
#get_synthetics_devices ⇒ Object
Get devices for browser checks: GET /v1/synthetics/browser/devices.
-
#get_synthetics_locations ⇒ Object
Get available locations: GET /v1/synthetics/locations.
-
#get_synthetics_result(test_id, result_id) ⇒ Object
Get a specific result for a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/results/<RESULT_ID>.
-
#get_synthetics_results(test_id) ⇒ Object
Get the most recent results for a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/results.
-
#get_synthetics_test(test_id) ⇒ Object
Get info on a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>.
-
#start_pause_synthetics_test(test_id, new_status) ⇒ Object
Start of pause a synthetics test: POST /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/status.
-
#update_synthetics_test(test_id, type, config, options = {}) ⇒ Object
Edit a synthetics test: PUT /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>.
Methods inherited from APIService
#connect, #handle_redirect, #handle_response, #initialize, #prepare_params, #prepare_request, #request, #should_set_api_and_app_keys_in_params?, #suppress_error_if_silent
Constructor Details
This class inherits a constructor from Dogapi::APIService
Instance Method Details
#create_synthetics_test(type, config, options = {}) ⇒ Object
Create a synthetics test: POST /v1/synthetics/tests/
13 14 15 16 17 18 19 20 |
# File 'lib/dogapi/v1/synthetics.rb', line 13 def create_synthetics_test(type, config, = {}) body = { 'type' => type, 'config' => config }.merge() request(Net::HTTP::Post, "/api/#{API_VERSION}/synthetics/tests", nil, body, true) end |
#delete_synthetics_tests(test_ids) ⇒ Object
Delete synthetics tests
33 34 35 36 37 38 |
# File 'lib/dogapi/v1/synthetics.rb', line 33 def delete_synthetics_tests(test_ids) body = { 'public_ids' => test_ids } request(Net::HTTP::Post, "/api/#{API_VERSION}/synthetics/tests/delete", nil, body, true) end |
#get_all_synthetics_tests ⇒ Object
Get all synthetics tests: GET /v1/synthetics/tests
49 50 51 |
# File 'lib/dogapi/v1/synthetics.rb', line 49 def get_all_synthetics_tests request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests", nil, nil, false) end |
#get_synthetics_devices ⇒ Object
Get devices for browser checks: GET /v1/synthetics/browser/devices
70 71 72 |
# File 'lib/dogapi/v1/synthetics.rb', line 70 def get_synthetics_devices request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/browser/devices", nil, nil, false) end |
#get_synthetics_locations ⇒ Object
Get available locations: GET /v1/synthetics/locations
75 76 77 |
# File 'lib/dogapi/v1/synthetics.rb', line 75 def get_synthetics_locations request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/locations", nil, nil, false) end |
#get_synthetics_result(test_id, result_id) ⇒ Object
Get a specific result for a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/results/<RESULT_ID>
65 66 67 |
# File 'lib/dogapi/v1/synthetics.rb', line 65 def get_synthetics_result(test_id, result_id) request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests/#{test_id}/results/#{result_id}", nil, nil, false) end |
#get_synthetics_results(test_id) ⇒ Object
Get the most recent results for a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/results
59 60 61 |
# File 'lib/dogapi/v1/synthetics.rb', line 59 def get_synthetics_results(test_id) request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests/#{test_id}/results", nil, nil, false) end |
#get_synthetics_test(test_id) ⇒ Object
Get info on a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>
54 55 56 |
# File 'lib/dogapi/v1/synthetics.rb', line 54 def get_synthetics_test(test_id) request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests/#{test_id}", nil, nil, false) end |
#start_pause_synthetics_test(test_id, new_status) ⇒ Object
Start of pause a synthetics test: POST /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/status
41 42 43 44 45 46 |
# File 'lib/dogapi/v1/synthetics.rb', line 41 def start_pause_synthetics_test(test_id, new_status) body = { 'new_status' => new_status } request(Net::HTTP::Put, "/api/#{API_VERSION}/synthetics/tests/#{test_id}/status", nil, body, true) end |
#update_synthetics_test(test_id, type, config, options = {}) ⇒ Object
Edit a synthetics test: PUT /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>
23 24 25 26 27 28 29 30 |
# File 'lib/dogapi/v1/synthetics.rb', line 23 def update_synthetics_test(test_id, type, config, = {}) body = { 'type' => type, 'config' => config }.merge() request(Net::HTTP::Put, "/api/#{API_VERSION}/synthetics/tests/#{test_id}", nil, body, true) end |