Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-10038

Add Report HTTP service

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 6.12.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Team:
      Coremunity
    • Sprint:
      Platform Core KANBAN
    • Release Notes:
      Not Needed
    • Release Notes Summary:
      The new HTTP code now has a report service it can use for submitting reports
    • QA Risk Assessment:
      Needs Assessment

      Description

      Implement a report service with support for the following method:

      put_report(name, report, environment:)
      

      • Submit the report to /puppet/v3/report/<name>
      • Require the environment argument and send it as an HTTP query parameter
      • Use Puppet[:preferred_serialization_format] to select the formatter:

          formatter = Puppet::Network::FormatHandler.format_for(Puppet[:preferred_serialization_format])
      

      • Set the request body to the serialized report: formatter.render(report)
      • Set the Content-Length to the number of bytes in the serialized report
      • Set the Content-Type header to formatter.mime
      • Set the Accept header to to the mime types that we support for the Report
      • Accept response content as application/json, application/x-msgpack, text/pson. For example:

      model = Puppet::Transaction::Report
      model.supported_formats.reject { |f| f == :yaml }.map { |f| model.get_format(f).mime }
      

      • If we fail to send the report, the server version is < 5 and the current serialization format is not pson, then emit an error that preferred_serialization_format should be set to pson.

      See puppet/indirector/report/rest.rb

        Attachments

          Activity

            People

            Assignee:
            melissa Melissa Stone
            Reporter:
            josh Josh Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support