orchestrator_client 0.2.4 → 0.2.5

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: 10b4d0be20618df374b951dd50189a1fed234c74
4
- data.tar.gz: 87edcc886de8c9123e1b2c46eab07141f7488613
3
+ metadata.gz: 6276e6384a781c4640e4aaeb9032d5c1bba196dc
4
+ data.tar.gz: 4cfc8f138e1507977bba8e8544b41d620aeb5b40
5
5
  SHA512:
6
- metadata.gz: c60ec895186ff924ba2e40e934859258b150026eebce6490b08407f529d8b9158cf5ff0aeef01eed144c178d2c24298bbbc3d17bada0aee09e4fb633c69b2a79
7
- data.tar.gz: 85668aafc17238328ab3021802ca680e3a1f81d222b99372b233dbee1bb39f85525a506ae9590888a589baaaf48f8474e51f5586842b6a03d0a6e4372cd48e21
6
+ metadata.gz: 5e1e10e259a9892638c6aa86ee4720ab8e6da5ddce2ed73bb825921168fb9e5d99fe6790525f9dc9210d3ae1608ee0673bc71830b3863f044b0049ec4c459c46
7
+ data.tar.gz: fdc8ee77b63aa420cc87c775c9d0f853d1ed68807c358d6f9cb0fb63f0fa2250da3bfe86f8480c83c5320769927dea0fc4cbf68d0c15aa6c7a013c37f8980243
data/README.md CHANGED
@@ -22,9 +22,10 @@ expected to be at `~/.puppetlabs/token` which is the default location used by
22
22
  ### initialization Settings
23
23
 
24
24
  * `service-url` **[required]** - Base URL for the location of the Orchestrator API service
25
- * `ca_cert` **[required]** - Path to the CA certificate file needed to verify the SSL connection to the API.
26
- * `token_path`- Path to a file with the RBAC token in it (defaults to `~/.puppetlabs/token`)
25
+ * `cacert` **[required]** - Path to the CA certificate file needed to verify the SSL connection to the API.
26
+ * `token-file`- Path to a file with the RBAC token in it (defaults to `~/.puppetlabs/token`)
27
27
  * `token` - Pass directly the RBAC token, if specified the token will be used instead of a token from file.
28
+ * `User-Agent`- Set `User-Agent` header for HTTP requests. Defaults to `OrchestratorRubyClient/[VERSION]`
28
29
 
29
30
  ### Example
30
31
 
@@ -36,7 +37,7 @@ require 'orchestrator_client'
36
37
 
37
38
  client = OrchestratorClient.new({
38
39
  'service-url' => 'https://orchestrator.example.lan:8143/orchestrator/v1',
39
- 'ca_cert' => '/path/to/cert'
40
+ 'cacert' => '/path/to/cert'
40
41
  })
41
42
 
42
43
  ## Access endpoints through the client object
@@ -35,6 +35,7 @@ class OrchestratorClient
35
35
  https = create_http(uri)
36
36
  req = Net::HTTP::Get.new(uri)
37
37
  req['Content-Type'] = "application/json"
38
+ req['User-Agent'] = @config['User-Agent']
38
39
  req.add_field('X-Authentication', @config.token)
39
40
  res = https.request(req)
40
41
 
@@ -51,6 +52,7 @@ class OrchestratorClient
51
52
 
52
53
  req = Net::HTTP::Post.new(uri)
53
54
  req['Content-Type'] = "application/json"
55
+ req['User-Agent'] = @config['User-Agent']
54
56
  req.add_field('X-Authentication', @config.token)
55
57
  req.body = body.to_json
56
58
  res = https.request(req)
@@ -34,6 +34,7 @@ class OrchestratorClient::Config
34
34
  def defaults
35
35
  { 'cacert' => cacert,
36
36
  'token-file' => File.join(user_root, 'token'),
37
+ 'User-Agent' => "OrchestratorRubyClient/#{OrchestratorClient::VERSION}"
37
38
  }
38
39
  end
39
40
 
@@ -1,3 +1,3 @@
1
1
  class OrchestratorClient
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orchestrator_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-18 00:00:00.000000000 Z
11
+ date: 2018-05-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: info@puppetlabs.com