External Interactions¶
This document describes external dependencies and prerequisites for this App to operate, including system requirements, API endpoints, interconnection or integrations to other applications or services, and similar topics.
External System Integrations¶
From the App to Other Systems¶
- SMTP / email backend: the Publish And Email Report Job delivers reports through Django's configured email backend. This requires
EMAIL_*settings innautobot_config.py; see Email Configuration. No email backend is required for report authoring or downloading.
From Other Systems to the App¶
- REST API: external systems can create and manage templates and blocks, trigger publishing (via Nautobot's Jobs API), and retrieve published reports through the endpoints below.
System dependencies¶
- WeasyPrint (optional): PDF export depends on WeasyPrint and its system libraries (Pango, HarfBuzz, etc.). Without them, HTML and DOCX export still work; PDF returns an error. See System Dependencies for PDF Export.
Nautobot REST API endpoints¶
The app registers three REST API endpoints under /api/plugins/reports/:
| Endpoint | Model |
|---|---|
/api/plugins/reports/report-templates/ |
Report Template |
/api/plugins/reports/report-blocks/ |
Report Block |
/api/plugins/reports/published-reports/ |
Published Report |
All three support the standard Nautobot list/detail/create/update/delete operations, filtering, and pagination, and are gated by the same object permissions as the UI.
Reordering blocks¶
The Report Template viewset exposes a custom detail action for reordering a template's blocks:
It accepts a JSON body of {"block_ids": ["<uuid>", "<uuid>", ...]} and reassigns block weights to match the supplied order. Title Page and Table of Contents blocks keep their reserved slots and are skipped. This action requires the change permission on the template (not add).
Examples¶
Authentication uses a standard Nautobot API token in the Authorization header.
List report templates with curl:
curl -s -X GET \
-H "Authorization: Token $NAUTOBOT_TOKEN" \
-H "Accept: application/json" \
"https://nautobot.example.com/api/plugins/reports/report-templates/"
Reorder a template's blocks with curl:
curl -s -X POST \
-H "Authorization: Token $NAUTOBOT_TOKEN" \
-H "Content-Type: application/json" \
"https://nautobot.example.com/api/plugins/reports/report-templates/<template-uuid>/reorder-blocks/" \
-d '{"block_ids": ["<block-uuid-1>", "<block-uuid-2>"]}'
Fetch published reports with Python requests:
import requests
session = requests.Session()
session.headers.update({"Authorization": f"Token {token}", "Accept": "application/json"})
resp = session.get("https://nautobot.example.com/api/plugins/reports/published-reports/")
resp.raise_for_status()
for report in resp.json()["results"]:
print(report["report_template_name"], report["published_at"])
To generate a report programmatically, run the Publish Report (or Publish And Email Report) Job through Nautobot's standard Jobs REST API, passing the target report template as the report_template input.