orchestrator_client 0.2.3 → 0.2.4

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: e125b670d73a1d5b36e3e76116e5efbc18032689
4
- data.tar.gz: c6f9a1f1b9446392ecb09063b4ff45058064618d
3
+ metadata.gz: 10b4d0be20618df374b951dd50189a1fed234c74
4
+ data.tar.gz: 87edcc886de8c9123e1b2c46eab07141f7488613
5
5
  SHA512:
6
- metadata.gz: 17453772de464fd1ff1a2fb7b420d00a8092ccd6d4597b7db2bb1e7c4b425653a31fe9cb08b9dcd862eed07db9b6dce5fb02cf090e9fe934ffaab6504cc674af
7
- data.tar.gz: 24ff1604ae222e4e1532ee5b06da095c0b6c9084f0ab0214bae1aed4772c6b5cee97173c0d481a20bbe31a5d7f43e27faf2c391ea902c3d20c14c3e59271d459
6
+ metadata.gz: c60ec895186ff924ba2e40e934859258b150026eebce6490b08407f529d8b9158cf5ff0aeef01eed144c178d2c24298bbbc3d17bada0aee09e4fb633c69b2a79
7
+ data.tar.gz: 85668aafc17238328ab3021802ca680e3a1f81d222b99372b233dbee1bb39f85525a506ae9590888a589baaaf48f8474e51f5586842b6a03d0a6e4372cd48e21
@@ -55,7 +55,7 @@ class OrchestratorClient
55
55
  req.body = body.to_json
56
56
  res = https.request(req)
57
57
 
58
- if res.code != "202"
58
+ unless Set.new(["202", "200"]).include? res.code
59
59
  raise OrchestratorClient::ApiError.make_error_from_response(res)
60
60
  end
61
61
 
@@ -75,7 +75,12 @@ class OrchestratorClient
75
75
  end
76
76
 
77
77
  def run_task(options)
78
- job = OrchestratorClient::Job.new(self, options, :task)
78
+ if options[:plan_job] || options['plan_job']
79
+ type = :plan_task
80
+ else
81
+ type = :task
82
+ end
83
+ job = OrchestratorClient::Job.new(self, options, type)
79
84
  job.start
80
85
  job.wait
81
86
  job.nodes['items']
@@ -4,18 +4,33 @@ class OrchestratorClient::Command
4
4
  @https = https
5
5
  end
6
6
 
7
- def task(options = {})
7
+ def deploy(options = {})
8
8
  raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash
9
- @https.post("command/task", options)
9
+ @https.post("command/deploy", options)
10
10
  end
11
11
 
12
- def deploy(options = {})
12
+ def plan_start(options = {})
13
13
  raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash
14
- @https.post("command/deploy", options)
14
+ @https.post("command/plan_start", options)
15
+ end
16
+
17
+ def plan_finish(options = {})
18
+ raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash
19
+ @https.post("command/plan_finish", options)
20
+ end
21
+
22
+ def plan_task(options = {})
23
+ raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash
24
+ @https.post("command/plan_task", options)
15
25
  end
16
26
 
17
27
  def stop(job_number)
18
28
  data = {"job" => "#{job_number}"}
19
29
  @https.post("command/stop",data)
20
30
  end
31
+
32
+ def task(options = {})
33
+ raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash
34
+ @https.post("command/task", options)
35
+ end
21
36
  end
@@ -26,6 +26,8 @@ class OrchestratorClient::Job
26
26
  result = @client.command.deploy(options)
27
27
  when :task
28
28
  result = @client.command.task(options)
29
+ when :plan_task
30
+ result = @client.command.plan_task(options)
29
31
  end
30
32
 
31
33
  @job_name = result['job']['name']
@@ -1,3 +1,3 @@
1
1
  class OrchestratorClient
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.4'.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.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-23 00:00:00.000000000 Z
11
+ date: 2018-04-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: info@puppetlabs.com