class BackscatterIO::Api
Attributes
Public Class Methods
# File lib/backscatterio/api/default_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
enriches asn returns enrichment data for an ASN @param query @param [Hash] opts the optional parameters @return [ASNEnrichment]
# File lib/backscatterio/api/default_api.rb, line 27 def enrich_asn(query, opts = {}) data, _status_code, _headers = enrich_asn_with_http_info(query, opts) data end
enriches asn returns enrichment data for an ASN @param query @param [Hash] opts the optional parameters @return [Array<(ASNEnrichment
, Fixnum, Hash)>] ASNEnrichment
data, response status code and response headers
# File lib/backscatterio/api/default_api.rb, line 37 def enrich_asn_with_http_info(query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Api.enrich_asn ...' end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling Api.enrich_asn" end # resource path local_var_path = '/enrichment/asn' # query parameters query_params = {} query_params[:'query'] = query # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ASNEnrichment') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#enrich_asn\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
enriches ip returns enrichment data for an ip @param query @param [Hash] opts the optional parameters @return [IPEnrichment]
# File lib/backscatterio/api/default_api.rb, line 80 def enrich_ip(query, opts = {}) data, _status_code, _headers = enrich_ip_with_http_info(query, opts) data end
enriches ip returns enrichment data for an ip @param query @param [Hash] opts the optional parameters @return [Array<(IPEnrichment
, Fixnum, Hash)>] IPEnrichment
data, response status code and response headers
# File lib/backscatterio/api/default_api.rb, line 90 def enrich_ip_with_http_info(query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Api.enrich_ip ...' end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling Api.enrich_ip" end # resource path local_var_path = '/enrichment/ip' # query parameters query_params = {} query_params[:'query'] = query # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'IPEnrichment') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#enrich_ip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
enriches network returns enrichment data for a network @param query @param [Hash] opts the optional parameters @return [NetworkEnrichment]
# File lib/backscatterio/api/default_api.rb, line 133 def enrich_network(query, opts = {}) data, _status_code, _headers = enrich_network_with_http_info(query, opts) data end
enriches network returns enrichment data for a network @param query @param [Hash] opts the optional parameters @return [Array<(NetworkEnrichment
, Fixnum, Hash)>] NetworkEnrichment
data, response status code and response headers
# File lib/backscatterio/api/default_api.rb, line 143 def enrich_network_with_http_info(query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Api.enrich_network ...' end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling Api.enrich_network" end # resource path local_var_path = '/enrichment/network' # query parameters query_params = {} query_params[:'query'] = query # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NetworkEnrichment') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#enrich_network\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
authenticate to the service @param [Hash] opts the optional parameters @return [Hello]
# File lib/backscatterio/api/default_api.rb, line 184 def hello(opts = {}) data, _status_code, _headers = hello_with_http_info(opts) data end
authenticate to the service @param [Hash] opts the optional parameters @return [Array<(Hello
, Fixnum, Hash)>] Hello
data, response status code and response headers
# File lib/backscatterio/api/default_api.rb, line 192 def hello_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Api.hello ...' end # resource path local_var_path = '/hello' # query parameters query_params = {} # header parameters 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 = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Hello') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#hello\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
fetches observations for a given ip address @param query_type query type ip, network, asn, port, country @param query ip address, cidr block, asn, port, or country @param [Hash] opts the optional parameters @option opts [String] :scope timeframe to search over, e.g., 1d, 7d @return [Observations]
# File lib/backscatterio/api/default_api.rb, line 233 def observations(query_type, query, opts = {}) data, _status_code, _headers = observations_with_http_info(query_type, query, opts) data end
fetches observations for a given ip address @param query_type query type ip, network, asn, port, country @param query ip address, cidr block, asn, port, or country @param [Hash] opts the optional parameters @option opts [String] :scope timeframe to search over, e.g., 1d, 7d @return [Array<(Observations
, Fixnum, Hash)>] Observations
data, response status code and response headers
# File lib/backscatterio/api/default_api.rb, line 244 def observations_with_http_info(query_type, query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Api.observations ...' end # verify the required parameter 'query_type' is set if @api_client.config.client_side_validation && query_type.nil? fail ArgumentError, "Missing the required parameter 'query_type' when calling Api.observations" end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling Api.observations" end # resource path local_var_path = '/observations/{queryType}'.sub('{' + 'queryType' + '}', query_type.to_s) # query parameters query_params = {} query_params[:'query'] = query query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil? # header parameters 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 = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Observations') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#observations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Top N items A listing of the top N items observered over the query scope @param trend_type which item type you want to perform a trend over @param [Hash] opts the optional parameters @option opts [String] :scope timeframe to search over, e.g., 1d, 7d @return [Trends]
# File lib/backscatterio/api/default_api.rb, line 295 def trends(trend_type, opts = {}) data, _status_code, _headers = trends_with_http_info(trend_type, opts) data end
Top N items A listing of the top N items observered over the query scope @param trend_type which item type you want to perform a trend over @param [Hash] opts the optional parameters @option opts [String] :scope timeframe to search over, e.g., 1d, 7d @return [Array<(Trends
, Fixnum, Hash)>] Trends
data, response status code and response headers
# File lib/backscatterio/api/default_api.rb, line 306 def trends_with_http_info(trend_type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Api.trends ...' end # verify the required parameter 'trend_type' is set if @api_client.config.client_side_validation && trend_type.nil? fail ArgumentError, "Missing the required parameter 'trend_type' when calling Api.trends" end # verify enum value if @api_client.config.client_side_validation && !['ip', 'network', 'asn', 'port', 'country'].include?(trend_type) fail ArgumentError, "invalid value for 'trend_type', must be one of ip, network, asn, port, country" end # resource path local_var_path = '/trends/popular/{trendType}'.sub('{' + 'trendType' + '}', trend_type.to_s) # query parameters query_params = {} query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Trends') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#trends\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end