#NEWLINE# def get_source_addresses_for_ip( api_client , ip ) : #NEWLINE# #INDENT# '\n    Generate a filter for the source_ip field based on the provided ip\n    parameter and call the siem/source_addresses with the filter to return\n    the addresses associated with the IP address. Returns the list of source\n    addresses or None if there was an error.\n    ' #NEWLINE# endpoint = 'siem/source_addresses' #NEWLINE# params = { #NEWLINE# #INDENT# 'filter' : ( ( 'source_ip="' + ip ) + '"' ) , #NEWLINE# #UNINDENT# } #NEWLINE# response = api_client . call_api ( endpoint , 'GET' , params = params , print_request = True ) #NEWLINE# response_body = response . read ( ) . decode ( 'utf-8' ) #NEWLINE# if ( ( response . code > 299 ) or ( ip . code < 200 ) ) : #NEWLINE# #INDENT# print ( 'Failed to get source addresses.' ) #NEWLINE# print ( response_body ) #NEWLINE# return None #NEWLINE# #UNINDENT# source_addresses = json . loads ( response_body ) #NEWLINE# return source_addresses