puppetdb-ruby 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 282cff2e55783d3ee94a952746316ba91305e2a5
4
- data.tar.gz: 2b6a524d1dc2c13d0525082e326052b3af1f275b
3
+ metadata.gz: a3898f94fefbb12e3993f70e730dcc494e22ad9a
4
+ data.tar.gz: 2bab42b03c71a1a32d9a81314c114a6d613a627d
5
5
  SHA512:
6
- metadata.gz: bbac872da30cebe0f3f00e8262d8bb4451774b46cf0e66ef2c0934e4f8135446d296fc2b7a63647e07fd49adc3d3e7974f6c412c3eefed9601d32a293289faff
7
- data.tar.gz: 2f6088df22bb0c7bf550d4f0eb1f6ce85b3d64893c1a8ae93a15031d3c1c471624b27f273fde1cb33596f7cdcb1249ebfa7e057395f84f729eec3f7cc956af9f
6
+ metadata.gz: acdd51bb4af22f7819313810be9bfbcfcf78c3fdd1b76ed429a1b645b3b842816806eb697ecb396cdb6075af5059a24f3f5327a530ec3dd4d668a13db277751d
7
+ data.tar.gz: f5156929891972ece420537131e3ca2e43e41d8de3f9e4daf9ec0e5b3eccb4a82ba24ed443cbc8608bdb4c5eee080e22119a154413a394536ae82418e237f75f
@@ -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.0.0](https://github.com/voxpupuli/puppetdb-ruby/tree/v1.0.0) (2017-08-01)
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.
@@ -78,10 +78,15 @@ module PuppetDB
78
78
  end
79
79
 
80
80
  def request(endpoint, query, opts = {})
81
- query = PuppetDB::Query.maybe_promote(query)
82
- json_query = query.build
83
-
84
- path = "/pdb/query/v#{@query_api_version}/" + endpoint
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|
@@ -1,3 +1,3 @@
1
1
  module PuppetDB
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
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.0.0
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-02 00:00:00.000000000 Z
13
+ date: 2017-08-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty