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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGJjM2Q5NTZhNzA3YTViZDVlYzA1NjJmOGY4ZTJiYmU3Y2Q2MzE3Mg==
4
+ ZjE5MGRkNTE0ZGEwZmUyMmE2NzhkMDIwZDJjNWUwMzEwNDFmZThiZA==
5
5
  data.tar.gz: !binary |-
6
- NzI0Mzk3OWE4NTY1YmFhNzg2OGUxMjNkZDM5ZDQ5Yjk5ZWZjOWVjYQ==
6
+ ZTY3YmM5ZWY5YzhiZGMwNDRiN2I2YjI5ZDI2MzMwMzJhYzVmMGQyZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTQ3M2YyNDc1YWMwNmMyNWQ3YzJjMWRhY2Y4ZGVjZTNjZTE3NDAxOWJjMTE4
10
- MjMxNjUyYjllYjE5ZGRiNTQzODVlMjFkNTZkMmU0ODA0ZmY2ZTE1MDZmMzQ0
11
- ZTdjOTkwMGU0YjNmNmRlZGJkYjJmODgwZmY0YTE3N2Q0MjMzYmQ=
9
+ ZmM3ZWQyNzZkM2M0ZGYwMmJkMTEyNzdjMDAyYWQ2MjNkYjJmZDVmYjlkMGE3
10
+ YmU5YTg2Yjc5NzZkMzhmNDVkMDBhNTE1OWU3ZTFmMjljNTFiZTJmY2E5NWM4
11
+ NDk0MWZkMTE0MDFkZTJlNGVkZDFiY2Q0MmFhMjQ4ZjcxZjUzM2M=
12
12
  data.tar.gz: !binary |-
13
- NzhhZTZhZjBkZTUwNDAzYWJmNzg4OTQxMzJlNmEwZWU5NGQzYzVmZDgyOTQz
14
- MDY5NTAyNzE1ZWM4NTFhYTA2NGE3ODhmNTAwOWVmODdjNTI4MWM0YTUyZDQ1
15
- YWI3MzViZDdmNWRhNThkZTU4YzFkOTQ4MmIwM2IxYTRmZDUxZGY=
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
@@ -1,5 +1,5 @@
1
1
  module Proxy
2
2
  class Dynflow
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  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.3
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-08-14 00:00:00.000000000 Z
11
+ date: 2015-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler