smart_proxy_dynflow 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of smart_proxy_dynflow might be problematic. Click here for more details.
- checksums.yaml +8 -8
- data/lib/smart_proxy_dynflow/api.rb +8 -0
- data/lib/smart_proxy_dynflow/helpers.rb +15 -0
- data/lib/smart_proxy_dynflow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjE5MGRkNTE0ZGEwZmUyMmE2NzhkMDIwZDJjNWUwMzEwNDFmZThiZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTY3YmM5ZWY5YzhiZGMwNDRiN2I2YjI5ZDI2MzMwMzJhYzVmMGQyZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmM3ZWQyNzZkM2M0ZGYwMmJkMTEyNzdjMDAyYWQ2MjNkYjJmZDVmYjlkMGE3
|
10
|
+
YmU5YTg2Yjc5NzZkMzhmNDVkMDBhNTE1OWU3ZTFmMjljNTFiZTJmY2E5NWM4
|
11
|
+
NDk0MWZkMTE0MDFkZTJlNGVkZDFiY2Q0MmFhMjQ4ZjcxZjUzM2M=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTVjNDkxNDUwMDY1Njk4MmUxMTdkZWYzNzA4YmYxNWRmNTczM2MzNjliOWE3
|
14
|
+
MjJlZGQ0ZWJjNzBjYmEwZGJlNmE5NTZjNjVjMmUwYzVmZmZhNDJkMTY2YjU0
|
15
|
+
ZmM5YTcyYjgwMmFhYWIyYzNjNTFkODhlMGY2NTQ5ZmJhMDQ3NmE=
|
@@ -19,6 +19,14 @@ module Proxy
|
|
19
19
|
post "/tasks/:task_id/cancel" do |task_id|
|
20
20
|
cancel_task(task_id).to_json
|
21
21
|
end
|
22
|
+
|
23
|
+
get "/tasks/:task_id/status" do |task_id|
|
24
|
+
task_status(task_id).to_json
|
25
|
+
end
|
26
|
+
|
27
|
+
get "/tasks/count" do
|
28
|
+
tasks_count(params['state']).to_json
|
29
|
+
end
|
22
30
|
end
|
23
31
|
end
|
24
32
|
end
|
@@ -15,6 +15,21 @@ module Proxy
|
|
15
15
|
cancel_events = execution_plan.cancel
|
16
16
|
{ :task_id => task_id, :canceled_steps_count => cancel_events.size }
|
17
17
|
end
|
18
|
+
|
19
|
+
def task_status(task_id)
|
20
|
+
ep = world.persistence.load_execution_plan(task_id)
|
21
|
+
ep.to_hash.merge(:actions => ep.actions.map(&:to_hash))
|
22
|
+
rescue KeyError => e
|
23
|
+
status 404
|
24
|
+
{}
|
25
|
+
end
|
26
|
+
|
27
|
+
def tasks_count(state)
|
28
|
+
state ||= 'all'
|
29
|
+
filter = state != 'all' ? { :filters => { :state => [state] } } : {}
|
30
|
+
tasks = world.persistence.find_execution_plans(filter)
|
31
|
+
{ :count => tasks.count, :state => state }
|
32
|
+
end
|
18
33
|
end
|
19
34
|
end
|
20
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_proxy_dynflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|