=begin #Datadog API V1 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020-Present Datadog, Inc. =end require 'cgi' module DatadogAPIClient::V1 class SyntheticsAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end # Create a global variable. # # @see #create_global_variable_with_http_info def create_global_variable(body, opts = {}) data, _status_code, _headers = create_global_variable_with_http_info(body, opts) data end # Create a global variable. # # Create a Synthetic global variable. # # @param body [SyntheticsGlobalVariableRequest] Details of the global variable to create. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsGlobalVariable, Integer, Hash)>] SyntheticsGlobalVariable data, response status code and response headers def create_global_variable_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_global_variable ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_global_variable" end # resource path local_var_path = '/api/v1/synthetics/variables' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsGlobalVariable' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_global_variable, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#create_global_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a private location. # # @see #create_private_location_with_http_info def create_private_location(body, opts = {}) data, _status_code, _headers = create_private_location_with_http_info(body, opts) data end # Create a private location. # # Create a new Synthetic private location. # # @param body [SyntheticsPrivateLocation] Details of the private location to create. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsPrivateLocationCreationResponse, Integer, Hash)>] SyntheticsPrivateLocationCreationResponse data, response status code and response headers def create_private_location_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_private_location ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_private_location" end # resource path local_var_path = '/api/v1/synthetics/private-locations' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsPrivateLocationCreationResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_private_location, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#create_private_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an API test. # # @see #create_synthetics_api_test_with_http_info def create_synthetics_api_test(body, opts = {}) data, _status_code, _headers = create_synthetics_api_test_with_http_info(body, opts) data end # Create an API test. # # Create a Synthetic API test. # # @param body [SyntheticsAPITest] Details of the test to create. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsAPITest, Integer, Hash)>] SyntheticsAPITest data, response status code and response headers def create_synthetics_api_test_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_synthetics_api_test ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_synthetics_api_test" end # resource path local_var_path = '/api/v1/synthetics/tests/api' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsAPITest' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_synthetics_api_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#create_synthetics_api_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a browser test. # # @see #create_synthetics_browser_test_with_http_info def create_synthetics_browser_test(body, opts = {}) data, _status_code, _headers = create_synthetics_browser_test_with_http_info(body, opts) data end # Create a browser test. # # Create a Synthetic browser test. # # @param body [SyntheticsBrowserTest] Details of the test to create. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsBrowserTest, Integer, Hash)>] SyntheticsBrowserTest data, response status code and response headers def create_synthetics_browser_test_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_synthetics_browser_test ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_synthetics_browser_test" end # resource path local_var_path = '/api/v1/synthetics/tests/browser' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsBrowserTest' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_synthetics_browser_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#create_synthetics_browser_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a mobile test. # # @see #create_synthetics_mobile_test_with_http_info def create_synthetics_mobile_test(body, opts = {}) data, _status_code, _headers = create_synthetics_mobile_test_with_http_info(body, opts) data end # Create a mobile test. # # Create a Synthetic mobile test. # # @param body [SyntheticsMobileTest] Details of the test to create. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsMobileTest, Integer, Hash)>] SyntheticsMobileTest data, response status code and response headers def create_synthetics_mobile_test_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_synthetics_mobile_test ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_synthetics_mobile_test" end # resource path local_var_path = '/api/v1/synthetics/tests/mobile' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsMobileTest' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_synthetics_mobile_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#create_synthetics_mobile_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a global variable. # # @see #delete_global_variable_with_http_info def delete_global_variable(variable_id, opts = {}) delete_global_variable_with_http_info(variable_id, opts) nil end # Delete a global variable. # # Delete a Synthetic global variable. # # @param variable_id [String] The ID of the global variable. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_global_variable_with_http_info(variable_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.delete_global_variable ...' end # verify the required parameter 'variable_id' is set if @api_client.config.client_side_validation && variable_id.nil? fail ArgumentError, "Missing the required parameter 'variable_id' when calling SyntheticsAPI.delete_global_variable" end # resource path local_var_path = '/api/v1/synthetics/variables/{variable_id}'.sub('{variable_id}', CGI.escape(variable_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_global_variable, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#delete_global_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a private location. # # @see #delete_private_location_with_http_info def delete_private_location(location_id, opts = {}) delete_private_location_with_http_info(location_id, opts) nil end # Delete a private location. # # Delete a Synthetic private location. # # @param location_id [String] The ID of the private location. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_private_location_with_http_info(location_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.delete_private_location ...' end # verify the required parameter 'location_id' is set if @api_client.config.client_side_validation && location_id.nil? fail ArgumentError, "Missing the required parameter 'location_id' when calling SyntheticsAPI.delete_private_location" end # resource path local_var_path = '/api/v1/synthetics/private-locations/{location_id}'.sub('{location_id}', CGI.escape(location_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_private_location, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#delete_private_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete tests. # # @see #delete_tests_with_http_info def delete_tests(body, opts = {}) data, _status_code, _headers = delete_tests_with_http_info(body, opts) data end # Delete tests. # # Delete multiple Synthetic tests by ID. # # @param body [SyntheticsDeleteTestsPayload] Public ID list of the Synthetic tests to be deleted. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsDeleteTestsResponse, Integer, Hash)>] SyntheticsDeleteTestsResponse data, response status code and response headers def delete_tests_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.delete_tests ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.delete_tests" end # resource path local_var_path = '/api/v1/synthetics/tests/delete' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsDeleteTestsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_tests, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#delete_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Edit a global variable. # # @see #edit_global_variable_with_http_info def edit_global_variable(variable_id, body, opts = {}) data, _status_code, _headers = edit_global_variable_with_http_info(variable_id, body, opts) data end # Edit a global variable. # # Edit a Synthetic global variable. # # @param variable_id [String] The ID of the global variable. # @param body [SyntheticsGlobalVariableRequest] Details of the global variable to update. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsGlobalVariable, Integer, Hash)>] SyntheticsGlobalVariable data, response status code and response headers def edit_global_variable_with_http_info(variable_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.edit_global_variable ...' end # verify the required parameter 'variable_id' is set if @api_client.config.client_side_validation && variable_id.nil? fail ArgumentError, "Missing the required parameter 'variable_id' when calling SyntheticsAPI.edit_global_variable" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.edit_global_variable" end # resource path local_var_path = '/api/v1/synthetics/variables/{variable_id}'.sub('{variable_id}', CGI.escape(variable_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsGlobalVariable' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :edit_global_variable, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#edit_global_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch uptime for multiple tests. # # @see #fetch_uptimes_with_http_info def fetch_uptimes(body, opts = {}) data, _status_code, _headers = fetch_uptimes_with_http_info(body, opts) data end # Fetch uptime for multiple tests. # # Fetch uptime for multiple Synthetic tests by ID. # # @param body [SyntheticsFetchUptimesPayload] Public ID list of the Synthetic tests and timeframe. # @param opts [Hash] the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def fetch_uptimes_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.fetch_uptimes ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.fetch_uptimes" end # resource path local_var_path = '/api/v1/synthetics/tests/uptimes' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :fetch_uptimes, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#fetch_uptimes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an API test. # # @see #get_api_test_with_http_info def get_api_test(public_id, opts = {}) data, _status_code, _headers = get_api_test_with_http_info(public_id, opts) data end # Get an API test. # # Get the detailed configuration associated with # a Synthetic API test. # # @param public_id [String] The public ID of the test to get details from. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsAPITest, Integer, Hash)>] SyntheticsAPITest data, response status code and response headers def get_api_test_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_api_test ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_api_test" end # resource path local_var_path = '/api/v1/synthetics/tests/api/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsAPITest' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_api_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_api_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an API test's latest results summaries. # # @see #get_api_test_latest_results_with_http_info def get_api_test_latest_results(public_id, opts = {}) data, _status_code, _headers = get_api_test_latest_results_with_http_info(public_id, opts) data end # Get an API test's latest results summaries. # # Get the last 150 test results summaries for a given Synthetic API test. # # @param public_id [String] The public ID of the test for which to search results for. # @param opts [Hash] the optional parameters # @option opts [Integer] :from_ts Timestamp in milliseconds from which to start querying results. # @option opts [Integer] :to_ts Timestamp in milliseconds up to which to query results. # @option opts [Array] :probe_dc Locations for which to query results. # @return [Array<(SyntheticsGetAPITestLatestResultsResponse, Integer, Hash)>] SyntheticsGetAPITestLatestResultsResponse data, response status code and response headers def get_api_test_latest_results_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_api_test_latest_results ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_api_test_latest_results" end # resource path local_var_path = '/api/v1/synthetics/tests/{public_id}/results'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'from_ts'] = opts[:'from_ts'] if !opts[:'from_ts'].nil? query_params[:'to_ts'] = opts[:'to_ts'] if !opts[:'to_ts'].nil? query_params[:'probe_dc'] = @api_client.build_collection_param(opts[:'probe_dc'], :multi) if !opts[:'probe_dc'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsGetAPITestLatestResultsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_api_test_latest_results, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_api_test_latest_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an API test result. # # @see #get_api_test_result_with_http_info def get_api_test_result(public_id, result_id, opts = {}) data, _status_code, _headers = get_api_test_result_with_http_info(public_id, result_id, opts) data end # Get an API test result. # # Get a specific full result from a given Synthetic API test. # # @param public_id [String] The public ID of the API test to which the target result belongs. # @param result_id [String] The ID of the result to get. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsAPITestResultFull, Integer, Hash)>] SyntheticsAPITestResultFull data, response status code and response headers def get_api_test_result_with_http_info(public_id, result_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_api_test_result ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_api_test_result" end # verify the required parameter 'result_id' is set if @api_client.config.client_side_validation && result_id.nil? fail ArgumentError, "Missing the required parameter 'result_id' when calling SyntheticsAPI.get_api_test_result" end # resource path local_var_path = '/api/v1/synthetics/tests/{public_id}/results/{result_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')).sub('{result_id}', CGI.escape(result_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsAPITestResultFull' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_api_test_result, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_api_test_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a browser test. # # @see #get_browser_test_with_http_info def get_browser_test(public_id, opts = {}) data, _status_code, _headers = get_browser_test_with_http_info(public_id, opts) data end # Get a browser test. # # Get the detailed configuration (including steps) associated with # a Synthetic browser test. # # @param public_id [String] The public ID of the test to get details from. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsBrowserTest, Integer, Hash)>] SyntheticsBrowserTest data, response status code and response headers def get_browser_test_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_browser_test ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_browser_test" end # resource path local_var_path = '/api/v1/synthetics/tests/browser/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsBrowserTest' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_browser_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_browser_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a browser test's latest results summaries. # # @see #get_browser_test_latest_results_with_http_info def get_browser_test_latest_results(public_id, opts = {}) data, _status_code, _headers = get_browser_test_latest_results_with_http_info(public_id, opts) data end # Get a browser test's latest results summaries. # # Get the last 150 test results summaries for a given Synthetic browser test. # # @param public_id [String] The public ID of the browser test for which to search results for. # @param opts [Hash] the optional parameters # @option opts [Integer] :from_ts Timestamp in milliseconds from which to start querying results. # @option opts [Integer] :to_ts Timestamp in milliseconds up to which to query results. # @option opts [Array] :probe_dc Locations for which to query results. # @return [Array<(SyntheticsGetBrowserTestLatestResultsResponse, Integer, Hash)>] SyntheticsGetBrowserTestLatestResultsResponse data, response status code and response headers def get_browser_test_latest_results_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_browser_test_latest_results ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_browser_test_latest_results" end # resource path local_var_path = '/api/v1/synthetics/tests/browser/{public_id}/results'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'from_ts'] = opts[:'from_ts'] if !opts[:'from_ts'].nil? query_params[:'to_ts'] = opts[:'to_ts'] if !opts[:'to_ts'].nil? query_params[:'probe_dc'] = @api_client.build_collection_param(opts[:'probe_dc'], :multi) if !opts[:'probe_dc'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsGetBrowserTestLatestResultsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_browser_test_latest_results, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_browser_test_latest_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a browser test result. # # @see #get_browser_test_result_with_http_info def get_browser_test_result(public_id, result_id, opts = {}) data, _status_code, _headers = get_browser_test_result_with_http_info(public_id, result_id, opts) data end # Get a browser test result. # # Get a specific full result from a given Synthetic browser test. # # @param public_id [String] The public ID of the browser test to which the target result belongs. # @param result_id [String] The ID of the result to get. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsBrowserTestResultFull, Integer, Hash)>] SyntheticsBrowserTestResultFull data, response status code and response headers def get_browser_test_result_with_http_info(public_id, result_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_browser_test_result ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_browser_test_result" end # verify the required parameter 'result_id' is set if @api_client.config.client_side_validation && result_id.nil? fail ArgumentError, "Missing the required parameter 'result_id' when calling SyntheticsAPI.get_browser_test_result" end # resource path local_var_path = '/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')).sub('{result_id}', CGI.escape(result_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsBrowserTestResultFull' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_browser_test_result, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_browser_test_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a global variable. # # @see #get_global_variable_with_http_info def get_global_variable(variable_id, opts = {}) data, _status_code, _headers = get_global_variable_with_http_info(variable_id, opts) data end # Get a global variable. # # Get the detailed configuration of a global variable. # # @param variable_id [String] The ID of the global variable. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsGlobalVariable, Integer, Hash)>] SyntheticsGlobalVariable data, response status code and response headers def get_global_variable_with_http_info(variable_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_global_variable ...' end # verify the required parameter 'variable_id' is set if @api_client.config.client_side_validation && variable_id.nil? fail ArgumentError, "Missing the required parameter 'variable_id' when calling SyntheticsAPI.get_global_variable" end # resource path local_var_path = '/api/v1/synthetics/variables/{variable_id}'.sub('{variable_id}', CGI.escape(variable_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsGlobalVariable' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_global_variable, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_global_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a Mobile test. # # @see #get_mobile_test_with_http_info def get_mobile_test(public_id, opts = {}) data, _status_code, _headers = get_mobile_test_with_http_info(public_id, opts) data end # Get a Mobile test. # # Get the detailed configuration associated with # a Synthetic Mobile test. # # @param public_id [String] The public ID of the test to get details from. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsMobileTest, Integer, Hash)>] SyntheticsMobileTest data, response status code and response headers def get_mobile_test_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_mobile_test ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_mobile_test" end # resource path local_var_path = '/api/v1/synthetics/tests/mobile/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsMobileTest' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_mobile_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_mobile_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a private location. # # @see #get_private_location_with_http_info def get_private_location(location_id, opts = {}) data, _status_code, _headers = get_private_location_with_http_info(location_id, opts) data end # Get a private location. # # Get a Synthetic private location. # # @param location_id [String] The ID of the private location. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsPrivateLocation, Integer, Hash)>] SyntheticsPrivateLocation data, response status code and response headers def get_private_location_with_http_info(location_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_private_location ...' end # verify the required parameter 'location_id' is set if @api_client.config.client_side_validation && location_id.nil? fail ArgumentError, "Missing the required parameter 'location_id' when calling SyntheticsAPI.get_private_location" end # resource path local_var_path = '/api/v1/synthetics/private-locations/{location_id}'.sub('{location_id}', CGI.escape(location_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsPrivateLocation' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_private_location, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_private_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get details of batch. # # @see #get_synthetics_ci_batch_with_http_info def get_synthetics_ci_batch(batch_id, opts = {}) data, _status_code, _headers = get_synthetics_ci_batch_with_http_info(batch_id, opts) data end # Get details of batch. # # Get a batch's updated details. # # @param batch_id [String] The ID of the batch. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsBatchDetails, Integer, Hash)>] SyntheticsBatchDetails data, response status code and response headers def get_synthetics_ci_batch_with_http_info(batch_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_synthetics_ci_batch ...' end # verify the required parameter 'batch_id' is set if @api_client.config.client_side_validation && batch_id.nil? fail ArgumentError, "Missing the required parameter 'batch_id' when calling SyntheticsAPI.get_synthetics_ci_batch" end # resource path local_var_path = '/api/v1/synthetics/ci/batch/{batch_id}'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsBatchDetails' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_synthetics_ci_batch, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_synthetics_ci_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the default locations. # # @see #get_synthetics_default_locations_with_http_info def get_synthetics_default_locations(opts = {}) data, _status_code, _headers = get_synthetics_default_locations_with_http_info(opts) data end # Get the default locations. # # Get the default locations settings. # # @param opts [Hash] the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_synthetics_default_locations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_synthetics_default_locations ...' end # resource path local_var_path = '/api/v1/synthetics/settings/default_locations' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :get_synthetics_default_locations, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_synthetics_default_locations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a test configuration. # # @see #get_test_with_http_info def get_test(public_id, opts = {}) data, _status_code, _headers = get_test_with_http_info(public_id, opts) data end # Get a test configuration. # # Get the detailed configuration associated with a Synthetic test. # # @param public_id [String] The public ID of the test to get details from. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsTestDetails, Integer, Hash)>] SyntheticsTestDetails data, response status code and response headers def get_test_with_http_info(public_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_test ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_test" end # resource path local_var_path = '/api/v1/synthetics/tests/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsTestDetails' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#get_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all global variables. # # @see #list_global_variables_with_http_info def list_global_variables(opts = {}) data, _status_code, _headers = list_global_variables_with_http_info(opts) data end # Get all global variables. # # Get the list of all Synthetic global variables. # # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsListGlobalVariablesResponse, Integer, Hash)>] SyntheticsListGlobalVariablesResponse data, response status code and response headers def list_global_variables_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.list_global_variables ...' end # resource path local_var_path = '/api/v1/synthetics/variables' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsListGlobalVariablesResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_global_variables, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#list_global_variables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all locations (public and private). # # @see #list_locations_with_http_info def list_locations(opts = {}) data, _status_code, _headers = list_locations_with_http_info(opts) data end # Get all locations (public and private). # # Get the list of public and private locations available for Synthetic # tests. No arguments required. # # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsLocations, Integer, Hash)>] SyntheticsLocations data, response status code and response headers def list_locations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.list_locations ...' end # resource path local_var_path = '/api/v1/synthetics/locations' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsLocations' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_locations, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#list_locations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the list of all Synthetic tests. # # @see #list_tests_with_http_info def list_tests(opts = {}) data, _status_code, _headers = list_tests_with_http_info(opts) data end # Get the list of all Synthetic tests. # # Get the list of all Synthetic tests. # # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size Used for pagination. The number of tests returned in the page. # @option opts [Integer] :page_number Used for pagination. Which page you want to retrieve. Starts at zero. # @return [Array<(SyntheticsListTestsResponse, Integer, Hash)>] SyntheticsListTestsResponse data, response status code and response headers def list_tests_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.list_tests ...' end # resource path local_var_path = '/api/v1/synthetics/tests' # query parameters query_params = opts[:query_params] || {} query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SyntheticsListTestsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_tests, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#list_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the list of all Synthetic tests. # # Provide a paginated version of {#list_tests}, returning all items. # # To use it you need to use a block: list_tests_with_pagination { |item| p item } # # @yield [SyntheticsTestDetails] Paginated items def list_tests_with_pagination(opts = {}) api_version = "V1" page_size = @api_client.get_attribute_from_path(opts, "page_size", 100) @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) while true do response = list_tests(opts) @api_client.get_attribute_from_path(response, "tests").each { |item| yield(item) } if @api_client.get_attribute_from_path(response, "tests").length < page_size break end @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) end end # Patch a Synthetic test. # # @see #patch_test_with_http_info def patch_test(public_id, body, opts = {}) data, _status_code, _headers = patch_test_with_http_info(public_id, body, opts) data end # Patch a Synthetic test. # # Patch the configuration of a Synthetic test with partial data. # # @param public_id [String] The public ID of the test to patch. # @param body [SyntheticsPatchTestBody] [JSON Patch](https://jsonpatch.com/) compliant list of operations # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsTestDetails, Integer, Hash)>] SyntheticsTestDetails data, response status code and response headers def patch_test_with_http_info(public_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.patch_test ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.patch_test" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.patch_test" end # resource path local_var_path = '/api/v1/synthetics/tests/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsTestDetails' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :patch_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#patch_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Trigger tests from CI/CD pipelines. # # @see #trigger_ci_tests_with_http_info def trigger_ci_tests(body, opts = {}) data, _status_code, _headers = trigger_ci_tests_with_http_info(body, opts) data end # Trigger tests from CI/CD pipelines. # # Trigger a set of Synthetic tests for continuous integration. # # @param body [SyntheticsCITestBody] Details of the test to trigger. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsTriggerCITestsResponse, Integer, Hash)>] SyntheticsTriggerCITestsResponse data, response status code and response headers def trigger_ci_tests_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.trigger_ci_tests ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.trigger_ci_tests" end # resource path local_var_path = '/api/v1/synthetics/tests/trigger/ci' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsTriggerCITestsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :trigger_ci_tests, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#trigger_ci_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Trigger Synthetic tests. # # @see #trigger_tests_with_http_info def trigger_tests(body, opts = {}) data, _status_code, _headers = trigger_tests_with_http_info(body, opts) data end # Trigger Synthetic tests. # # Trigger a set of Synthetic tests. # # @param body [SyntheticsTriggerBody] The identifiers of the tests to trigger. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsTriggerCITestsResponse, Integer, Hash)>] SyntheticsTriggerCITestsResponse data, response status code and response headers def trigger_tests_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.trigger_tests ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.trigger_tests" end # resource path local_var_path = '/api/v1/synthetics/tests/trigger' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsTriggerCITestsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :trigger_tests, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#trigger_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Edit an API test. # # @see #update_api_test_with_http_info def update_api_test(public_id, body, opts = {}) data, _status_code, _headers = update_api_test_with_http_info(public_id, body, opts) data end # Edit an API test. # # Edit the configuration of a Synthetic API test. # # @param public_id [String] The public ID of the test to get details from. # @param body [SyntheticsAPITest] New test details to be saved. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsAPITest, Integer, Hash)>] SyntheticsAPITest data, response status code and response headers def update_api_test_with_http_info(public_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_api_test ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.update_api_test" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_api_test" end # resource path local_var_path = '/api/v1/synthetics/tests/api/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsAPITest' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_api_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#update_api_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Edit a browser test. # # @see #update_browser_test_with_http_info def update_browser_test(public_id, body, opts = {}) data, _status_code, _headers = update_browser_test_with_http_info(public_id, body, opts) data end # Edit a browser test. # # Edit the configuration of a Synthetic browser test. # # @param public_id [String] The public ID of the test to edit. # @param body [SyntheticsBrowserTest] New test details to be saved. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsBrowserTest, Integer, Hash)>] SyntheticsBrowserTest data, response status code and response headers def update_browser_test_with_http_info(public_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_browser_test ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.update_browser_test" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_browser_test" end # resource path local_var_path = '/api/v1/synthetics/tests/browser/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsBrowserTest' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_browser_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#update_browser_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Edit a Mobile test. # # @see #update_mobile_test_with_http_info def update_mobile_test(public_id, body, opts = {}) data, _status_code, _headers = update_mobile_test_with_http_info(public_id, body, opts) data end # Edit a Mobile test. # # Edit the configuration of a Synthetic Mobile test. # # @param public_id [String] The public ID of the test to get details from. # @param body [SyntheticsMobileTest] New test details to be saved. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsMobileTest, Integer, Hash)>] SyntheticsMobileTest data, response status code and response headers def update_mobile_test_with_http_info(public_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_mobile_test ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.update_mobile_test" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_mobile_test" end # resource path local_var_path = '/api/v1/synthetics/tests/mobile/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsMobileTest' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_mobile_test, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#update_mobile_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Edit a private location. # # @see #update_private_location_with_http_info def update_private_location(location_id, body, opts = {}) data, _status_code, _headers = update_private_location_with_http_info(location_id, body, opts) data end # Edit a private location. # # Edit a Synthetic private location. # # @param location_id [String] The ID of the private location. # @param body [SyntheticsPrivateLocation] Details of the private location to be updated. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsPrivateLocation, Integer, Hash)>] SyntheticsPrivateLocation data, response status code and response headers def update_private_location_with_http_info(location_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_private_location ...' end # verify the required parameter 'location_id' is set if @api_client.config.client_side_validation && location_id.nil? fail ArgumentError, "Missing the required parameter 'location_id' when calling SyntheticsAPI.update_private_location" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_private_location" end # resource path local_var_path = '/api/v1/synthetics/private-locations/{location_id}'.sub('{location_id}', CGI.escape(location_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SyntheticsPrivateLocation' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_private_location, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#update_private_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Pause or start a test. # # @see #update_test_pause_status_with_http_info def update_test_pause_status(public_id, body, opts = {}) data, _status_code, _headers = update_test_pause_status_with_http_info(public_id, body, opts) data end # Pause or start a test. # # Pause or start a Synthetic test by changing the status. # # @param public_id [String] The public ID of the Synthetic test to update. # @param body [SyntheticsUpdateTestPauseStatusPayload] Status to set the given Synthetic test to. # @param opts [Hash] the optional parameters # @return [Array<(Boolean, Integer, Hash)>] Boolean data, response status code and response headers def update_test_pause_status_with_http_info(public_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_test_pause_status ...' end # verify the required parameter 'public_id' is set if @api_client.config.client_side_validation && public_id.nil? fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.update_test_pause_status" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_test_pause_status" end # resource path local_var_path = '/api/v1/synthetics/tests/{public_id}/status'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'Boolean' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_test_pause_status, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SyntheticsAPI#update_test_pause_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end