Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Latest commit

 

History

History
492 lines (314 loc) · 11.3 KB

AssetDiscoveryApi.md

File metadata and controls

492 lines (314 loc) · 11.3 KB

Rapid7VmConsole::AssetDiscoveryApi

All URIs are relative to https://localhost:3780

Method HTTP request Description
create_sonar_query POST /api/3/sonar_queries Sonar Queries
delete_sonar_query DELETE /api/3/sonar_queries/{id} Sonar Query
get_discovery_connection GET /api/3/discovery_connections/{id} Discovery Connection
get_discovery_connections GET /api/3/discovery_connections Discovery Connections
get_sonar_queries GET /api/3/sonar_queries Sonar Queries
get_sonar_query GET /api/3/sonar_queries/{id} Sonar Query
get_sonar_query_assets GET /api/3/sonar_queries/{id}/assets Sonar Query Assets
reconnect_discovery_connection POST /api/3/discovery_connections/{id}/connect Discovery Connection Reconnect
sonar_query_search POST /api/3/sonar_queries/search Sonar Query Search
update_sonar_query PUT /api/3/sonar_queries/{id} Sonar Query

create_sonar_query

CreatedReferenceDiscoveryQueryIDLink create_sonar_query(opts)

Sonar Queries

Creates a sonar query.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

opts = { 
  query: Rapid7VmConsole::SonarQuery.new # SonarQuery | The criteria for a Sonar query.
}

begin
  #Sonar Queries
  result = api_instance.create_sonar_query(opts)
  p result
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->create_sonar_query: #{e}"
end

Parameters

Name Type Description Notes
query SonarQuery The criteria for a Sonar query. [optional]

Return type

CreatedReferenceDiscoveryQueryIDLink

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

delete_sonar_query

Links delete_sonar_query(id)

Sonar Query

Removes a sonar query.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

id = 789 # Integer | The identifier of the Sonar query.


begin
  #Sonar Query
  result = api_instance.delete_sonar_query(id)
  p result
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->delete_sonar_query: #{e}"
end

Parameters

Name Type Description Notes
id Integer The identifier of the Sonar query.

Return type

Links

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

get_discovery_connection

DiscoveryConnection get_discovery_connection(id)

Discovery Connection

Returns a discovery connection.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

id = 789 # Integer | The identifier of the discovery connection.


begin
  #Discovery Connection
  result = api_instance.get_discovery_connection(id)
  p result
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->get_discovery_connection: #{e}"
end

Parameters

Name Type Description Notes
id Integer The identifier of the discovery connection.

Return type

DiscoveryConnection

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

get_discovery_connections

PageOfDiscoveryConnection get_discovery_connections(opts)

Discovery Connections

Returns all discovery connections.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

opts = { 
  page: 0, # Integer | The index of the page (zero-based) to retrieve.
  size: 10, # Integer | The number of records per page to retrieve.
  sort: ['sort_example'] # Array<String> | The criteria to sort the records by, in the format: `property[,ASC|DESC]`. The default sort order is ascending. Multiple sort criteria can be specified using multiple sort query parameters.
}

begin
  #Discovery Connections
  result = api_instance.get_discovery_connections(opts)
  p result
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->get_discovery_connections: #{e}"
end

Parameters

Name Type Description Notes
page Integer The index of the page (zero-based) to retrieve. [optional] [default to 0]
size Integer The number of records per page to retrieve. [optional] [default to 10]
sort Array<String> The criteria to sort the records by, in the format: `property[,ASC DESC]`. The default sort order is ascending. Multiple sort criteria can be specified using multiple sort query parameters.

Return type

PageOfDiscoveryConnection

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

get_sonar_queries

ResourcesSonarQuery get_sonar_queries

Sonar Queries

Returns all sonar queries.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

begin
  #Sonar Queries
  result = api_instance.get_sonar_queries
  p result
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->get_sonar_queries: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

ResourcesSonarQuery

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

get_sonar_query

SonarQuery get_sonar_query(id)

Sonar Query

Returns a sonar query.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

id = 789 # Integer | The identifier of the Sonar query.


begin
  #Sonar Query
  result = api_instance.get_sonar_query(id)
  p result
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->get_sonar_query: #{e}"
end

Parameters

Name Type Description Notes
id Integer The identifier of the Sonar query.

Return type

SonarQuery

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

get_sonar_query_assets

ResourcesDiscoveryAsset get_sonar_query_assets(id)

Sonar Query Assets

Returns the assets that are discovered by a Sonar query.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

id = 789 # Integer | The identifier of the Sonar query.


begin
  #Sonar Query Assets
  result = api_instance.get_sonar_query_assets(id)
  p result
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->get_sonar_query_assets: #{e}"
end

Parameters

Name Type Description Notes
id Integer The identifier of the Sonar query.

Return type

ResourcesDiscoveryAsset

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

reconnect_discovery_connection

reconnect_discovery_connection(id)

Discovery Connection Reconnect

Attempts to reconnect the discovery connection.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

id = 789 # Integer | The identifier of the discovery connection.


begin
  #Discovery Connection Reconnect
  api_instance.reconnect_discovery_connection(id)
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->reconnect_discovery_connection: #{e}"
end

Parameters

Name Type Description Notes
id Integer The identifier of the discovery connection.

Return type

nil (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

sonar_query_search

Array<DiscoveryAsset> sonar_query_search(opts)

Sonar Query Search

Executes a Sonar query to discover assets with the given search criteria.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

opts = { 
  query: Rapid7VmConsole::SonarCriteria.new # SonarCriteria | The criteria for a Sonar query.
}

begin
  #Sonar Query Search
  result = api_instance.sonar_query_search(opts)
  p result
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->sonar_query_search: #{e}"
end

Parameters

Name Type Description Notes
query SonarCriteria The criteria for a Sonar query. [optional]

Return type

Array<DiscoveryAsset>

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

update_sonar_query

Links update_sonar_query(id, opts)

Sonar Query

Updates a sonar query.

Example

# load the gem
require 'rapid7_vm_console'

api_instance = Rapid7VmConsole::AssetDiscoveryApi.new

id = 789 # Integer | The identifier of the Sonar query.

opts = { 
  query: Rapid7VmConsole::SonarQuery.new # SonarQuery | The criteria for a Sonar query.
}

begin
  #Sonar Query
  result = api_instance.update_sonar_query(id, opts)
  p result
rescue Rapid7VmConsole::ApiError => e
  puts "Exception when calling AssetDiscoveryApi->update_sonar_query: #{e}"
end

Parameters

Name Type Description Notes
id Integer The identifier of the Sonar query.
query SonarQuery The criteria for a Sonar query. [optional]

Return type

Links

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8