EventLogManager

class SoftLayer.managers.EventLogManager(client)[source]

Provides an interface for the SoftLayer Event Log Service.

See product information here: http://sldn.softlayer.com/reference/services/SoftLayer_Event_Log

__init__(client)[source]

Methods

__init__(client)

build_filter([date_min, date_max, ...])

Returns a query filter that can be passed into EventLogManager.get_event_logs

get_event_log_types()

Returns a list of event log types

get_event_logs([request_filter, log_limit, ...])

Returns a list of event logs

static build_filter(date_min=None, date_max=None, obj_event=None, obj_id=None, obj_type=None, utc_offset=None)[source]

Returns a query filter that can be passed into EventLogManager.get_event_logs

Parameters:
  • date_min (string) – Lower bound date in MM/DD/YYYY format

  • date_max (string) – Upper bound date in MM/DD/YYYY format

  • obj_event (string) – The name of the events we want to filter by

  • obj_id (int) – The id of the event we want to filter by

  • obj_type (string) – The type of event we want to filter by

  • utc_offset (string) – The UTC offset we want to use when converting date_min and date_max. (default ‘+0000’)

Returns:

dict: The generated query filter

get_event_log_types()[source]

Returns a list of event log types

Returns:

List of event log types

get_event_logs(request_filter=None, log_limit=20, iterator=True)[source]

Returns a list of event logs

Example:

event_mgr = SoftLayer.EventLogManager(env.client)
request_filter = event_mgr.build_filter(date_min="01/01/2019", date_max="02/01/2019")
logs = event_mgr.get_event_logs(request_filter)
for log in logs:
    print("Event Name: {}".format(log['eventName']))
Parameters:
  • request_filter (dict) – filter dict

  • log_limit (int) – number of results to get in one API call

  • iterator (bool) – False will only make one API call for log_limit results. True will keep making API calls until all logs have been retreived. There may be a lot of these.

Returns:

List of event logs. If iterator=True, will return a python generator object instead.