matterhorn_whymper 2.0.4 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWEwZTI0NGZlMjM0OTM4YmQ0Nzg2N2EyNGU5ZjMwNGQ1NWIwNjFiNA==
4
+ YmI2OTkzZjM5ZjExNDIxMDVmM2IxZGE5MDk0YjY2NWQ1MmQwY2MyZQ==
5
5
  data.tar.gz: !binary |-
6
- YWE3NDI3MzJjODlmYjRmYzdiNzZjYjU2ZjE3MDNhZjE3M2Y2NjA4NA==
6
+ MGZlZmMzMWNmNmRkY2EyYmE4ODdiNmJmOGE4NDZhZDdmMDdiZTY3NA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDJhNjdmZjAwZDMyNmY0ZjBkZjdhMjYyYTA5NjcyNWM0ZDVmYmEyNDgxODhl
10
- NzYyMGQ2OTk5ZWQxZTI2YjkwYjRhMzY5YjI2NzA0NDZjZWI4NzcwYTkwNjQ2
11
- OGIwODQ5OWFiYTYzMTVkZTgxYjU4OGMwN2RkYjU5OWU3ODEyNTg=
9
+ OTZlM2U3MDE5NzIyZTQwODNlM2JmNTE5ZTkxYWEwMjNkZTU4MGNmNDY2MDYy
10
+ M2U3Zjk5ZTY3MTBlOGViNzg3NDNjODcxZDI1MzhkNjc3MDIyYWU4ZjI2OGE5
11
+ NTlmMWM5ZTg5MWIzODNlOTc4YTY1Zjg0NTBhNDg1Y2E4ZDZhZjY=
12
12
  data.tar.gz: !binary |-
13
- NGI1YzJlYmI5YWU3N2M1MjkyMzYxOGY0NjhiNTRjMTdkOTE3ZDgzMTI4NzE2
14
- NDhhM2NiMTU0MDRkYjY2ZTQ5YTdmMjdlYmE1OTdhNTJjMDBlNjQ5ZTU2ODFj
15
- ZjdjMWI3NjQwMzVjZTM2OWEwOTAxODU2MjA2NTM1NWYxZjU0Yjg=
13
+ M2RiNjQyMDAzMGIyMjlhZWI5MjA0OGUxOWUyMTQxMjljNzM4NWU3NGU5NGJi
14
+ NWI2MzRkMjQyNDYzMjVmZTU3ZmE1MzQwMzA0YjU3YTdhYjJiMmQyNDM1NGM3
15
+ MjVmNzhjYmMzNmZkNDMyNjJkNmFmZjIyODZlNWQwNTcwZjU3ODc=
@@ -5,6 +5,10 @@ class Matterhorn::Endpoint::Workflow < Matterhorn::Endpoint
5
5
 
6
6
  # -------------------------------------------------------------------------- endpoint methodes ---
7
7
 
8
+ # ------------------------------------------------------------------------------------- create ---
9
+
10
+ # --------------------------------------------------------------------------------------- read ---
11
+
8
12
  def instance(wi_id)
9
13
  wi = nil
10
14
  begin
@@ -22,23 +26,22 @@ class Matterhorn::Endpoint::Workflow < Matterhorn::Endpoint
22
26
  end
23
27
 
24
28
 
25
- def remove(wi_id)
26
- wi_removed = false
29
+ def statistics
30
+ stati = nil
27
31
  begin
28
- split_response http_endpoint_client.delete(
29
- "workflow/remove/#{wi_id}"
32
+ split_response http_endpoint_client.get(
33
+ "workflow/statistics.json"
30
34
  )
31
- wi_removed = true
35
+ stati = JSON.parse(response_body)
32
36
  rescue => ex
33
- exception_handler('remove', ex, {
34
- 404 => "WorkflowInstance[#{wi_id}]: No workflow instance with that identifier exists."
35
- }
36
- )
37
+ exception_handler('statistics', ex, {})
37
38
  end
38
- wi_removed
39
+ stati ? Matterhorn::WorkflowStatistics.new(stati) : nil
39
40
  end
40
41
 
41
42
 
43
+ # ------------------------------------------------------------------------------------- update ---
44
+
42
45
  def resume(wi_id)
43
46
  wi = nil
44
47
  begin
@@ -76,5 +79,24 @@ class Matterhorn::Endpoint::Workflow < Matterhorn::Endpoint
76
79
  wi ? Matterhorn::WorkflowInstance.new(wi) : nil
77
80
  end
78
81
 
82
+
83
+ # ------------------------------------------------------------------------------------- delete ---
84
+
85
+ def remove(wi_id)
86
+ wi_removed = false
87
+ begin
88
+ split_response http_endpoint_client.delete(
89
+ "workflow/remove/#{wi_id}"
90
+ )
91
+ wi_removed = true
92
+ rescue => ex
93
+ exception_handler('remove', ex, {
94
+ 404 => "WorkflowInstance[#{wi_id}]: No workflow instance with that identifier exists."
95
+ }
96
+ )
97
+ end
98
+ wi_removed
99
+ end
100
+
79
101
 
80
102
  end # ------------------------------------------------------- end Matterhorn::Endpoint::Workflow ---
@@ -0,0 +1,27 @@
1
+ # =============================================================== Matterhorn::WorkflowStatistics ===
2
+
3
+ class Matterhorn::WorkflowStatistics
4
+
5
+ attr_reader :instantiated, :running, :paused, :stopped, :finished, :failing, :failed, :total
6
+
7
+ # -------------------------------------------------------------------------- const definitions ---
8
+
9
+
10
+ # ----------------------------------------------------------------------------- initialization ---
11
+
12
+ def initialize(json)
13
+ @instantiated = json['statistics']['instantiated'].to_i
14
+ @running = json['statistics']['running'].to_i
15
+ @paused = json['statistics']['paused'].to_i
16
+ @stopped = json['statistics']['stopped'].to_i
17
+ @finished = json['statistics']['finished'].to_i
18
+ @failing = json['statistics']['failing'].to_i
19
+ @failed = json['statistics']['failed'].to_i
20
+ @total = json['statistics']['total'].to_i
21
+ end
22
+
23
+
24
+ # ----------------------------------------------------------------------------------- methodes ---
25
+
26
+
27
+ end # ------------------------------------------------------- end Matterhorn::WorkflowStatistics ---
@@ -5,7 +5,7 @@ module MatterhornWhymper
5
5
 
6
6
  # -------------------------------------------------------------------------- const definitions ---
7
7
 
8
- VERSION = "2.0.4"
8
+ VERSION = "2.1.0"
9
9
 
10
10
 
11
11
  end # -------------------------------------------------------------------- end MatterhornWhymper ---
@@ -23,6 +23,7 @@ require 'matterhorn/java_properties'
23
23
  require 'matterhorn/media_package'
24
24
  require 'matterhorn/smil'
25
25
  require 'matterhorn/workflow_instance'
26
+ require 'matterhorn/workflow_statistics'
26
27
 
27
28
 
28
29
  # ============================================================================ MatterhornWhymper ===
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matterhorn_whymper
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Fritschi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
11
+ date: 2015-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post
@@ -160,6 +160,7 @@ files:
160
160
  - lib/matterhorn/media_package.rb
161
161
  - lib/matterhorn/smil.rb
162
162
  - lib/matterhorn/workflow_instance.rb
163
+ - lib/matterhorn/workflow_statistics.rb
163
164
  - lib/matterhorn_whymper.rb
164
165
  - lib/matterhorn_whymper/version.rb
165
166
  - matterhorn_whymper.gemspec