lce_service.collector_log_api.dispatch_logs module

lce_service.collector_log_api.dispatch_logs.dispatch_log_inventory(dbc: silo_cursor, appliance: Dict[str, Any], directory: LogDirectory, user: User) → int

Queues a command that enumerates the log files available on a collector.

Parameters:
  • dbc – A silo_cursor instance used to queue the command and record its ownership.

  • appliance – The collecting appliance to enumerate logs on, as returned by get_collecting_appliance.

  • directory – The log directory to enumerate, already resolved by validate_log_directory.

  • user – The User instance the queued command is attributed to.

Returns:

The process id to poll for the inventory.

Raises:

DatabaseExecutionError – Raised when the command cannot be queued or attributed.

lce_service.collector_log_api.dispatch_logs.dispatch_log_read(dbc: silo_cursor, appliance: Dict[str, Any], request: CollectorLogRequest, user: User) → int

Queues a command that reads one log file on a collector.

Parameters:
  • dbc – A silo_cursor instance used to queue the command and record its ownership.

  • appliance – The collecting appliance to read from, as returned by get_collecting_appliance.

  • request – A validated CollectorLogRequest describing what to read.

  • user – The User instance the queued command is attributed to.

Returns:

The process id to poll for the log content.

Raises:

DatabaseExecutionError – Raised when the command cannot be queued or attributed.

lce_service.collector_log_api.dispatch_logs.run_log_inventory_locally(directory: LogDirectory) → LocalRun

Enumerates the log files on this host with the command dispatch_log_inventory queues.

Parameters:

directory – The log directory to enumerate, already resolved by validate_log_directory.

Returns:

The LocalRun of the inventory command.

Raises:

InvalidToolboxRequestError – Raised when the command cannot be run as given.

lce_service.collector_log_api.dispatch_logs.run_log_read_locally(request: CollectorLogRequest) → LocalRun

Reads one log file on this host with the command dispatch_log_read queues.

Parameters:

request – A validated CollectorLogRequest describing what to read.

Returns:

The LocalRun of the read command.

Raises:

InvalidToolboxRequestError – Raised when the command cannot be run as given.