-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
More info available for the report page? #92
Comments
I'd have to take a deeper look at API v4, there's also some stuff wrt inventory (list of all resources) that we can have a look at. I'm putting v4 off until after Puppetconf though. If you happen to be around, find me and we can talk some more on this over a drink. |
Sounds good - yup, I'll be there. |
Excellent! If you're curious about the internals: http://sched.co/1kR7z5K. |
Oh, nice, I hadn't seen that on the schedule! I'll plan on it :) |
#176 does list a report's log and metric information on the reports page. Please stay tuned for the 0.1.0 release. |
Report logs and metrics displayed on report details page in 709480a |
* pypuppetdb/QueryBuilder.py: Adding initial work on an OOP query builder. Part of voxpupuli/pypuppetdb#77 Currently this only contains all available binary operators as listed in https://docs.puppet.com/puppetdb/4.1/api/query/v4/ast.html#binary-operators. Further work will include boolean and projection operators. * pypuppetdb/QueryBuilder.py: Quoting only string type fields. Some queries, like those querying resource parameter values, require the field to be an array. For example: '["=", ["parameter", "ensure"], "present"]' Adding test cases for this development. * pypuppetdb: Adding the first BooleanOperator object, AndOperator This object will build an AND PuppetDB query, as per https://docs.puppet.com/puppetdb/4.1/api/query/v4/ast.html#boolean-operators. PuppetDB will only return results from this query only if it matches ALL included query criteria. Including test cases for the AndOperator object. * pypuppetdb/QueryBuilder.py: Adding OrOperator and NotOperator objects. The OrOperator object is programmatically identical to the AndOperator. The only difference the NotOperator has is that it only allows a single operation, this enforces the PuppetDB funcionality. * pypuppetdb/QueryBuilder.py: Adding ExtractOperator object. Following the documentation available https://docs.puppet.com/puppetdb/4.1/api/query/v4/ast.html#extract This object allows users to create, as the name suggests, an extraction query to return the number of fields returned in the PuppetDB response. This is done by passing a string or an array of strings to the add_field(), should add this to the constructor too. Adding an option query can be done through the add_query() fuction. A group_by, https://docs.puppet.com/puppetdb/4.1/api/query/v4/ast.html#groupby, can be added through add_group_by(). The values in this variable will always be appended to the end of the ExtractOperator output. Adding test cases to cover the new code. * pypuppetdb/QueryBuilder.py: Adding repr() and unicode() support for ExtractOperator Updating test cases to include new code. * pypuppetdb/QueryBuilder.py: Adding FunctionOperator object This object allows an aggregate function to be performed on the result on an ExtractOperator object (in the fields and group_by clauses only) Adding test cases for these additions, some of the tests are used in https://github.com/puppetlabs/puppetdb/blob/master/test/puppetlabs/puppetdb/http/reports_test.clj#L110 * pypuppetdb/QueryBuilder.py: Adding small updates and documentation. Replacing string concatenation with string formatting in BinaryOperator constructor. Replacing all ValueErrors with APIError * docs/api.rst: Adding brief description of the Query Builder and its objects. * pypuppetdb/api.py: Integrating the QueryBuilder classes into api * test_querybuilder.py: Fixing Unicode keyword error. Also removing a redundant set of parenthesis. * tests/test_querybuilder.py: Adding a missing blank line before the first test class * docs/api.rst: Including the strings used to import and use QueryBuilder * pypuppetdb/QueryBuilder.py: Fixing bugs after first test against a real PuppetDB The code was interpreting the type of the field attribute as a unicode in the BinaryOperator constructor, have to check for that as well as a string The Python boolean value, True or False, are not liked by PuppetDB, they have to be lowercase. * pypuppetdb/api.py: Removing the string casting for the query parameter in _query Python again interpreted this as a unicode type with the str() wrapper. Removing it removed the bug. * pypuppetdb/types.py: Removing all __query_scope variables for QueryBuilder objects Removing additional private class variables for QueryBuilder objects, currently all EqualsOperator objects, to replace the __query_scope variables present in the `Reports()` and `Node()` objects. * pypuppetdb/QueryBuilder.py: Quoting datetime.datetime objects in BinaryOperator constructor Updating test cases to include datetime object support. * pypuppetdb/QueryBuilder.py: Updating doc string to include examples. * pypuppetdb/QueryBuilder.py: NotOperator() objects do not allow multi-element lists in add() Users who try to add a list of operators in the add() function now receive an APIError. This further enhances the restriction that this query only accepts a single query string. * tests/test_querybuilder.py: Fixing Python 3.3 tests. Python 3.3 tests failed because of the zero-padded month values in the datetime constructor. Replacing the 06 with 6 to fix tests, string outputs remain the same.
The last thing that's keeping us from turning off Puppet Dashboard and just using PuppetBoard is the extra detail that's provided in the Dashboard display of a report:
Are my guesses at API availability for these correct? We'd like to avoid losing useful info when we put Dashboard out to pasture, so adding any of these would be handy for us. Great work on PuppetBoard by the way! 👍
The text was updated successfully, but these errors were encountered: