Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-2018

Report filtered instance data to Export Service in JSON

    XMLWordPrintable

Details

    • Story
    • Resolution: Done
    • Undefined
    • 2024-04-23 - API
    • None
    • None

    Description

      How much refactoring/reusing code that was added as part of SWATCH-1970?  https://github.com/RedHatInsights/rhsm-subscriptions/pull/2953/files#diff-833f337360b4cd2bf2d15aa9b27f1c30f730be45919f54ed5927d44c308f942eR71-R72 

      This card should follow what we did in SWATCH-2021, just with instance data instead of subscription data.

       

      Implement the fetchData method for instances export in swatch-tally.

      Guests should also be fetched.

      The following filter parameters must be supported:

      • product_id
      • sla
      • usage
      • uom metric_id
      • billing_provider
      • billing_account_id
      • display_name_contains
      • category
      • beginning

      Any other parameters must be ignored.

      fetchData must throw an exception for bad product_id, sla, usage, uom, billing_provider, or category. The listener must catch and report these errors with exportClient.downloadExportError with error code 400 and a message explaining what parameter(s) are bad. The error message may be limited to a single parameter.

      Create a yaml json schema file in src/main/resources/subscriptions-export.yaml and generate the POJO model using jsonSchema2Pojo.

      Create a yaml json schema file in src/main/resources/instances-export.yaml and generate the POJO model using jsonSchema2Pojo.

      The schema must define properties necessary for the following JSON example: – See schema in SWATCH-2019 (subtask)

       

      Implement uploadJson:

      call exportClient.downloadExportUpload with JSON-formatted data

      Testing:

      • Attempted export with bad parameter(s) should fail with a message explaining which parameter(s) are bad.
      • Attempted export for JSON should succeed (after correcting bad parameters)
      • Attempted export for CSV should fail because the format is not yet implemented.

      Attachments

        Issue Links

          Activity

            People

              jcarvaja@redhat.com Jose Carvajal Hilario
              lburnett0 Lindsey Burnett
              Sanket Jagtap Sanket Jagtap
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: