6.4. Reporting and Configuration Class Reference

6.4.1. AppResponse Objects

class steelscript.appresponse.core.appresponse.AppResponse(host, auth, port=443, versions=None)

Main interface to interact with a AppResponse appliance.

__init__(host, auth, port=443, versions=None)

Initialize an AppResponse object.

Parameters:
  • host (str) – name or IP address of the AppResponse appliance.
  • auth – defines the authentication method and credentials to use to access the AppResponse. It should be an instance of UserAuth or OAuth
  • port – integer, port number to connect to appliance
  • versions (dict) – service versions to use, keyed by the service name, value is a list of version strings that are required by the external application. If unspecified, this will use the latest version of each service supported by both this implementation and the AppResponse appliance.
create_report(data_def_request)

Helper method to initiate an AppResponse report.

Parameters:data_def_request (DataDef) – Single DataDef object defining the report criteria.
find_service(name)

Return a ServiceDef for a given service name.

get_capture_job_by_name(name)

Find a capture job by name.

get_capture_jobs()

Get a list of all existing capture jobs.

get_column_objects(source_name, columns)

Return proper Key/Value objects for given list of column strings.

Parameters:
  • source_name – string value of source name
  • columns – list of columns as strings
Returns:

column objects

get_info()

Get the basic info of the device.

service_manager

Initialize the service manager instance if it does not exist.

upload(dest_path, local_file)

Upload a local file to the AppResponse 11 device.

Parameters:
  • dest_path – path where local file will be stored at AppResponse device
  • local_file – path to local file to be uploaded
Returns:

location information if resource has been created, otherwise the response body (if any).

versions

Determine version strings for each required service.

6.4.2. Reporting Objects

class steelscript.appresponse.core.reports.DataDef(source, columns, start=None, end=None, duration=None, time_range=None, granularity=None, resolution=None, limit=None, topbycolumns=None)

Interface to build a data definition for uploading to a report.

__init__(source, columns, start=None, end=None, duration=None, time_range=None, granularity=None, resolution=None, limit=None, topbycolumns=None)

Initialize a data definition request object.

Parameters:
  • source – Reference to a source object. If a string, will try to convert to a SourceProxy
  • columns – list Key/Value column objects.
  • start – epoch start time in seconds.
  • end – epoch endtime in seconds.
  • duration – string duration of data def request.
  • time_range – string time range of data def request.
  • granularity (int) – granularity in seconds. Required.
  • resolution (int) – resolution in seconds. Optional
  • limit – limit to number of returned rows. Optional
  • topbycolumn – Key/Value columns to be used for topn. Optional.

For defining the overall time for the report, either a single time_range string may be used or a combination of start/end/duration. Further discussion on granularity and resolution: Granularity refers to the amount of time for which the data source computes a summary of the metrics it received. The data source examines all data and creates summaries for 1 second, 1 minute, 5 minute, 15 minute, 1 hour, 6 hour and 1 day, etc. Greater granularity (shorter time periods) results in greater accuracy. Lesser granularity (1 hour, 6 hours, 1 day) requires less processing and therefore the data is returned faster. Granularity must be specified as number of seconds. Resolution must be multiple of the requested granularity. For example, if you specify granularity of 5mins (300 seconds) then the resolution can be set to 5mins, 10mins, 15mins, etc. If the resolution is set to be equal of the granularity then it has no effect to the number of returned samples. The resolution is optional.

add_filter(filter)

Add one traffic filter to the data def.

Parameters:filter – types.TrafficFilter object
class steelscript.appresponse.core.reports.Report(appresponse)

Main interface to build and run a report on AppResponse.

__init__(appresponse)

Initialize a new report.

Parameters:appresponse – the AppResponse object.
add(data_def_request)

Add one data definition request.

delete()

Delete the report from the appliance.

get_data(index=0)

Return data for the indexed data definition requests.

Parameters:index (int) – Set to None to return data from all data definitions, defaults to returning the data from just the first data def.
get_dataframe(index=0)

Return data in pandas DataFrame format.

This will return a single DataFrame for the given index, unlike get_data and get_legend which will optionally return info for all data defs in a report.

Requires `pandas` library to be available in environment.

Parameters:index (int) – DataDef to process into DataFrame. Defaults to 0.
get_legend(index=0, details=False)

Return legend information for the data definition.

Parameters:
  • index (int) – Set to None to return data from all data definitions, defaults to returning the data from just the first data def.
  • details (bool) – If True, return complete column dict, otherwise just short label ids for each column will be returned
run()

Create and run a report instance with stored data definitions.