class BackscatterIO::Api

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/backscatterio/api/default_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

enrich_asn(query, opts = {}) click to toggle source

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
enrich_asn_with_http_info(query, opts = {}) click to toggle source

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
enrich_ip(query, opts = {}) click to toggle source

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
enrich_ip_with_http_info(query, opts = {}) click to toggle source

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
enrich_network(query, opts = {}) click to toggle source

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
enrich_network_with_http_info(query, opts = {}) click to toggle source

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
hello(opts = {}) click to toggle source

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
hello_with_http_info(opts = {}) click to toggle source

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
observations(query_type, query, opts = {}) click to toggle source

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
observations_with_http_info(query_type, query, opts = {}) click to toggle source

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