core
core copied to clipboard
Implement GET /api/v2/tags/export and /api/v2/tags/export/template endpoints (Tag Export)
Task
Context: Part of Feature #32943 (Import/Export Tags) in Tags Portlet Modernization Epic. Implements tag export functionality with CSV/JSON formats and template generation.
Definition of Done:
- Export endpoint:
- Format parameter (csv/json, default: csv)
- Same filtering as listing: filter, global, siteId
- CSV format: "Tag Name,Host ID"
- JSON format: structured tag objects
- Proper file headers (Content-Type, Content-Disposition)
- Dynamic filename with timestamp
- Template endpoint:
- Returns CSV template with headers and examples
- No parameters required
- Fixed filename: "tag-import-template.csv"
- Validation: format (csv/json), siteId (UUID), global (boolean)
- Error responses: 400, 401, 403, 500
- Integration tests for both formats and filtering
- Postman tests for export scenarios
Proposed Objective
Same as Parent Issue
Proposed Priority
Same as Parent Issue
Acceptance Criteria
- Export returns downloadable file with correct headers
- CSV format matches import template structure
- JSON format includes structured tag data
- Template endpoint returns example CSV
- Invalid format parameter returns 400
- Filtering works same as listing endpoint
- Requires authentication and Tags portlet access
- File generation errors return 500
External Links... Slack Conversations, Support Tickets, Figma Designs, etc.
No response
Assumptions & Initiation Needs
No response
Quality Assurance Notes & Workarounds
No response
Sub-Tasks & Estimates
No response