iibee 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd5d0fa2bcad8ccc9dea397601d370d3421223a3
4
- data.tar.gz: fc76f46dce232f4e07ee0ab93bdec8b848bc47f2
3
+ metadata.gz: 0079f49da198c801a90b7bd74eec535e47e54734
4
+ data.tar.gz: 363dd5ad483d62664fc9a55c03d541ef0fa1c6b9
5
5
  SHA512:
6
- metadata.gz: af46f31580e1382aea952ff69bfdaf163b266c8704ec2a71dddbb75d8efbf64f26b76f5767ed2385e5628cbe29d7595c9a98a5f06a08bb8bf4e7b7714397ff90
7
- data.tar.gz: 3ae6c5ac345e9832595d8a55cb5be37a913d237be44ca021c1925f916cf02a29f0e55862fc90a4e8812e9319160ec159891514a711023f320059ed481e504543
6
+ metadata.gz: 3058871b52f739edb857dfe2181986c3930367780cd0d55846e665cd85bbeffe30da8035e603e1958d71564e128ea3e23e90facee86a75e0742a999f551b05b6
7
+ data.tar.gz: 8060ccc48bd62494265b9c98d634b91eb0caf2768184fd38679019ccf3bd7225190b15a54be3269cf46882b97e215a38630bcc32fa47b2f11c8f21b6c5e3629d
@@ -4,24 +4,27 @@ require 'oga'
4
4
  module Iibee
5
5
  class Application
6
6
  class Properties
7
- attr_reader :processId, :traceLevel, :soapNodesUseEmbeddedListener, :compiledXPathCacheSizeEntries, :consoleMode, :httpNodesUseEmbeddedListener, :inactiveUserExitList, :activeUserExitList, :traceNodeLevel, :userTraceLevel
7
+ attr_reader :label, :runMode, :uuid, :isRunning, :shortDesc, :longDesc, :processId, :traceLevel, :soapNodesUseEmbeddedListener,
8
+ :compiledXPathCacheSizeEntries, :consoleMode, :httpNodesUseEmbeddedListener, :inactiveUserExitList, :activeUserExitList,
9
+ :traceNodeLevel, :userTraceLevel, :modifyTime, :deployTime, :barFileName
8
10
  def initialize(document)
9
- document.xpath('properties/advancedProperties/property').each do |advancedProperty|
11
+ document.xpath('properties/*/property').each do |property|
10
12
 
11
- propertyName = advancedProperty.get('name')
12
- propertyValue = advancedProperty.get('value')
13
+ propertyName = property.get('name')
14
+ propertyValue = property.get('value')
13
15
  instance_variable_set("@#{propertyName}", propertyValue)
14
- end
16
+ end
15
17
  end
16
18
  end
17
19
  CONTEXT_PATH = "apiv1/executiongroups"
18
20
 
19
- attr_reader :type, :isRunning, :runMode, :startMode, :hasChildren, :uuid, :name, :propertiesUri
21
+ attr_reader :type, :isRunning, :runMode, :startMode, :hasChildren, :uuid, :name, :propertiesUri, :egName
20
22
 
21
23
  def initialize(document)
22
- document.xpath('application/@*').each do |attribute|
24
+ document.xpath('@*').each do |attribute|
23
25
  instance_variable_set("@#{attribute.name}", attribute.value)
24
26
  end
27
+ @executionGroupName = executionGroupName
25
28
  end
26
29
 
27
30
  def properties
@@ -34,15 +37,37 @@ module Iibee
34
37
  applications = []
35
38
  response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{egName}/applications/")
36
39
  document = Oga.parse_xml(response.body)
40
+ p document.xpath('applications/application')
37
41
  document.xpath('applications/application').each do |application|
38
- applications << new(document)
42
+ applications << new(application)
39
43
  end
40
44
  end
41
45
 
42
- def self.find_by_name(egName, name)
43
- response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{egName}/applications/#{name}")
46
+ def self.find_by(egName: nil, name: nil)
47
+ where(executionGroupName: egName, name: name).first
48
+ end
49
+
50
+ def self.where(executionGroupName: nil, name: nil)
51
+ applications = []
52
+
53
+ unless executionGroupName.nil?
54
+ application_url = "#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{executionGroupName}/?depth=2"
55
+ else
56
+ application_url = "#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/?depth=3"
57
+ end
58
+
59
+ response = Faraday.get(application_url)
44
60
  document = Oga.parse_xml(response.body)
45
- new(document)
61
+
62
+ document.xpath("//application[@name='#{name}']").each do |application|
63
+ applications << new(application, document.at_xpath("//executionGroup[applications/application/@uuid = '#{application.get('uuid')}']").get('name'))
64
+ end
65
+
66
+ return applications
67
+ end
68
+
69
+ def executionGroup
70
+ Iibee::ExecutionGroup.find_by(name: executionGroupName)
46
71
  end
47
72
  end
48
73
  end
data/lib/iibee/broker.rb CHANGED
@@ -29,7 +29,6 @@ module Iibee
29
29
  def self.find(id)
30
30
  response = Faraday.get("#{Iibee.configuration.base_url}#{CONTEXT_PATH}")
31
31
  document = Oga.parse_xml(response.body)
32
- p document
33
32
  new(document)
34
33
  end
35
34
  end
@@ -4,12 +4,14 @@ require 'oga'
4
4
  module Iibee
5
5
  class ExecutionGroup
6
6
  class Properties
7
- attr_reader :processId, :traceLevel, :soapNodesUseEmbeddedListener, :compiledXPathCacheSizeEntries, :consoleMode, :httpNodesUseEmbeddedListener, :inactiveUserExitList, :activeUserExitList, :traceNodeLevel, :userTraceLevel
7
+ attr_reader :label, :runMode, :uuid, :isRunning, :shortDesc, :longDesc, :processId, :traceLevel, :soapNodesUseEmbeddedListener,
8
+ :compiledXPathCacheSizeEntries, :consoleMode, :httpNodesUseEmbeddedListener, :inactiveUserExitList, :activeUserExitList,
9
+ :traceNodeLevel, :userTraceLevel, :modifyTime, :deployTime, :barFileName
8
10
  def initialize(document)
9
- document.xpath('properties/advancedProperties/property').each do |advancedProperty|
11
+ document.xpath('properties/*/property').each do |property|
10
12
 
11
- propertyName = advancedProperty.get('name')
12
- propertyValue = advancedProperty.get('value')
13
+ propertyName = property.get('name')
14
+ propertyValue = property.get('value')
13
15
  instance_variable_set("@#{propertyName}", propertyValue)
14
16
  end
15
17
  end
@@ -17,10 +19,10 @@ module Iibee
17
19
 
18
20
  CONTEXT_PATH = "/apiv1/executiongroups/"
19
21
 
20
- attr_reader :isRunning, :runMode, :isRestricted, :hasChildren, :uri, :propertiesUri, :uuid, :name, :properties
22
+ attr_reader :isRunning, :runMode, :isRestricted, :hasChildren, :uri, :propertiesUri, :uuid, :name
21
23
 
22
24
  def initialize(document)
23
- document.xpath('executionGroup/@*').each do |attribute|
25
+ document.xpath('@*').each do |attribute|
24
26
  instance_variable_set("@#{attribute.name}", cast_value(attribute.name, attribute.value))
25
27
  end
26
28
  end
@@ -36,14 +38,25 @@ module Iibee
36
38
  response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/")
37
39
  document = Oga.parse_xml(response.body)
38
40
  document.xpath('executionGroups/executionGroup').each do |eg|
39
- egs << new(document)
41
+ egs << new(eg)
40
42
  end
43
+ return egs
41
44
  end
42
45
 
43
- def self.find_by_name(name)
44
- response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{name}")
45
- document = Oga.parse_xml(response.body)
46
- new(document)
46
+ def self.find_by(name: nil)
47
+ where(name: name).first
48
+ end
49
+
50
+ def self.where(name: nil)
51
+ egs = []
52
+ unless name.nil?
53
+ response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{name}")
54
+ document = Oga.parse_xml(response.body)
55
+ document.xpath("//executionGroup[@name='#{name}']").each do |eg|
56
+ egs << new(eg)
57
+ end
58
+ end
59
+ return egs
47
60
  end
48
61
 
49
62
  protected
data/lib/iibee/service.rb CHANGED
@@ -4,24 +4,32 @@ require 'oga'
4
4
  module Iibee
5
5
  class Service
6
6
  class Properties
7
- attr_reader :processId, :traceLevel, :soapNodesUseEmbeddedListener, :compiledXPathCacheSizeEntries, :consoleMode, :httpNodesUseEmbeddedListener, :inactiveUserExitList, :activeUserExitList, :traceNodeLevel, :userTraceLevel
8
- def initialize(document)
9
- document.xpath('properties/advancedProperties/property').each do |advancedProperty|
7
+ attr_reader :label, :runMode, :uuid, :isRunning, :shortDesc, :longDesc, :processId, :traceLevel, :soapNodesUseEmbeddedListener,
8
+ :compiledXPathCacheSizeEntries, :consoleMode, :httpNodesUseEmbeddedListener, :inactiveUserExitList, :activeUserExitList,
9
+ :traceNodeLevel, :userTraceLevel, :modifyTime, :deployTime, :barFileName
10
+ def initialize(document)
11
+ document.xpath('properties/*/property').each do |property|
10
12
 
11
- propertyName = advancedProperty.get('name')
12
- propertyValue = advancedProperty.get('value')
13
+ propertyName = property.get('name')
14
+ propertyValue = property.get('value')
13
15
  instance_variable_set("@#{propertyName}", propertyValue)
14
- end
16
+ end
15
17
  end
16
18
  end
17
19
  CONTEXT_PATH = "apiv1/executiongroups"
18
20
 
19
- attr_reader :type, :isRunning, :runMode, :startMode, :hasChildren, :uuid, :name, :propertiesUri
21
+ attr_reader :type, :isRunning, :runMode, :startMode, :hasChildren, :uuid, :name, :propertiesUri, :executionGroupName
22
+ attr_accessor :uuid, :name
20
23
 
21
- def initialize(document)
22
- document.xpath('service/@*').each do |attribute|
24
+ def initialize(document, executionGroupName)
25
+ document.xpath('@*').each do |attribute|
23
26
  instance_variable_set("@#{attribute.name}", attribute.value)
24
27
  end
28
+ @executionGroupName = executionGroupName
29
+ end
30
+
31
+ def executionGroup
32
+ Iibee::ExecutionGroup.find_by(name: executionGroupName)
25
33
  end
26
34
 
27
35
  def properties
@@ -30,20 +38,27 @@ module Iibee
30
38
  @properties = Iibee::Service::Properties.new(document)
31
39
  end
32
40
 
33
- def self.all(egName)
34
- services = []
35
- response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{egName}/services/")
36
- p "#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{egName}/services/"
37
- document = Oga.parse_xml(response.body)
38
- document.xpath('services/service').each do |service|
39
- services << new(document)
40
- end
41
+ def self.find_by(executionGroupName: nil, name: nil)
42
+ where(executionGroupName: executionGroupName, name: name).first
41
43
  end
42
44
 
43
- def self.find_by_name(egName, name)
44
- response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{egName}/services/#{name}")
45
+ def self.where(executionGroupName: nil, name: nil)
46
+ services = []
47
+
48
+ unless executionGroupName.nil?
49
+ service_url = "#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{executionGroupName}/?depth=2"
50
+ else
51
+ service_url = "#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/?depth=3"
52
+ end
53
+
54
+ response = Faraday.get(service_url)
45
55
  document = Oga.parse_xml(response.body)
46
- new(document)
56
+
57
+ document.xpath("//service[@name='#{name}']").each do |service|
58
+ services << new(service, document.at_xpath("//executionGroup[services/service/@uuid = '#{service.get('uuid')}']").get('name'))
59
+ end
60
+
61
+ return services
47
62
  end
48
63
  end
49
64
  end
data/lib/iibee/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Iibee
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
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.8
4
+ version: 0.1.9
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-07 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler