-
Story
-
Resolution: Done
-
Normal
-
None
-
None
The focus of this story is to establish the input/output mechanisms for exporting subscription data. After the completion of this story, I expect to be able to put a message on the platform.export.requests topic and have the swatch-subscription-sync-service app try to report an error back to the Export Service.
Requirements:
- Define an example message to use for testing (see https://github.com/RedHatInsights/export-service-go/blob/main/docs/integration.md for crafting this)
- Use https://github.com/RedHatInsights/event-schemas-java to parse the message
- Kafka listener created to listen to topic platform.export.requests exists in org.candlepin.subscriptions.subscription package
- Messages where application != subscriptions are ignored
- Messages where resource != subscriptions are ignored
- Note: there looks like a discrepency in the word "resource" when it comes to the event message schema and the api spec when posting back
- The listener should implement logic as follows:
-
- checkRbac (stubbed method)
- fetchData(request) (stubbed method)
- uploadData(data, format) should delegate to uploadCsv(data) or uploadJson(data), and throw "format %s not implemented" for any other format.
- The listener must catch and report these errors with exportClient.downloadExportError with error code 501 and a message explaining what's not yet implemented.
- At this time, checkRbac, fetchData, and uploadJson, and uploadCsv should be stubbed to throw an exception indicating what's not implemented.
- Unexpected errors should be caught, logged at error level, and reported with exportClient.downloadExportError with error code 500, and a message "Unexpected error."
- URLs & credentials for the export service should be populated from Clowder
Testing considerations:
- An export request for instances and/or subscriptions should fail at this point with not implemented message for rbac.
- We should be able to drop example messages onto the export requests topic easy enough locally and in EE/pr checks
- For stage testing we should be able to initiate this by hitting the export service's public facing api
- blocks
-
SWATCH-2017 Implement rbac checking for exports
- Closed
-
SWATCH-2026 Add a grafana dashboard for export requests
- Closed
- is blocked by
-
SWATCH-1968 Add export service to ephemeral deployment
- Closed
-
SWATCH-1969 Generate an export service client from the openapi spec
- Closed