small additional information here to be added,
for people using quota reporting on none enforced volumes for easier accumulation of space used by a specific user, quota-report-iter using a filter will not show such entries.
Meaning Volume1 has quota turned on but no limits and target equals "*" ... for that case you'll still need to fetch the complete report iter and filter manually
api1.set_vserver('')
report = NaElement('quota-report-iter')
report.child_add(NaElement('max-records', maxrecords))
query = NaElement('query')
quota = NaElement('quota')
query.child_add(quota)
quota.child_add(NaElement('quota-target', 'lang'))
report.child_add(query)
res = api1.invoke_elem(report)
print res.sprintf()
<results status="passed">
<num-records>0</num-records>
</results>
where retrieving all items without filter will provide expected entries
api1.set_vserver('')
QReports = QuotaReportCollector(from_api=api1.invoke(*['quota-report-iter', 'max-records', maxrecords]).child_get('attributes-list'))
map(str, QReports.get_report(target='lang'))
['<quota disk_limit="-" disk_used="1" file_limit="-" files_used="136" type="user" uid="lang" volume="vol1"/>',
'<quota disk_limit="-" disk_used="76" file_limit="-" files_used="2485" type="user" uid="lang" volume="vol2"/>',
'<quota disk_limit="-" disk_used="10909" file_limit="-" files_used="106679" type="user" uid="lang" volume="vol3"/>',
'<quota disk_limit="-" disk_used="21" file_limit="-" files_used="2" type="user" uid="lang" volume="vol4"/>',
'<quota disk_limit="-" disk_used="279" file_limit="-" files_used="336" type="user" uid="lang" volume="vol5"/>',
'<quota disk_limit="-" disk_used="10" file_limit="-" files_used="10" type="user" uid="lang" volume="vol6"/>']