puppetdb-ruby 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -1
- data/README.md +20 -1
- data/lib/puppetdb/client.rb +9 -4
- data/lib/puppetdb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3898f94fefbb12e3993f70e730dcc494e22ad9a
|
4
|
+
data.tar.gz: 2bab42b03c71a1a32d9a81314c114a6d613a627d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acdd51bb4af22f7819313810be9bfbcfcf78c3fdd1b76ed429a1b645b3b842816806eb697ecb396cdb6075af5059a24f3f5327a530ec3dd4d668a13db277751d
|
7
|
+
data.tar.gz: f5156929891972ece420537131e3ca2e43e41d8de3f9e4daf9ec0e5b3eccb4a82ba24ed443cbc8608bdb4c5eee080e22119a154413a394536ae82418e237f75f
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,20 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
Each new release typically also includes the latest modulesync defaults.
|
5
5
|
These should not impact the functionality of the module.
|
6
6
|
|
7
|
-
## [v1.
|
7
|
+
## [v1.1.0](https://github.com/voxpupuli/puppetdb-ruby/tree/v1.1.0) (2017-08-17)
|
8
|
+
[Full Changelog](https://github.com/voxpupuli/puppetdb-ruby/compare/1.0.0...v1.1.0)
|
9
|
+
|
10
|
+
**Closed issues:**
|
11
|
+
|
12
|
+
- Improve documentation [\#22](https://github.com/voxpupuli/puppetdb-ruby/issues/22)
|
13
|
+
- support for PQL in PuppetDB::Query [\#16](https://github.com/voxpupuli/puppetdb-ruby/issues/16)
|
14
|
+
- Any plans to revive this project? [\#12](https://github.com/voxpupuli/puppetdb-ruby/issues/12)
|
15
|
+
|
16
|
+
**Merged pull requests:**
|
17
|
+
|
18
|
+
- Add PQL support [\#28](https://github.com/voxpupuli/puppetdb-ruby/pull/28) ([raphink](https://github.com/raphink))
|
19
|
+
|
20
|
+
## [1.0.0](https://github.com/voxpupuli/puppetdb-ruby/tree/1.0.0) (2017-08-02)
|
8
21
|
**Implemented enhancements:**
|
9
22
|
|
10
23
|
- Preparatory cleanup for refactor [\#21](https://github.com/voxpupuli/puppetdb-ruby/pull/21) ([dhollinger](https://github.com/dhollinger))
|
@@ -20,6 +33,10 @@ These should not impact the functionality of the module.
|
|
20
33
|
|
21
34
|
**Merged pull requests:**
|
22
35
|
|
36
|
+
- rename gemspec to fix deploy [\#27](https://github.com/voxpupuli/puppetdb-ruby/pull/27) ([dhollinger](https://github.com/dhollinger))
|
37
|
+
- Remove branches restriction in travis.yml [\#26](https://github.com/voxpupuli/puppetdb-ruby/pull/26) ([dhollinger](https://github.com/dhollinger))
|
38
|
+
- Add rubygems deploy key [\#25](https://github.com/voxpupuli/puppetdb-ruby/pull/25) ([dhollinger](https://github.com/dhollinger))
|
39
|
+
- Release 1.0.0 [\#24](https://github.com/voxpupuli/puppetdb-ruby/pull/24) ([dhollinger](https://github.com/dhollinger))
|
23
40
|
- Update Docs for Release 1.0.0 [\#23](https://github.com/voxpupuli/puppetdb-ruby/pull/23) ([dhollinger](https://github.com/dhollinger))
|
24
41
|
- Add command API support [\#19](https://github.com/voxpupuli/puppetdb-ruby/pull/19) ([bekbulatov](https://github.com/bekbulatov))
|
25
42
|
- \(maint\) Transfer ownership to Vox Pupuli [\#18](https://github.com/voxpupuli/puppetdb-ruby/pull/18) ([rlinehan](https://github.com/rlinehan))
|
data/README.md
CHANGED
@@ -50,7 +50,7 @@ client = PuppetDB::Client.new({
|
|
50
50
|
|
51
51
|
The Query Feature allows the user to request data from PuppetDB using the Query endpoints. It defaults to the latest version of the Query Endpoint.
|
52
52
|
|
53
|
-
Currently, `puppetdb-ruby` only supports the [AST Query Language](https://docs.puppet.com/puppetdb/5.0/api/query/v4/ast.html).
|
53
|
+
Currently, `puppetdb-ruby` only supports the [AST Query Language](https://docs.puppet.com/puppetdb/5.0/api/query/v4/ast.html).
|
54
54
|
|
55
55
|
Support for the [PQL Query Language](https://docs.puppet.com/puppetdb/5.0/api/query/tutorial-pql.html) is planned for a future release.
|
56
56
|
|
@@ -80,6 +80,25 @@ client.request uptime.and(debian.or(redhat))
|
|
80
80
|
|
81
81
|
See the [PuppetDB API Docs](https://docs.puppet.com/puppetdb/5.0/api/index.html) for more.
|
82
82
|
|
83
|
+
|
84
|
+
#### PQL Queries usage
|
85
|
+
|
86
|
+
PQL queries are supported by using the empty endpoint.
|
87
|
+
|
88
|
+
Example:
|
89
|
+
``` ruby
|
90
|
+
response = client.request(
|
91
|
+
'',
|
92
|
+
'resources[title] { nodes { deactivated is null } }',
|
93
|
+
{:limit => 10}
|
94
|
+
)
|
95
|
+
|
96
|
+
resources = response.data
|
97
|
+
```
|
98
|
+
|
99
|
+
See the [PuppetDB API Docs](https://docs.puppet.com/puppetdb/5.0/api/query/v4/pql.html) for more on PQL queries.
|
100
|
+
|
101
|
+
|
83
102
|
#### Command API Usage
|
84
103
|
|
85
104
|
The Command Feature allows the user to execute REST Commands against the PuppetDB Command API Endpoints. It defaults to the latest version of the Command Endpoint.
|
data/lib/puppetdb/client.rb
CHANGED
@@ -78,10 +78,15 @@ module PuppetDB
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def request(endpoint, query, opts = {})
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
81
|
+
path = "/pdb/query/v#{@query_api_version}"
|
82
|
+
if endpoint == ''
|
83
|
+
# PQL
|
84
|
+
json_query = query
|
85
|
+
else
|
86
|
+
path += "/#{endpoint}"
|
87
|
+
query = PuppetDB::Query.maybe_promote(query)
|
88
|
+
json_query = query.build
|
89
|
+
end
|
85
90
|
|
86
91
|
filtered_opts = { 'query' => json_query }
|
87
92
|
opts.each do |k, v|
|
data/lib/puppetdb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetdb-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-08-
|
13
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|