iibee 0.1.15 → 0.1.17

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: 7596ecc3bf5ac1dbee2989bb735ffe7a92d35884
4
- data.tar.gz: 30cedab6adb3293805c464c344125d5745307972
3
+ metadata.gz: c7bcd1543078075a82af33841eabebbdabc8fbc6
4
+ data.tar.gz: 2b597d97112ba388c0972feb4c4a9f7569a90061
5
5
  SHA512:
6
- metadata.gz: 2a2c3ae327863e07f12760af4ef5c1b67c3bb2e930ed9e61bed0712baaf2210a330d2cfa681a7727757ce26083217ebfdfe583865c6045382ed75e8a69bae0f4
7
- data.tar.gz: 191f8b011fb86442c4b03d9004a1f6d964ebd20eabbbe7a1737cc6ff7e6bcb06200bccaa637d6a3669a0484c14121bc747095e2eba44c26cbbed90d53ccca84b
6
+ metadata.gz: 3c2c1e3f72a8eb45c7d0cd24e8a3176b2d7cf5c5fff5d6bcb2f1d96aed22632087fc180561671c72d130e08b35627e54350c45b1483f2050eef2836448755337
7
+ data.tar.gz: 1f320ad96bff32036267018b9468434d135ff5f517fe44e5a7f26900cad0e9b4859792ad263bc0455555cdef5fbdb9645155adceb2fb901d68e218a431f414d7
@@ -60,5 +60,17 @@ module Iibee
60
60
 
61
61
  return applications
62
62
  end
63
+
64
+ def perform(action)
65
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{executionGroupName}/applications/#{name}?action=#{action}")
66
+ end
67
+
68
+ def start
69
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{executionGroupName}/applications/#{name}?action=start")
70
+ end
71
+
72
+ def stop
73
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{executionGroupName}/applications/#{name}?action=stop")
74
+ end
63
75
  end
64
76
  end
@@ -14,5 +14,9 @@ module Iibee
14
14
  def get(url)
15
15
  @conn.get(url)
16
16
  end
17
+
18
+ def put(url)
19
+ @conn.put(url)
20
+ end
17
21
  end
18
22
  end
@@ -1,4 +1,5 @@
1
1
  require 'oga'
2
+ require 'uri'
2
3
 
3
4
  module Iibee
4
5
  class ExecutionGroup
@@ -59,6 +60,18 @@ module Iibee
59
60
  return egs
60
61
  end
61
62
 
63
+ def perform(action)
64
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{name}?action=#{action}")
65
+ end
66
+
67
+ def start
68
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{name}?action=start")
69
+ end
70
+
71
+ def stop
72
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{name}?action=stop")
73
+ end
74
+
62
75
  protected
63
76
  def cast_value(attrName, attrValue)
64
77
  if [:isRunning].include? attrName
@@ -0,0 +1,76 @@
1
+ require 'oga'
2
+
3
+ module Iibee
4
+ class MessageFlow
5
+ class Properties
6
+ attr_reader :version, :label, :runMode, :uuid, :isRunning, :commitCount, :traceLevel, :additionalInstances, :startMode,
7
+ :coordinatedTransaction, :commitInterval, :userTraceLevel, :modifyTime, :deployTime, :barFileName
8
+ def initialize(document)
9
+ document.xpath('properties/*/property').each do |property|
10
+
11
+ propertyName = property.get('name')
12
+ propertyValue = property.get('value')
13
+ instance_variable_set("@#{propertyName}", propertyValue)
14
+ end
15
+ end
16
+ end
17
+ CONTEXT_PATH = "apiv1/executiongroups"
18
+
19
+ attr_reader :type, :isRunning, :runMode, :startMode, :hasChildren, :uuid, :name, :propertiesUri, :executionGroupName, :options, :parentType, :parentName
20
+
21
+ def initialize(document, parentType, parentName, executionGroupName, options)
22
+ document.xpath('@*').each do |attribute|
23
+ instance_variable_set("@#{attribute.name}", attribute.value)
24
+ end
25
+ @executionGroupName = executionGroupName
26
+ @parentType = parentType
27
+ @parentName = parentName
28
+ @options = options
29
+ end
30
+
31
+ def executionGroup
32
+ Iibee::ExecutionGroup.find_by(name: executionGroupName, options: @options)
33
+ end
34
+
35
+ def properties
36
+ response = Iibee::Connection.new(options: options).get("#{self.propertiesUri}")
37
+ document = Oga.parse_xml(response.body)
38
+ @properties = Iibee::MessageFlow::Properties.new(document)
39
+ end
40
+
41
+ def self.find_by(executionGroupName: nil, name: nil, options: {})
42
+ where(executionGroupName: executionGroupName, name: name, options: options).first
43
+ end
44
+
45
+ def self.where(executionGroupName: nil, name: nil, options: {})
46
+ msg_flows = []
47
+
48
+ unless executionGroupName.nil?
49
+ msg_flow_url = "/#{CONTEXT_PATH}/#{executionGroupName}/?depth=4"
50
+ else
51
+ msg_flow_url = "/#{CONTEXT_PATH}/?depth=5"
52
+ end
53
+
54
+ response = Iibee::Connection.new(options: options).get(msg_flow_url)
55
+ document = Oga.parse_xml(response.body)
56
+
57
+ document.xpath("//messageflow[@name='#{name}']").each do |msg_flow|
58
+ msg_flows << new(msg_flow, msg_flow.parent.parent.parent.get('type'), msg_flow.parent.parent.get('name'), msg_flow.parent.parent.parent.parent.get('name'), options)
59
+ end
60
+
61
+ return msg_flows
62
+ end
63
+
64
+ def perform(action)
65
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{executionGroupName}/#{parentType}/#{parentName}/messageflows/#{name}?action=#{action}")
66
+ end
67
+
68
+ def start
69
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{executionGroupName}/#{parentType}/#{parentName}/messageflows/#{name}?action=start")
70
+ end
71
+
72
+ def stop
73
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{executionGroupName}/#{parentType}/#{parentName}/messageflows/#{name}?action=stop")
74
+ end
75
+ end
76
+ end
data/lib/iibee/service.rb CHANGED
@@ -59,5 +59,17 @@ module Iibee
59
59
 
60
60
  return services
61
61
  end
62
+
63
+ def perform(action)
64
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{executionGroupName}/services/#{name}?action=#{action}")
65
+ end
66
+
67
+ def start
68
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{executionGroupName}/services/#{name}?action=start")
69
+ end
70
+
71
+ def stop
72
+ response = Iibee::Connection.new(options: options).put("#{CONTEXT_PATH}/#{executionGroupName}/services/#{name}?action=stop")
73
+ end
62
74
  end
63
75
  end
data/lib/iibee/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Iibee
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.17"
3
3
  end
data/lib/iibee.rb CHANGED
@@ -5,6 +5,7 @@ require "iibee/broker"
5
5
  require "iibee/execution_group"
6
6
  require "iibee/service"
7
7
  require "iibee/application"
8
+ require "iibee/message_flow"
8
9
 
9
10
  module Iibee
10
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iibee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - akil
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-14 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -173,6 +173,7 @@ files:
173
173
  - lib/iibee/configuration.rb
174
174
  - lib/iibee/connection.rb
175
175
  - lib/iibee/execution_group.rb
176
+ - lib/iibee/message_flow.rb
176
177
  - lib/iibee/service.rb
177
178
  - lib/iibee/version.rb
178
179
  homepage: http://quantiguous.com.