@@ -121,7 +121,7 @@ def search(self, query):
121121 return search_result
122122
123123 def report (self , scope = None , groups = None , metrics = None , where = None ,
124- from_ = None , to = None , timezone = 'UTC' , fast = True ):
124+ from_ = None , to = None , timezone = 'UTC' , emails = None , fast = True ):
125125 """Create a report.
126126
127127 See the `reporting atomx wiki <http://wiki.atomx.com/doku.php?id=reporting>`_
@@ -147,6 +147,9 @@ def report(self, scope=None, groups=None, metrics=None, where=None,
147147 should end (exclusive). (defaults to `datetime.now()` if undefined)
148148 :param str timezone: Timezone used for all times. (defaults to `UTC`)
149149 For a supported list see http://wiki.atomx.com/doku.php?id=timezones
150+ :param emails: One or multiple email addresses that should get
151+ notified once the report is finished and ready to download.
152+ :type emails: str or list
150153 :param bool fast: if `False` the report will always be run against the low level data.
151154 This is useful for billing reports for example.
152155 The default is `True` which means it will always try to use aggregate data
@@ -198,6 +201,11 @@ def report(self, scope=None, groups=None, metrics=None, where=None,
198201 else :
199202 report_json ['to' ] = to
200203
204+ if emails :
205+ if not isinstance (emails , list ):
206+ emails = [emails ]
207+ report_json ['emails' ] = emails
208+
201209 r = self .session .post (self .api_endpoint + 'report' , json = report_json )
202210 if not r .ok :
203211 raise APIError (r .json ()['error' ])
0 commit comments