Jira (PUP-10038) Add Report HTTP service

31 views
Skip to first unread message

Josh Cooper (JIRA)

unread,
Sep 24, 2019, 7:27:03 PM9/24/19
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Puppet / Improvement PUP-10038
Add Report HTTP service
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2019/09/24 4:26 PM
Priority: Normal Normal
Reporter: Josh Cooper

Implement a report service with support for the following:

PUT report

  • Include the report's environment as a query parameter
  • Serialize request body as JSON with Content-Type: application/json
  • Use puppet/v3 prefix
  • Accept response content as application/json, application/x-msgpack, text/pson
  • 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.
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Nov 19, 2019, 5:51:03 PM11/19/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Implement a report service with support for the following:

{noformat}
PUT
/puppet/v3/ report /<certname>
{noformat}

* Include the report's environment as a query parameter
* Serialize request body as JSON with {{Content-Type: application/json}}
* Use {{puppet/v3}} prefix
* Accept response content as {{application/json, application/x-msgpack, text/pson}}
* 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}}.

Josh Cooper (JIRA)

unread,
Nov 19, 2019, 6:15:03 PM11/19/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Implement a report service with support for the following method :

{noformat}
PUT put_report(name, report, environment:, :ssl_context: nil)
{noformat}

* Submit the report to {{
/puppet/v3/report/< certname name >
{noformat
} }

* Include the report's {{ environment as a }}
query parameter
* Serialize
request body as JSON with report via {{ report.render}}, and pass {{ Content-Type : application/json }}
* Use
as {{ puppet/v3 report.mime }} prefix
* Accept response content as {{application/json, application/x-msgpack, text/pson}}
. See {{Puppet::Indirector::Rest#headers}} for how this list is generated for each model (Report, Catalog, etc).
* 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

Melissa Stone (JIRA)

unread,
Nov 19, 2019, 6:15:04 PM11/19/19
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Sprint: Coremunity Hopper

Josh Cooper (JIRA)

unread,
Dec 18, 2019, 6:20:04 PM12/18/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Implement a report service with support for the following method:

{noformat}
put_report(name, report, environment: , :ssl_context: nil )
{noformat}

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

{code:ruby}
    formatter = Puppet::Network::FormatHandler.format_for(Puppet[:preferred_serialization_format])
{code}

* Set the request body to the serialized
report : {{formatter .render (report) }} , and pass
* Set the
{{Content- Length}} to the number of bytes in the serialized report
* Set the {{Content-
Type}} as header to {{ report 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}}. See For example:

{ { code:ruby}
model =
Puppet:: Indirector Transaction :: Rest#headers Report
model.supported_formats.reject { |f| f == :yaml
} } for how this list is generated for each .map { |f| model .get_format ( Report, Catalog, etc f ). mime }
{code}

* 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

Melissa Stone (JIRA)

unread,
Dec 30, 2019, 1:51:03 PM12/30/19
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Sprint: Coremunity Hopper Platform Core KANBAN

Melissa Stone (JIRA)

unread,
Dec 30, 2019, 1:51:04 PM12/30/19
to puppe...@googlegroups.com
Melissa Stone assigned an issue to Melissa Stone
Change By: Melissa Stone
Assignee: Melissa Stone

Josh Cooper (JIRA)

unread,
Jan 7, 2020, 10:10:04 AM1/7/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.12.0

Josh Cooper (JIRA)

unread,
Jan 7, 2020, 10:10:04 AM1/7/20
to puppe...@googlegroups.com

Melissa Stone (JIRA)

unread,
Jan 7, 2020, 12:29:03 PM1/7/20
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Release Notes Summary: The new HTTP code now has a report service it can use for submitting reports
Release Notes: Enhancement

Josh Cooper (JIRA)

unread,
Jan 8, 2020, 10:42:04 PM1/8/20
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-10038

Passed CI in 605187329a

Josh Cooper (JIRA)

unread,
Jan 9, 2020, 5:35:04 PM1/9/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Enhancement Not Needed
Reply all
Reply to author
Forward
0 new messages