triglav-agent 1.0.0.pre1

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.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +6 -0
  5. data/.yardopts +6 -0
  6. data/CHANGELOG.md +3 -0
  7. data/CODE_OF_CONDUCT.md +49 -0
  8. data/Gemfile +5 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +59 -0
  11. data/Rakefile +11 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/docs/Triglav/Agent/ApiClient/AuthenticationError.html +150 -0
  15. data/docs/Triglav/Agent/ApiClient/ConnectionError.html +150 -0
  16. data/docs/Triglav/Agent/ApiClient/Error.html +296 -0
  17. data/docs/Triglav/Agent/ApiClient.html +545 -0
  18. data/docs/Triglav/Agent/Base/CLI.html +498 -0
  19. data/docs/Triglav/Agent/Base/Connection.html +258 -0
  20. data/docs/Triglav/Agent/Base/Monitor.html +370 -0
  21. data/docs/Triglav/Agent/Base/Processor.html +623 -0
  22. data/docs/Triglav/Agent/Base/Setting.html +1081 -0
  23. data/docs/Triglav/Agent/Base/Worker.html +635 -0
  24. data/docs/Triglav/Agent/Base.html +121 -0
  25. data/docs/Triglav/Agent/Configuration.html +967 -0
  26. data/docs/Triglav/Agent/Error.html +130 -0
  27. data/docs/Triglav/Agent/HashUtil.html +351 -0
  28. data/docs/Triglav/Agent/LogFormatter.html +271 -0
  29. data/docs/Triglav/Agent/Logger.html +287 -0
  30. data/docs/Triglav/Agent/StorageFile.html +1130 -0
  31. data/docs/Triglav/Agent/Timer.html +424 -0
  32. data/docs/Triglav/Agent/TooManyError.html +134 -0
  33. data/docs/Triglav/Agent.html +131 -0
  34. data/docs/Triglav.html +119 -0
  35. data/docs/_index.html +335 -0
  36. data/docs/class_list.html +51 -0
  37. data/docs/css/common.css +1 -0
  38. data/docs/css/full_list.css +58 -0
  39. data/docs/css/style.css +481 -0
  40. data/docs/file.LICENSE.html +72 -0
  41. data/docs/file.README.html +137 -0
  42. data/docs/file_list.html +61 -0
  43. data/docs/frames.html +17 -0
  44. data/docs/index.html +137 -0
  45. data/docs/js/app.js +243 -0
  46. data/docs/js/full_list.js +216 -0
  47. data/docs/js/jquery.js +4 -0
  48. data/docs/method_list.html +659 -0
  49. data/docs/top-level-namespace.html +112 -0
  50. data/example/config.yml +40 -0
  51. data/lib/triglav/agent/api_client.rb +199 -0
  52. data/lib/triglav/agent/base/cli.rb +98 -0
  53. data/lib/triglav/agent/base/connection.rb +30 -0
  54. data/lib/triglav/agent/base/monitor.rb +32 -0
  55. data/lib/triglav/agent/base/processor.rb +136 -0
  56. data/lib/triglav/agent/base/setting.rb +112 -0
  57. data/lib/triglav/agent/base/worker.rb +95 -0
  58. data/lib/triglav/agent/configuration.rb +79 -0
  59. data/lib/triglav/agent/error.rb +4 -0
  60. data/lib/triglav/agent/hash_util.rb +36 -0
  61. data/lib/triglav/agent/logger.rb +50 -0
  62. data/lib/triglav/agent/storage_file.rb +144 -0
  63. data/lib/triglav/agent/timer.rb +80 -0
  64. data/lib/triglav/agent/version.rb +5 -0
  65. data/lib/triglav/agent.rb +20 -0
  66. data/lib/triglav-agent.rb +1 -0
  67. data/triglav-agent.gemspec +33 -0
  68. metadata +250 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0e93319a7488bc71909e48a806ab59d236ee5533
4
+ data.tar.gz: d303d5b611c786c306eeabad855a1f98430abcfb
5
+ SHA512:
6
+ metadata.gz: 041f573acea82bfb4a26dd4e019ea3a8a7e9282a5d45a4f2e31cf23516412ab44053f21fbcb4e1b375dcbe5d35d4d7eb1b86e22c1b99534fb55c883212133b6a
7
+ data.tar.gz: 642e9f6ba9f7315ca8f11278c119e81720d73fc1c41845ac1bd1c6e230d8b33fd9dc9918f18cf3a187a8b78cb68c48832f717fbb16cf9a5201b0201a86d4b3b7
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .env
11
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.0
4
+ - 2.4.0
5
+ before_install:
6
+ - gem install bundler -v 1.11.2
data/.yardopts ADDED
@@ -0,0 +1,6 @@
1
+ --no-private
2
+ --protected
3
+ --output-dir docs
4
+ -
5
+ README.md
6
+ LICENSE.txt
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # 1.0.0 (not released yet)
2
+
3
+ Initial release
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at sonots@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+ gem 'triglav_client', git: 'https://github.com/triglav-dataflow/triglav-client-ruby'
5
+ gem 'pry-nav'
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Triglav Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Triglav::Agent Framework
2
+
3
+ Framework of Triglav Agent in Ruby.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'triglav-agent'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```
16
+ $ bundle
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ See [yardoc](https://triglav-dataflow.github.io/triglav-agent-framework-ruby/)
22
+
23
+ ## Examples
24
+
25
+ See [triglav-agent-vertica](https://github.com/triglav-workflow/triglav-agent-vertica) or [triglav-agent-hdfs](https://github.com/triglav-workflow/triglav-agent-hdfs).
26
+
27
+ Basically what you have to implement are following classes:
28
+
29
+ * `Connection`: make a connection to your storage
30
+ * `Monitor`: monitor your storage and send messages to triglav
31
+
32
+ ## Development
33
+
34
+ ### Run test
35
+
36
+ ```
37
+ bundle exec rake test
38
+ ```
39
+
40
+ ### Release
41
+
42
+ ```
43
+ bundle exec rake release
44
+ ```
45
+
46
+ ### Generate yardoc
47
+
48
+ ```
49
+ bundle exec rake yard
50
+ ```
51
+
52
+ ## Contributing
53
+
54
+ Bug reports and pull requests are welcome on GitHub at https://github.com/triglav-workflow/triglav-agent-framework-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
55
+
56
+ ## License
57
+
58
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
59
+
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rake/testtask'
4
+ desc 'Run test_unit based test'
5
+ Rake::TestTask.new(:test) do |t|
6
+ t.libs << "test"
7
+ t.test_files = Dir["test/**/test_*.rb"].sort
8
+ t.verbose = false
9
+ t.warning = false
10
+ end
11
+ task :default => :test
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "triglav/agent/base"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,150 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Exception: Triglav::Agent::ApiClient::AuthenticationError
8
+
9
+ &mdash; Documentation by YARD 0.9.5
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Triglav::Agent::ApiClient::AuthenticationError";
19
+ relpath = '../../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../../class_list.html"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../../_index.html">Index (A)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../../Triglav.html" title="Triglav (module)">Triglav</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Agent.html" title="Triglav::Agent (module)">Agent</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../ApiClient.html" title="Triglav::Agent::ApiClient (class)">ApiClient</a></span></span>
41
+ &raquo;
42
+ <span class="title">AuthenticationError</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <iframe id="search_frame" src="../../../class_list.html"></iframe>
63
+
64
+ <div id="content"><h1>Exception: Triglav::Agent::ApiClient::AuthenticationError
65
+
66
+
67
+
68
+ </h1>
69
+ <div class="box_info">
70
+
71
+ <dl>
72
+ <dt>Inherits:</dt>
73
+ <dd>
74
+ <span class="inheritName"><span class='object_link'><a href="Error.html" title="Triglav::Agent::ApiClient::Error (class)">Error</a></span></span>
75
+
76
+ <ul class="fullTree">
77
+ <li>Object</li>
78
+
79
+ <li class="next">StandardError</li>
80
+
81
+ <li class="next"><span class='object_link'><a href="Error.html" title="Triglav::Agent::ApiClient::Error (class)">Error</a></span></li>
82
+
83
+ <li class="next">Triglav::Agent::ApiClient::AuthenticationError</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+ </dl>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ <dl>
102
+ <dt>Defined in:</dt>
103
+ <dd>lib/triglav/agent/api_client.rb</dd>
104
+ </dl>
105
+
106
+ </div>
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ <h2>Instance Attribute Summary</h2>
115
+
116
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Error.html" title="Triglav::Agent::ApiClient::Error (class)">Error</a></span></h3>
117
+ <p class="inherited"><span class='object_link'><a href="Error.html#cause-instance_method" title="Triglav::Agent::ApiClient::Error#cause (method)">#cause</a></span></p>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+ <h2>Method Summary</h2>
128
+
129
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Error.html" title="Triglav::Agent::ApiClient::Error (class)">Error</a></span></h3>
130
+ <p class="inherited"><span class='object_link'><a href="Error.html#initialize-instance_method" title="Triglav::Agent::ApiClient::Error#initialize (method)">#initialize</a></span></p>
131
+
132
+ <div id="constructor_details" class="method_details_list">
133
+ <h2>Constructor Details</h2>
134
+
135
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="Error.html#initialize-instance_method" title="Triglav::Agent::ApiClient::Error#initialize (method)">Triglav::Agent::ApiClient::Error</a></span></p>
136
+
137
+ </div>
138
+
139
+
140
+ </div>
141
+
142
+ <div id="footer">
143
+ Generated on Thu Feb 23 23:20:33 2017 by
144
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
145
+ 0.9.5 (ruby-2.3.2).
146
+ </div>
147
+
148
+ </div>
149
+ </body>
150
+ </html>
@@ -0,0 +1,150 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Exception: Triglav::Agent::ApiClient::ConnectionError
8
+
9
+ &mdash; Documentation by YARD 0.9.5
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Triglav::Agent::ApiClient::ConnectionError";
19
+ relpath = '../../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../../class_list.html"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../../_index.html">Index (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../../Triglav.html" title="Triglav (module)">Triglav</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Agent.html" title="Triglav::Agent (module)">Agent</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../ApiClient.html" title="Triglav::Agent::ApiClient (class)">ApiClient</a></span></span>
41
+ &raquo;
42
+ <span class="title">ConnectionError</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <iframe id="search_frame" src="../../../class_list.html"></iframe>
63
+
64
+ <div id="content"><h1>Exception: Triglav::Agent::ApiClient::ConnectionError
65
+
66
+
67
+
68
+ </h1>
69
+ <div class="box_info">
70
+
71
+ <dl>
72
+ <dt>Inherits:</dt>
73
+ <dd>
74
+ <span class="inheritName"><span class='object_link'><a href="Error.html" title="Triglav::Agent::ApiClient::Error (class)">Error</a></span></span>
75
+
76
+ <ul class="fullTree">
77
+ <li>Object</li>
78
+
79
+ <li class="next">StandardError</li>
80
+
81
+ <li class="next"><span class='object_link'><a href="Error.html" title="Triglav::Agent::ApiClient::Error (class)">Error</a></span></li>
82
+
83
+ <li class="next">Triglav::Agent::ApiClient::ConnectionError</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+ </dl>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ <dl>
102
+ <dt>Defined in:</dt>
103
+ <dd>lib/triglav/agent/api_client.rb</dd>
104
+ </dl>
105
+
106
+ </div>
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ <h2>Instance Attribute Summary</h2>
115
+
116
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Error.html" title="Triglav::Agent::ApiClient::Error (class)">Error</a></span></h3>
117
+ <p class="inherited"><span class='object_link'><a href="Error.html#cause-instance_method" title="Triglav::Agent::ApiClient::Error#cause (method)">#cause</a></span></p>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+ <h2>Method Summary</h2>
128
+
129
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Error.html" title="Triglav::Agent::ApiClient::Error (class)">Error</a></span></h3>
130
+ <p class="inherited"><span class='object_link'><a href="Error.html#initialize-instance_method" title="Triglav::Agent::ApiClient::Error#initialize (method)">#initialize</a></span></p>
131
+
132
+ <div id="constructor_details" class="method_details_list">
133
+ <h2>Constructor Details</h2>
134
+
135
+ <p class="notice">This class inherits a constructor from <span class='object_link'><a href="Error.html#initialize-instance_method" title="Triglav::Agent::ApiClient::Error#initialize (method)">Triglav::Agent::ApiClient::Error</a></span></p>
136
+
137
+ </div>
138
+
139
+
140
+ </div>
141
+
142
+ <div id="footer">
143
+ Generated on Thu Feb 23 23:20:33 2017 by
144
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
145
+ 0.9.5 (ruby-2.3.2).
146
+ </div>
147
+
148
+ </div>
149
+ </body>
150
+ </html>