@@ -121,7 +121,7 @@ def search(self, query):
121
121
return search_result
122
122
123
123
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 ):
125
125
"""Create a report.
126
126
127
127
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,
147
147
should end (exclusive). (defaults to `datetime.now()` if undefined)
148
148
:param str timezone: Timezone used for all times. (defaults to `UTC`)
149
149
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
150
153
:param bool fast: if `False` the report will always be run against the low level data.
151
154
This is useful for billing reports for example.
152
155
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,
198
201
else :
199
202
report_json ['to' ] = to
200
203
204
+ if emails :
205
+ if not isinstance (emails , list ):
206
+ emails = [emails ]
207
+ report_json ['emails' ] = emails
208
+
201
209
r = self .session .post (self .api_endpoint + 'report' , json = report_json )
202
210
if not r .ok :
203
211
raise APIError (r .json ()['error' ])
0 commit comments