=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 = APIClient.default) @api_client = api_client end # Create a global variable # Create a Synthetics global variable. # @param body [SyntheticsGlobalVariable] Details of the global variable to create. # @param opts [Hash] the optional parameters # @return [SyntheticsGlobalVariable] 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 Synthetics global variable. # @param body [SyntheticsGlobalVariable] 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.unstable_operations.has_key?(:create_global_variable) unstable_enabled = @api_client.config.unstable_operations[:create_global_variable] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "create_global_variable") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_global_variable")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Create a new Synthetics private location. # @param body [SyntheticsPrivateLocation] Details of the private location to create. # @param opts [Hash] the optional parameters # @return [SyntheticsPrivateLocationCreationResponse] 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 Synthetics 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.unstable_operations.has_key?(:create_private_location) unstable_enabled = @api_client.config.unstable_operations[:create_private_location] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "create_private_location") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_private_location")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Create a Synthetic API test. # @param body [SyntheticsAPITest] Details of the test to create. # @param opts [Hash] the optional parameters # @return [SyntheticsAPITest] 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.unstable_operations.has_key?(:create_synthetics_api_test) unstable_enabled = @api_client.config.unstable_operations[:create_synthetics_api_test] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "create_synthetics_api_test") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_synthetics_api_test")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Create a Synthetic browser test. # @param body [SyntheticsBrowserTest] Details of the test to create. # @param opts [Hash] the optional parameters # @return [SyntheticsBrowserTest] 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.unstable_operations.has_key?(:create_synthetics_browser_test) unstable_enabled = @api_client.config.unstable_operations[:create_synthetics_browser_test] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "create_synthetics_browser_test") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_synthetics_browser_test")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Delete a global variable # Delete a Synthetics global variable. # @param variable_id [String] The ID of the global variable. # @param opts [Hash] the optional parameters # @return [nil] def delete_global_variable(variable_id, opts = {}) delete_global_variable_with_http_info(variable_id, opts) nil end # Delete a global variable # Delete a Synthetics 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.unstable_operations.has_key?(:delete_global_variable) unstable_enabled = @api_client.config.unstable_operations[:delete_global_variable] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "delete_global_variable") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "delete_global_variable")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Delete a Synthetics private location. # @param location_id [String] The ID of the private location. # @param opts [Hash] the optional parameters # @return [nil] def delete_private_location(location_id, opts = {}) delete_private_location_with_http_info(location_id, opts) nil end # Delete a private location # Delete a Synthetics 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.unstable_operations.has_key?(:delete_private_location) unstable_enabled = @api_client.config.unstable_operations[:delete_private_location] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "delete_private_location") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "delete_private_location")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # 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 [SyntheticsDeleteTestsResponse] 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.unstable_operations.has_key?(:delete_tests) unstable_enabled = @api_client.config.unstable_operations[:delete_tests] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "delete_tests") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "delete_tests")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Edit a Synthetics global variable. # @param variable_id [String] The ID of the global variable. # @param body [SyntheticsGlobalVariable] Details of the global variable to update. # @param opts [Hash] the optional parameters # @return [SyntheticsGlobalVariable] 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 Synthetics global variable. # @param variable_id [String] The ID of the global variable. # @param body [SyntheticsGlobalVariable] 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.unstable_operations.has_key?(:edit_global_variable) unstable_enabled = @api_client.config.unstable_operations[:edit_global_variable] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "edit_global_variable") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "edit_global_variable")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # 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 [SyntheticsAPITest] 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.unstable_operations.has_key?(:get_api_test) unstable_enabled = @api_client.config.unstable_operations[:get_api_test] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_api_test") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_api_test")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Get the last 50 test results summaries for a given Synthetics 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 [SyntheticsGetAPITestLatestResultsResponse] 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 50 test results summaries for a given Synthetics 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.unstable_operations.has_key?(:get_api_test_latest_results) unstable_enabled = @api_client.config.unstable_operations[:get_api_test_latest_results] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_api_test_latest_results") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_api_test_latest_results")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Get a specific full result from a given (API) Synthetic 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 [SyntheticsAPITestResultFull] 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 (API) Synthetic 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.unstable_operations.has_key?(:get_api_test_result) unstable_enabled = @api_client.config.unstable_operations[:get_api_test_result] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_api_test_result") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_api_test_result")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # 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 [SyntheticsBrowserTest] 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.unstable_operations.has_key?(:get_browser_test) unstable_enabled = @api_client.config.unstable_operations[:get_browser_test] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_browser_test") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_browser_test")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Get the last 50 test results summaries for a given Synthetics 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 [SyntheticsGetBrowserTestLatestResultsResponse] 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 50 test results summaries for a given Synthetics 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.unstable_operations.has_key?(:get_browser_test_latest_results) unstable_enabled = @api_client.config.unstable_operations[:get_browser_test_latest_results] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_browser_test_latest_results") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_browser_test_latest_results")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Get a specific full result from a given (browser) Synthetic 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 [SyntheticsBrowserTestResultFull] 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 (browser) Synthetic 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.unstable_operations.has_key?(:get_browser_test_result) unstable_enabled = @api_client.config.unstable_operations[:get_browser_test_result] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_browser_test_result") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_browser_test_result")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # 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 [SyntheticsGlobalVariable] 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.unstable_operations.has_key?(:get_global_variable) unstable_enabled = @api_client.config.unstable_operations[:get_global_variable] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_global_variable") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_global_variable")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 private location # Get a Synthetics private location. # @param location_id [String] The ID of the private location. # @param opts [Hash] the optional parameters # @return [SyntheticsPrivateLocation] 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 Synthetics 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.unstable_operations.has_key?(:get_private_location) unstable_enabled = @api_client.config.unstable_operations[:get_private_location] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_private_location") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_private_location")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Get a batch's updated details. # @param batch_id [String] The ID of the batch. # @param opts [Hash] the optional parameters # @return [SyntheticsBatchDetails] 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.unstable_operations.has_key?(:get_synthetics_ci_batch) unstable_enabled = @api_client.config.unstable_operations[:get_synthetics_ci_batch] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_synthetics_ci_batch") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_synthetics_ci_batch")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 a test configuration # Get the detailed configuration associated with a Synthetics test. # @param public_id [String] The public ID of the test to get details from. # @param opts [Hash] the optional parameters # @return [SyntheticsTestDetails] 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 Synthetics 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.unstable_operations.has_key?(:get_test) unstable_enabled = @api_client.config.unstable_operations[:get_test] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "get_test") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_test")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Get the list of all Synthetics global variables. # @param opts [Hash] the optional parameters # @return [SyntheticsListGlobalVariablesResponse] 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 Synthetics 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.unstable_operations.has_key?(:list_global_variables) unstable_enabled = @api_client.config.unstable_operations[:list_global_variables] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "list_global_variables") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_global_variables")) end end 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 ) data, status_code, headers = @api_client.call_api(: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) # Get the list of public and private locations available for Synthetic # tests. No arguments required. # @param opts [Hash] the optional parameters # @return [SyntheticsLocations] 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.unstable_operations.has_key?(:list_locations) unstable_enabled = @api_client.config.unstable_operations[:list_locations] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "list_locations") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_locations")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 tests # Get the list of all Synthetic tests. # @param opts [Hash] the optional parameters # @return [SyntheticsListTestsResponse] def list_tests(opts = {}) data, _status_code, _headers = list_tests_with_http_info(opts) data end # Get the list of all tests # Get the list of all Synthetic tests. # @param opts [Hash] the optional parameters # @return [Array<(SyntheticsListTestsResponse, Integer, Hash)>] SyntheticsListTestsResponse data, response status code and response headers def list_tests_with_http_info(opts = {}) if @api_client.config.unstable_operations.has_key?(:list_tests) unstable_enabled = @api_client.config.unstable_operations[:list_tests] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "list_tests") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_tests")) end end 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] || {} # 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 ) data, status_code, headers = @api_client.call_api(: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 # Trigger tests from CI/CD pipelines # Trigger a set of Synthetics tests for continuous integration. # @param body [SyntheticsCITestBody] Details of the test to trigger. # @param opts [Hash] the optional parameters # @return [SyntheticsTriggerCITestsResponse] 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 Synthetics 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.unstable_operations.has_key?(:trigger_ci_tests) unstable_enabled = @api_client.config.unstable_operations[:trigger_ci_tests] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "trigger_ci_tests") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "trigger_ci_tests")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 Synthetics tests # Trigger a set of Synthetics tests. # @param body [SyntheticsTriggerBody] The identifiers of the tests to trigger. # @param opts [Hash] the optional parameters # @return [SyntheticsTriggerCITestsResponse] def trigger_tests(body, opts = {}) data, _status_code, _headers = trigger_tests_with_http_info(body, opts) data end # Trigger Synthetics tests # Trigger a set of Synthetics 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.unstable_operations.has_key?(:trigger_tests) unstable_enabled = @api_client.config.unstable_operations[:trigger_tests] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "trigger_tests") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "trigger_tests")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # 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 [SyntheticsAPITest] 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.unstable_operations.has_key?(:update_api_test) unstable_enabled = @api_client.config.unstable_operations[:update_api_test] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "update_api_test") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_api_test")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Edit the configuration of a Synthetic browser test. # @param public_id [String] The public ID of the test to get details from. # @param body [SyntheticsBrowserTest] New test details to be saved. # @param opts [Hash] the optional parameters # @return [SyntheticsBrowserTest] 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 get details from. # @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.unstable_operations.has_key?(:update_browser_test) unstable_enabled = @api_client.config.unstable_operations[:update_browser_test] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "update_browser_test") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_browser_test")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 private location # Edit a Synthetics 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 [SyntheticsPrivateLocation] 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 Synthetics 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.unstable_operations.has_key?(:update_private_location) unstable_enabled = @api_client.config.unstable_operations[:update_private_location] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "update_private_location") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_private_location")) end end 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 ) data, status_code, headers = @api_client.call_api(: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 # Pause or start a Synthetics 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 [Boolean] 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 Synthetics 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.unstable_operations.has_key?(:update_test_pause_status) unstable_enabled = @api_client.config.unstable_operations[:update_test_pause_status] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "update_test_pause_status") else raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_test_pause_status")) end end 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 ) data, status_code, headers = @api_client.call_api(: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