class Dogapi::V1::SyntheticsService

SyntheticsService is the class responsible for dealing with the synthetics

Constants

API_VERSION

Public Instance Methods

create_synthetics_test(type, config, options = {}) click to toggle source

Create a synthetics test: POST /v1/synthetics/tests/

   # File lib/dogapi/v1/synthetics.rb
13 def create_synthetics_test(type, config, options = {})
14   body = {
15     'type' => type,
16     'config' => config
17   }.merge(options)
18 
19   request(Net::HTTP::Post, "/api/#{API_VERSION}/synthetics/tests", nil, body, true)
20 end
delete_synthetics_tests(test_ids) click to toggle source

Delete synthetics tests

   # File lib/dogapi/v1/synthetics.rb
33 def delete_synthetics_tests(test_ids)
34   body = {
35     'public_ids' => test_ids
36   }
37   request(Net::HTTP::Post, "/api/#{API_VERSION}/synthetics/tests/delete", nil, body, true)
38 end
get_all_synthetics_tests() click to toggle source

Get all synthetics tests: GET /v1/synthetics/tests

   # File lib/dogapi/v1/synthetics.rb
49 def get_all_synthetics_tests
50   request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests", nil, nil, false)
51 end
get_synthetics_devices() click to toggle source

Get devices for browser checks: GET /v1/synthetics/browser/devices

   # File lib/dogapi/v1/synthetics.rb
70 def get_synthetics_devices
71   request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/browser/devices", nil, nil, false)
72 end
get_synthetics_locations() click to toggle source

Get available locations: GET /v1/synthetics/locations

   # File lib/dogapi/v1/synthetics.rb
75 def get_synthetics_locations
76   request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/locations", nil, nil, false)
77 end
get_synthetics_result(test_id, result_id) click to toggle source

Get a specific result for a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/results/<RESULT_ID>

   # File lib/dogapi/v1/synthetics.rb
65 def get_synthetics_result(test_id, result_id)
66   request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests/#{test_id}/results/#{result_id}", nil, nil, false)
67 end
get_synthetics_results(test_id) click to toggle source

Get the most recent results for a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/results

   # File lib/dogapi/v1/synthetics.rb
59 def get_synthetics_results(test_id)
60   request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests/#{test_id}/results", nil, nil, false)
61 end
get_synthetics_test(test_id) click to toggle source

Get info on a synthetics test: GET /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>

   # File lib/dogapi/v1/synthetics.rb
54 def get_synthetics_test(test_id)
55   request(Net::HTTP::Get, "/api/#{API_VERSION}/synthetics/tests/#{test_id}", nil, nil, false)
56 end
start_pause_synthetics_test(test_id, new_status) click to toggle source

Start of pause a synthetics test: POST /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>/status

   # File lib/dogapi/v1/synthetics.rb
41 def start_pause_synthetics_test(test_id, new_status)
42   body = {
43     'new_status' => new_status
44   }
45   request(Net::HTTP::Put, "/api/#{API_VERSION}/synthetics/tests/#{test_id}/status", nil, body, true)
46 end
update_synthetics_test(test_id, type, config, options = {}) click to toggle source

Edit a synthetics test: PUT /v1/synthetics/tests/<SYNTHETICS_TEST_PUBLIC_ID>

   # File lib/dogapi/v1/synthetics.rb
23 def update_synthetics_test(test_id, type, config, options = {})
24   body = {
25     'type' => type,
26     'config' => config
27   }.merge(options)
28 
29   request(Net::HTTP::Put, "/api/#{API_VERSION}/synthetics/tests/#{test_id}", nil, body, true)
30 end