Package: pypuppetdb
pypuppetdbThis library is a thin wrapper around the REST API providing some
convenience functions and objects to request and hold data from
PuppetDB.RequirementsPuppetDB 5.2 or newerPython 3.7-3.11(For support of the older PuppetDB or Python versions please check previous library version.)InstallationYou can install this package from PyPI with:pipinstallpypuppetdbDocumentationTheuser guide, API reference and a developer guide is available on Read the Docs.Getting HelpFor bug reports you can file anissue. If you need
help with something feel free to pop by #voxpupuli or the #puppetboard onFreenodeorVox Pupuli on Slack.ContributingPlease see thecontribution guide here.LicenseThis project is licensed under theApache v2.0 License.ChangelogAll notable changes to this project will be documented in this file.3.2.0(2023-10-08)Full ChangelogMerged pull requests:CI: Run on PRs and merges#252(bastelfreak)purge not required empty newlines#242(bastelfreak)add dummy CI job we can depend on#241(bastelfreak)add dependabot config#240(bastelfreak)Update sphinx requirement from <6.0,>=4.3 to >=4.3,<8.0#239(dependabot[bot])Update urllib3 requirement from <2.0,>=1.26 to >=1.26,<3.0#238(dependabot[bot])Modernize the code#235(gdubicki)3.1.0(2022-10-27)Confirm support for Python 3.11 (final).3.0.0This is a maintenance release.The major version is bumped because of:dropped support for PuppetDBs < 5.2.0 (Puppet 4 has reached its end-of-life in October 2018),dropped support for Python 3.6 (end-of-life in December 2021),the requiredRequestsversion bumped to the current latest.2.5.2Remove harmful terminology, followingthe Puppetlabs components name changes(#216)Use built-in unittest.mock instead of mock (#228)Build and test dependencies updates.Thanks to the following contributors of this release:@pgajdos.2.5.1Fix TypeError exception thrown byBaseAPI._query()when using debug logging.Thanks to Ben Roberts for his contribution!2.5.0Python 3.10 added as a supported version
(#213)2.4.0Added PQL support withpql()method
(PR#201,
fixes#167)Added ability to specify additional queries when usingNode.facts()(#127)Improve the documentation (even more ;))
(PR#206,
fixes#143and#129)Fixed creatingEdgeobjects
(#202)Python 3.9 added as a supported version
(#203)2.3.0Added support forwithstatement
(#185)Added explicitdisconnect()method
(#185)Improved the documentation onRead the Docsand in the project's README
(#190)2.2.0Loosen requirements and drop six2.1.0Bugfix: Fixedmetric()function to
query the new v2 endpoint based on Jolokia
(https://jolokia.org/reference/html/protocol.html)Added a new parametermetric_api_versionto theBaseAPI()constructor that allows
changing the version of themetricAPI being queried. Valid values are'v1'for PuppetDB <= 6.9.0,'v2'for PuppetDB >= 6.9.1 orNonewhich defaults to'v2'.Added a mew parameterversionto themetric()function that allows
overriding the version of the metric API being queried for that
individual call. If nothing is specified it will default to theself.metric_api_versionof the
class, else it expects a value of'v1'or'v2'same as themetric_api_versionclass parameter.Added newpayloadparameter to_query()to allow users to send
arbitrary payloads with their queries (useful for debugging).2.0.0Dropping old python 2.7/3.5 and ensuring 3 latest versions are
supportedAdding mypy + cleanup + further removal of python2 codeBugfix: Httpretty is not used outside tests and breaks install on
newer python versions for some systems1.2.0Add option to get nodes without using event-countsdefine the project status as stablebundle requirements-test.txt in python package1.1.0deduplicate dependencylistQueryBuilder.py: Use native data structures for internal
representationAdd support for the Command API, /pdb/cmd/v1. Added _cmd alongside
_query to minimise changes to original code1.0.0Bump dependenciesQueryBuilder: Added support for FromOperator, arrays and
FromOperatorNew endpoint: statusPOST query in request bodySimplify JSON encoding for POSTUpload and publish is built in to setuptools0.3.3Add support for authentication with tokensFix bug with parsing results from inventory endpoint0.3.2Fixed noop puppet runs reporting unchanged instead of noop.Fixed unreported nodes shown as 'noop' in puppetdb > 4.1.0.Add Inventory API endpoint for PuppetDB 4.2.0.Support for producer field on catalogs, facts and report types.0.3.1Fixed a datetime related bug inpypuppetdb.api.nodes()that caused
all returned nodes to be an unreported status0.3.0New QueryBuilder module allows users to build PuppetDB queries in an
Object-Oriented fashion.Adding support for new fields provided in PuppetDB 4.1.0.0.2.3Removed deprecation ofpypuppetdb.types.Report.events().
Expanded resource events data timestamps are not parseable.Escaping additional path parameters passed to _url() with
urllib.quote0.2.2Fixed URL Encoding found when querying the specific value of a
macaddress fact.Adding support for PuppetDB 4.0.0 information. Namely Adding a
catalog_uuid attribute to the Catalog type object. Adding code_id,
catalog_uuid and cached_catalog_status attributes to the Report
type object.Removing unneeded sudo option from .travis.yml, this gave
unnecessary warning in the test environment.Updating the files under docs/ sohttps://pypuppetdb.readthedocs.org/en/latest/can be updatedDeprecatingpypuppetdb.types.Report.events()in
favour of the new events list variable.Renaming test-requirements.txt to requirements.txt0.2.1Adding a version comparison utility function using examples provided
inhttp://stackoverflow.com/questions/1714027/version-number-comparisonAdding a new variable latest_report_hash to the Node object.
Default None but is given a real value from the field of the same
name in the Nodes endpoint available in PuppetDB 3.2 or higher.Allowing support for 'GET' AND 'POST' requests in the api _query()
function. This will allow clients to send requests to the PuppetDB
that are too long for a GEt request query stringAdding a node field, code_id, to the Catalog object using the field
of the same name from the Catalogs endpoint (currently unused as of
PuppetDB 3.2.2)Adding test cases for new features EXCEPT the GET and POST update.0.2.0Version bump to 0.2.0Adding support for v4 of the Query APIRemoving v2 and v3 api functions as per changelogpypuppetdb will no longer support multiple API versions, removing
the api_version attribute from pypuppetdb.connect()All clients must remove the api_version attribute from the connect
function, or the starting number, since it is no longer supportedRemoving all NotImplemented errors in the function of BaseAPI and
filled them with the real codeNew FeaturesNew endpoints:environments:environments()factsets:factsets()fact-paths:fact_paths()fact-contents:fact_contents()edges:edges()Changes to Types:pypupperdb.types.Reportnow requiresapito be passed as the
second argument, this allows to directly query for any events that
occurred in this report object. This functionality was proposed and
denied because of backward compatability reasons, since the previous
versions are now removed this is no longer a problem.Allpypupperdb.types.*accept the v4 API information as optional
parameters. These parameters are primarily environment related but
may include additional information if provided from that endpoint.Functions appearing insidepypuppetdb.typesthat run queries
against the PuppetDB now accept and passing additional keyword
arguments to the query.Allpypuppetdb.BaseAPIfunctions pass any received keyword
arguments to thepypuppetdb.api.__init__._query()function. This
allows for easy integration with paging functions and parameters.0.1.1Fix the license in oursetup.py. The license shouldn't be longer
than 200 characters. We were including the full license tripping up
tools like bdist_rpm.0.1.0Significant changes have been made in this release. The complete v3 API
is now supported except for query pagination.Most changes are backwards compatible except for a change in the SSL
configuration. The previous behaviour was buggy and slightly misleading
in the names the options took:sslhas been renamed tossl_verifyand now defaults toTrue.Automatically use HTTPS ifssl_keyandssl_certare provided.For additional instructions about getting SSL to work see the Quickstart
in the documentation.DeprecationSupport for API v2 will be dropped in the 0.2.x release series.New featuresThe following features areonlysupported forAPI v3.Thenode()andnodes()function have gained the following options:with_status=Falseunreported=2Whenwith_statusis set toTruean additional query will be made
using theevents-countendpoint scoped to the latest report. This will
result in an additionaleventsandstatuskeys on the node object.statuswill be either ofchanged,unchangedorfaileddepending
on ifeventscontainssuccessesorfailuresor none.By defaultunreportedis set to2. This is only in effect whenwith_statusis set toTrue. It means that if a node hasn't checked
in for two hours it will get astatusofunreportedinstead.New endpoints:events-count:events_count()aggregate-event-counts:aggregate_event_counts()server-time:server_time()version:current_version()catalog:catalog()New types:pypuppetdb.types.Catalogpypuppetdb.types.EdgeChanges to types:pypuppetdb.types.Nodenow has:statusdefaulting toNoneeventsdefaulting toNoneunreported_timedefaulting toNone0.0.4Due to a fairly serious bug 0.0.3 was pulled from PyPi minutes after
release.When a bug was fixed to be able to query for all facts we accidentally
introduced a different bug that caused thefacts()call on a node to
query for all facts because we were resetting the query.Fix a bug wherenode.facts()was causing us to query all facts
because the query to scope our request was being reset.0.0.3With the introduction of PuppetDB 1.5 a new API version, v3, was also
introduced. In that same release the old/experimentalendpoints were
removed, meaning that as of PuppetDB 1.5 with the v2 API you can no
longer get access to reports or events.In light of this the support for the experimental endpoints has been
completely removed from pypuppetdb. As of this release you can only get
to reports and/or events through v3 of the API.This release includes preliminary support for the v3 API. Everything
that could be done with v2 plus the experimental endpoints is now
possible on v3. However, more advanced funtionality has not yet been
implemented. That will be the focus of the next release.Removed dependency on pytz.Fixed the behaviour offacts()andresources(). We can now
correctly query for all facts or resources.Fixed an issue with catalog timestampless nodes.Pass along thetimeoutoption toconnect().Added preliminary PuppetDB API v3 support.Removed support for the experimental endpoints.Theconnect()method defaults to API v3 now.0.0.2Fix a bug insetup.pypreventing successful installation.0.0.1Initial release. Implements most of the v2 API.*This Changelog was automatically generated bygithub_changelog_generator