orchestrator_client 0.2.3 → 0.2.4
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/lib/orchestrator_client.rb +7 -2
- data/lib/orchestrator_client/command.rb +19 -4
- data/lib/orchestrator_client/job.rb +2 -0
- data/lib/orchestrator_client/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: 10b4d0be20618df374b951dd50189a1fed234c74
|
4
|
+
data.tar.gz: 87edcc886de8c9123e1b2c46eab07141f7488613
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c60ec895186ff924ba2e40e934859258b150026eebce6490b08407f529d8b9158cf5ff0aeef01eed144c178d2c24298bbbc3d17bada0aee09e4fb633c69b2a79
|
7
|
+
data.tar.gz: 85668aafc17238328ab3021802ca680e3a1f81d222b99372b233dbee1bb39f85525a506ae9590888a589baaaf48f8474e51f5586842b6a03d0a6e4372cd48e21
|
data/lib/orchestrator_client.rb
CHANGED
@@ -55,7 +55,7 @@ class OrchestratorClient
|
|
55
55
|
req.body = body.to_json
|
56
56
|
res = https.request(req)
|
57
57
|
|
58
|
-
|
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
|
-
|
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
|
7
|
+
def deploy(options = {})
|
8
8
|
raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash
|
9
|
-
@https.post("command/
|
9
|
+
@https.post("command/deploy", options)
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def plan_start(options = {})
|
13
13
|
raise ArgumentError, 'Must pass options as a hash' unless options.is_a? Hash
|
14
|
-
@https.post("command/
|
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
|
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
|
+
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-
|
11
|
+
date: 2018-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: info@puppetlabs.com
|