vayacondios-server 0.2.11 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. data/.gitignore +3 -1
  2. data/.travis.yml +2 -0
  3. data/Gemfile +15 -9
  4. data/LICENSE.md +2 -6
  5. data/Procfile +1 -1
  6. data/README.md +656 -111
  7. data/Rakefile +89 -6
  8. data/bin/vcd +10 -0
  9. data/bin/vcd-server +8 -0
  10. data/config/database.yml +6 -0
  11. data/config/spec.example.yml +18 -0
  12. data/config/vayacondios.example.yml +15 -0
  13. data/config/vcd-server.rb +37 -0
  14. data/examples/configuration.rb +56 -0
  15. data/examples/event_stream.rb +19 -0
  16. data/examples/simple.rb +61 -0
  17. data/features/event.feature +319 -0
  18. data/features/events.feature +208 -0
  19. data/features/stash.feature +840 -0
  20. data/features/stashes.feature +492 -0
  21. data/features/step_definitions/stash_steps.rb +113 -0
  22. data/features/stream.feature +30 -0
  23. data/features/support/em.rb +14 -0
  24. data/features/support/env.rb +13 -0
  25. data/lib/vayacondios/configuration.rb +63 -0
  26. data/lib/vayacondios/server/api.rb +126 -0
  27. data/lib/vayacondios/server/api_options.rb +56 -0
  28. data/lib/vayacondios/server/configuration.rb +23 -0
  29. data/lib/vayacondios/server/driver.rb +71 -0
  30. data/lib/vayacondios/server/drivers/mongo.rb +126 -0
  31. data/lib/vayacondios/server/handlers/document_handler.rb +81 -0
  32. data/lib/vayacondios/server/handlers/event_handler.rb +31 -26
  33. data/lib/vayacondios/server/handlers/events_handler.rb +31 -0
  34. data/lib/vayacondios/server/handlers/stash_handler.rb +69 -0
  35. data/lib/vayacondios/server/handlers/stashes_handler.rb +49 -0
  36. data/lib/vayacondios/server/handlers/stream_handler.rb +39 -0
  37. data/lib/vayacondios/server/models/document.rb +87 -0
  38. data/lib/vayacondios/server/models/event.rb +198 -0
  39. data/lib/vayacondios/server/models/stash.rb +100 -0
  40. data/lib/vayacondios/server.rb +35 -0
  41. data/lib/vayacondios-server.rb +19 -13
  42. data/lib/vayacondios.rb +22 -0
  43. data/pom.xml +124 -4
  44. data/spec/configuration_spec.rb +41 -0
  45. data/spec/server/api_options_spec.rb +32 -0
  46. data/spec/server/api_spec.rb +279 -0
  47. data/spec/server/configuration_spec.rb +27 -0
  48. data/spec/server/drivers/mongo_spec.rb +107 -0
  49. data/spec/server/handlers/event_handler_spec.rb +62 -0
  50. data/spec/server/handlers/events_handler_spec.rb +51 -0
  51. data/spec/server/handlers/stash_handler_spec.rb +68 -0
  52. data/spec/server/handlers/stashes_handler_spec.rb +50 -0
  53. data/spec/server/handlers/stream_handler_spec.rb +5 -0
  54. data/spec/server/models/document_spec.rb +9 -0
  55. data/spec/server/models/event_spec.rb +185 -0
  56. data/spec/server/models/stash_spec.rb +95 -0
  57. data/spec/spec_helper.rb +23 -3
  58. data/spec/support/database_helper.rb +42 -0
  59. data/spec/support/log_helper.rb +19 -0
  60. data/spec/support/shared_context_for_events.rb +22 -0
  61. data/spec/support/shared_context_for_stashes.rb +24 -0
  62. data/spec/support/shared_examples_for_handlers.rb +32 -0
  63. data/src/main/java/com/infochimps/vayacondios/BaseClient.java +342 -0
  64. data/src/main/java/com/infochimps/vayacondios/HTTPClient.java +426 -0
  65. data/src/main/java/com/infochimps/vayacondios/VayacondiosClient.java +487 -65
  66. data/src/main/java/com/infochimps/vayacondios/test/IntegrationTest.java +3 -0
  67. data/src/test/java/com/infochimps/vayacondios/BaseClientTest.java +50 -0
  68. data/src/test/java/com/infochimps/vayacondios/HTTPClientIT.java +267 -0
  69. data/vayacondios-server.gemspec +9 -9
  70. metadata +127 -122
  71. checksums.yaml +0 -15
  72. data/.rspec +0 -2
  73. data/.yardopts +0 -10
  74. data/Guardfile +0 -41
  75. data/app/http_shim.rb +0 -71
  76. data/bin/vcd.sh +0 -27
  77. data/config/http_shim.rb +0 -43
  78. data/config/vayacondios.example.yaml +0 -7
  79. data/config/vayacondios.yaml +0 -7
  80. data/examples/java/ItemSetTest.java +0 -76
  81. data/lib/tasks/publish.rake +0 -23
  82. data/lib/tasks/spec.rake +0 -11
  83. data/lib/tasks/yard.rake +0 -2
  84. data/lib/vayacondios/client/config.rb +0 -7
  85. data/lib/vayacondios/client/configliere.rb +0 -38
  86. data/lib/vayacondios/client/cube_client.rb +0 -39
  87. data/lib/vayacondios/client/http_client.rb +0 -49
  88. data/lib/vayacondios/client/itemset.rb +0 -130
  89. data/lib/vayacondios/client/legacy_switch.rb +0 -43
  90. data/lib/vayacondios/client/notifier.rb +0 -123
  91. data/lib/vayacondios/client/zabbix_client.rb +0 -148
  92. data/lib/vayacondios/legacy_switch.rb +0 -43
  93. data/lib/vayacondios/server/errors/bad_request.rb +0 -6
  94. data/lib/vayacondios/server/errors/not_found.rb +0 -6
  95. data/lib/vayacondios/server/handlers/config_handler.rb +0 -32
  96. data/lib/vayacondios/server/handlers/itemset_handler.rb +0 -60
  97. data/lib/vayacondios/server/legacy_switch.rb +0 -43
  98. data/lib/vayacondios/server/model/config_document.rb +0 -89
  99. data/lib/vayacondios/server/model/document.rb +0 -25
  100. data/lib/vayacondios/server/model/event_document.rb +0 -94
  101. data/lib/vayacondios/server/model/itemset_document.rb +0 -126
  102. data/lib/vayacondios/server/rack/extract_methods.rb +0 -35
  103. data/lib/vayacondios/server/rack/jsonize.rb +0 -43
  104. data/lib/vayacondios/server/rack/params.rb +0 -50
  105. data/lib/vayacondios/server/rack/path.rb +0 -23
  106. data/lib/vayacondios/server/rack/path_validation.rb +0 -22
  107. data/lib/vayacondios/version.rb +0 -3
  108. data/lib/vayacondios-client.rb +0 -22
  109. data/scripts/hadoop_monitor/configurable.rb +0 -66
  110. data/scripts/hadoop_monitor/hadoop_attempt_scraper.rb +0 -45
  111. data/scripts/hadoop_monitor/hadoop_client.rb +0 -273
  112. data/scripts/hadoop_monitor/hadoop_monitor.rb +0 -101
  113. data/scripts/hadoop_monitor/hadoopable.rb +0 -65
  114. data/scripts/hadoop_monitor/machine_monitor.rb +0 -115
  115. data/scripts/s3_cataloger/buckets +0 -33
  116. data/scripts/s3_cataloger/foreach_bucket +0 -88
  117. data/scripts/s3_cataloger/parse_ls.py +0 -391
  118. data/spec/client/itemset_legacy_spec.rb +0 -55
  119. data/spec/client/itemset_spec.rb +0 -60
  120. data/spec/client/notifier_spec.rb +0 -120
  121. data/spec/server/config_spec.rb +0 -113
  122. data/spec/server/event_spec.rb +0 -103
  123. data/spec/server/itemset_legacy_spec.rb +0 -320
  124. data/spec/server/itemset_spec.rb +0 -317
  125. data/spec/server/rack/extract_methods_spec.rb +0 -60
  126. data/spec/server/rack/path_spec.rb +0 -36
  127. data/spec/server/rack/path_validation_spec.rb +0 -22
  128. data/spec/server/server_spec.rb +0 -20
  129. data/spec/support/mongo_cleaner.rb +0 -32
  130. data/src/main/java/ItemSetTest.java +0 -76
  131. data/src/main/java/com/infochimps/util/CurrentClass.java +0 -26
  132. data/src/main/java/com/infochimps/util/DebugUtil.java +0 -38
  133. data/src/main/java/com/infochimps/util/HttpHelper.java +0 -181
  134. data/src/main/java/com/infochimps/vayacondios/ItemSets.java +0 -373
  135. data/src/main/java/com/infochimps/vayacondios/LinkToVCD.java +0 -18
  136. data/src/main/java/com/infochimps/vayacondios/MemoryVCDShim.java +0 -84
  137. data/src/main/java/com/infochimps/vayacondios/Organization.java +0 -62
  138. data/src/main/java/com/infochimps/vayacondios/PathBuilder.java +0 -13
  139. data/src/main/java/com/infochimps/vayacondios/StandardVCDLink.java +0 -218
  140. data/src/main/java/com/infochimps/vayacondios/VCDIntegrationTest.java +0 -108
  141. data/src/test/java/com/infochimps/vayacondios/TestVayacondiosInMemory.java +0 -78
  142. data/vayacondios-client.gemspec +0 -25
@@ -0,0 +1,208 @@
1
+ Feature: Events
2
+ In order to provide functionality
3
+ As a user of the Vayacondios Api
4
+ I want to document how Events work
5
+
6
+ Scenario: Retrieving non-Existent Events
7
+ Given there are no Events under topic "topic" in the database
8
+ When the client sends a GET request to "/v3/organization/events/topic" with no body
9
+ Then the response status should be 200
10
+ And the response body should be:
11
+ """
12
+ [
13
+ ]
14
+ """
15
+
16
+ Scenario: Retrieving Existing Events with a Time Query
17
+ Given the following Event exists under topic "topic" in the database:
18
+ """
19
+ {
20
+ "_id": "id1",
21
+ "_t": "2012-02-13T12:34:42.452Z",
22
+ "_d": { }
23
+ }
24
+ """
25
+ And the following Event exists under topic "topic" in the database:
26
+ """
27
+ {
28
+ "_id": "id2",
29
+ "_t": "2010-02-13T12:34:42.452Z",
30
+ "_d": { }
31
+ }
32
+ """
33
+ When the client sends a GET request to "/v3/organization/events/topic" with the following body:
34
+ """
35
+ {
36
+ "after": "2012-01-01T00:00:00.000Z"
37
+ }
38
+ """
39
+ Then the response status should be 200
40
+ And the response body should be:
41
+ """
42
+ [
43
+ {
44
+ "id": "id1",
45
+ "time": "2012-02-13T12:34:42.452Z"
46
+ }
47
+ ]
48
+ """
49
+
50
+ Scenario: Retrieving Existing Events with a Data Query
51
+ Given the following Event exists under topic "topic" in the database:
52
+ """
53
+ {
54
+ "_id": "id1",
55
+ "_t": "2012-02-13T12:34:42.452Z",
56
+ "_d": {
57
+ "alignment": "good"
58
+ }
59
+ }
60
+ """
61
+ And the following Event exists under topic "topic" in the database:
62
+ """
63
+ {
64
+ "_id": "id2",
65
+ "_t": "2012-02-13T12:34:42.452Z",
66
+ "_d": {
67
+ "alignment": "evil"
68
+ }
69
+ }
70
+ """
71
+ When the client sends a GET request to "/v3/organization/events/topic" with the following body:
72
+ """
73
+ {
74
+ "alignment": "good"
75
+ }
76
+ """
77
+ Then the response status should be 200
78
+ And the response body should be:
79
+ """
80
+ [
81
+ {
82
+ "id": "id1",
83
+ "time": "2012-02-13T12:34:42.452Z",
84
+ "alignment": "good"
85
+ }
86
+ ]
87
+ """
88
+
89
+ Scenario: Creating Events
90
+ Given there are no Events under topic "topic" in the database
91
+ When the client sends a POST request to "/v3/organization/events/topic" with no body
92
+ Then the response status should be 405
93
+ And the response body should be:
94
+ """
95
+ {
96
+ "error": "Operation create not allowed for Vayacondios::Server::EventsHandler. Valid operations are [\"search\", \"retrieve\", \"delete\"]"
97
+ }
98
+ """
99
+ And there are no Events under topic "topic" in the database
100
+
101
+ Scenario: Updating Events
102
+ Given there are no Events under topic "topic" in the database
103
+ When the client sends a PUT request to "/v3/organization/events/topic" with no body
104
+ Then the response status should be 405
105
+ And the response body should be:
106
+ """
107
+ {
108
+ "error": "Operation update not allowed for Vayacondios::Server::EventsHandler. Valid operations are [\"search\", \"retrieve\", \"delete\"]"
109
+ }
110
+ """
111
+ And there are no Events under topic "topic" in the database
112
+
113
+ Scenario: Deleting Events
114
+ Given the following Event exists under topic "topic" in the database:
115
+ """
116
+ {
117
+ "_id": "id1",
118
+ "_t": "2012-02-13T12:34:42.452Z",
119
+ "_d": { }
120
+ }
121
+ """
122
+ And the following Event exists under topic "topic" in the database:
123
+ """
124
+ {
125
+ "_id": "id2",
126
+ "_t": "2012-02-13T12:34:42.452Z",
127
+ "_d": { }
128
+ }
129
+ """
130
+ When the client sends a DELETE request to "/v3/organization/events/topic" with no body
131
+ Then the response status should be 200
132
+ And the response body should be:
133
+ """
134
+ {
135
+ "ok": true
136
+ }
137
+ """
138
+ And there are no Events under topic "topic" in the database
139
+
140
+ Scenario: Deleting Events with a Time Query
141
+ Given the following Event exists under topic "topic" in the database:
142
+ """
143
+ {
144
+ "_id": "id1",
145
+ "_t": "2012-02-13T12:34:42.452Z",
146
+ "_d": { }
147
+ }
148
+ """
149
+ And the following Event exists under topic "topic" in the database:
150
+ """
151
+ {
152
+ "_id": "id2",
153
+ "_t": "2010-02-13T12:34:42.452Z",
154
+ "_d": { }
155
+ }
156
+ """
157
+ When the client sends a DELETE request to "/v3/organization/events/topic" with the following body:
158
+ """
159
+ {
160
+ "after": "2012-01-01T00:00:00.000Z"
161
+ }
162
+ """
163
+ Then the response status should be 200
164
+ And the response body should be:
165
+ """
166
+ {
167
+ "ok": true
168
+ }
169
+ """
170
+ And there should not be an Event with Id "id1" under topic "topic" in the database
171
+ And there should be an Event with Id "id2" under topic "topic" in the database
172
+
173
+ Scenario: Deleting Events with a Data Query
174
+ Given the following Event exists under topic "topic" in the database:
175
+ """
176
+ {
177
+ "_id": "id1",
178
+ "_t": "2012-02-13T12:34:42.452Z",
179
+ "_d": {
180
+ "alignment":"good"
181
+ }
182
+ }
183
+ """
184
+ And the following Event exists under topic "topic" in the database:
185
+ """
186
+ {
187
+ "_id": "id2",
188
+ "_t": "2012-02-13T12:34:42.452Z",
189
+ "_d": {
190
+ "alignment":"evil"
191
+ }
192
+ }
193
+ """
194
+ When the client sends a DELETE request to "/v3/organization/events/topic" with the following body:
195
+ """
196
+ {
197
+ "alignment":"good"
198
+ }
199
+ """
200
+ Then the response status should be 200
201
+ And the response body should be:
202
+ """
203
+ {
204
+ "ok": true
205
+ }
206
+ """
207
+ And there should not be an Event with Id "id1" under topic "topic" in the database
208
+ And there should be an Event with Id "id2" under topic "topic" in the database