Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PDB-1072) Add endpoint to mirror report command structure. #1193

Merged

Conversation

wkalt
Copy link
Contributor

@wkalt wkalt commented Dec 26, 2014

This commit adds an endpoint called event-reports, the return value of which
can be easily munged for resubmission as a report. In an HA context, this will
allow us to transfer reports from one database to another over HTTP without
needing a second query for the events associated with a report.

@wkalt
Copy link
Contributor Author

wkalt commented Dec 26, 2014

open to suggestions on renaming this endpoint

hash, puppet_version, receive_time, report_format,
start_time, end_time, transaction_uuid, status, environment,
configuration_version, certname FROM (%s) distinct_names %s%s%s) %s"
sql sql inner-order-by limit-clause offset-clause order-by-clause)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to think about whether we have better options than this pattern. The issue is limit/offset on API responses that comprise multiple rows.

@pljenkinsro
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/321/

@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch from e8bf0b5 to 019ec8b Compare December 26, 2014 23:12
@pljenkinsro
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/322/

@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch 2 times, most recently from 2518125 to 6dedcea Compare December 27, 2014 01:16
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/324/

@pljenkinsro
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/325/

[puppetlabs.puppetdb.middleware :refer [verify-accepts-json validate-query-params
wrap-with-paging-options]]
[puppetlabs.puppetdb.jdbc :as jdbc]
[puppetlabs.puppetdb.http :as http]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all these dependencies necessary?

@kbarber
Copy link
Contributor

kbarber commented Jan 5, 2015

So here is the thing, this new endpoint looks almost exactly like /reports ... but without the downstream information like events ... I'm wondering if we should just call this /reports instead, and let people use the extract field selector capability if they want the old report format? That would save us from having to create a brand new end-point.

@wkalt
Copy link
Contributor Author

wkalt commented Jan 5, 2015

that's fine with me in concept, but we'll have to extend extract to cover non-queryable fields, since the event-reports field of this endpoint is not queryable. Not sure what that will take; I'll give it some thought.

@kbarber kbarber added the work in progress (...and please don't merge) label Jan 5, 2015
@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch from 6dedcea to fd3602d Compare January 5, 2015 22:22
@wkalt
Copy link
Contributor Author

wkalt commented Jan 5, 2015

actually, that's not going to be an issue in the slightest. Happy to take this route.

@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/346/

@puppetcla
Copy link

CLA signed by all contributors.

@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch 2 times, most recently from 57972b7 to f8785fe Compare January 7, 2015 02:26
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/360/

@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch 3 times, most recently from fe7a9aa to 1f15228 Compare January 7, 2015 02:34
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/361/

@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/362/

@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch from 1f15228 to 969f545 Compare January 7, 2015 04:35
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/363/

@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch from 969f545 to 85acb27 Compare January 7, 2015 04:47
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/364/

@wkalt
Copy link
Contributor Author

wkalt commented Jan 7, 2015

@pljenkinsro retest this please

@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/365/

@kbarber
Copy link
Contributor

kbarber commented Jan 7, 2015

@pljenkinsro retest this please

@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/367/

@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch from 85acb27 to e1479b9 Compare January 7, 2015 19:28
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/373/

@wkalt
Copy link
Contributor Author

wkalt commented Jan 7, 2015

@pljenkinsro retest this please

@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/374/

@wkalt
Copy link
Contributor Author

wkalt commented Jan 7, 2015

@pljenkinsro retest this please

@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/375/

@wkalt
Copy link
Contributor Author

wkalt commented Jan 7, 2015

@pljenkinsro retest this please

@pljenkinsro
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/376/

@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch from e1479b9 to 3ffb104 Compare January 7, 2015 22:10
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/378/

@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch from 3ffb104 to 973e08f Compare January 7, 2015 22:32
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/379/

@wkalt wkalt removed the work in progress (...and please don't merge) label Jan 7, 2015
@wkalt
Copy link
Contributor Author

wkalt commented Jan 7, 2015

@pljenkinsro retest this please

@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/381/


(defn remove-receive-times
(defn treat-reports-response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you come up with a more descriptive function name here? Maybe munge-for-compare, or prep-for-compare or something like that?

This commit changes the /v4/reports endpoint to mirror the store-report command
structure -- this amounts to an additional field containing resource-events.
The upshot of this is that the api response can be easily munged for resubmission
as a report. In an HA context, this will allow us to transfer reports from one
database to another over HTTP without needing a second query for the events
associated with a report.
@wkalt wkalt force-pushed the ticket/master/pdb-1072-symmetric-reports branch from 973e08f to 5b015a2 Compare January 8, 2015 15:53
@pljenkinsro
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/383/

@wkalt
Copy link
Contributor Author

wkalt commented Jan 8, 2015

@pljenkinsro retest this please

@pljenkinsro
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/384/

@senior
Copy link
Contributor

senior commented Jan 8, 2015

+1 from me

senior added a commit that referenced this pull request Jan 8, 2015
…reports

(PDB-1072) Add endpoint to mirror report command structure.
@senior senior merged commit 09cc3ef into puppetlabs:master Jan 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants