oadrReportRequest.xml 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. <oadr:oadrReportRequest>
  2. <ei:reportRequestID>{{ report_request.report_request_id }}</ei:reportRequestID>
  3. <ei:reportSpecifier xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0">
  4. <ei:reportSpecifierID>{{ report_request.report_specifier.report_specifier_id }}</ei:reportSpecifierID>
  5. <xcal:granularity>
  6. <xcal:duration>{{ report_request.report_specifier.granularity|timedeltaformat }}</xcal:duration>
  7. </xcal:granularity>
  8. {% if report_request.report_specifier.report_back_duration is defined and report_request.report_specifier.report_back_duration is not none %}
  9. <ei:reportBackDuration>
  10. <xcal:duration>{{ report_request.report_specifier.report_back_duration|timedeltaformat }}</xcal:duration>
  11. </ei:reportBackDuration>
  12. {% endif %}
  13. {% if report_request.report_specifier.report_interval is defined and report_request.report_specifier.report_interval is not none %}
  14. <ei:reportInterval>
  15. <xcal:properties>
  16. <xcal:dtstart>
  17. <xcal:date-time>{{ report_request.report_specifier.report_interval.dtstart|datetimeformat }}</xcal:date-time>
  18. </xcal:dtstart>
  19. <xcal:duration>
  20. <xcal:duration>{{ report_request.report_specifier.report_interval.duration|timedeltaformat }}</xcal:duration>
  21. </xcal:duration>
  22. </xcal:properties>
  23. </ei:reportInterval>
  24. {% endif %}
  25. {% for specifier_payload in report_request.report_specifier.specifier_payloads %}
  26. <ei:specifierPayload>
  27. <ei:rID>{{ specifier_payload.r_id }}</ei:rID>
  28. <ei:readingType>{{ specifier_payload.reading_type }}</ei:readingType>
  29. </ei:specifierPayload>
  30. {% endfor %}
  31. </ei:reportSpecifier>
  32. </oadr:oadrReportRequest>