esp_sdk 1.1.0 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -2
  3. data/.rubocop.yml +53 -6
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +8 -2
  6. data/Gemfile.lock +171 -0
  7. data/Guardfile +47 -0
  8. data/README.md +230 -5
  9. data/Rakefile +14 -1
  10. data/assets/logo.png +0 -0
  11. data/bin/esp_console +71 -0
  12. data/esp_sdk.gemspec +27 -18
  13. data/lib/esp/exceptions.rb +3 -0
  14. data/lib/esp/extensions/active_resource/formats/json_api_format.rb +105 -0
  15. data/lib/esp/extensions/active_resource/paginated_collection.rb +198 -0
  16. data/lib/esp/extensions/active_resource/validations.rb +45 -0
  17. data/lib/esp/resources/alert.rb +135 -0
  18. data/lib/esp/resources/cloud_trail_event.rb +45 -0
  19. data/lib/esp/resources/concerns/stat_totals.rb +79 -0
  20. data/lib/esp/resources/contact_request.rb +42 -0
  21. data/lib/esp/resources/custom_signature.rb +224 -0
  22. data/lib/esp/resources/dashboard.rb +31 -0
  23. data/lib/esp/resources/external_account.rb +89 -0
  24. data/lib/esp/resources/organization.rb +61 -0
  25. data/lib/esp/resources/region.rb +46 -0
  26. data/lib/esp/resources/report.rb +100 -0
  27. data/lib/esp/resources/resource.rb +66 -0
  28. data/lib/esp/resources/service.rb +31 -0
  29. data/lib/esp/resources/signature.rb +106 -0
  30. data/lib/esp/resources/stat.rb +124 -0
  31. data/lib/esp/resources/stat_custom_signature.rb +121 -0
  32. data/lib/esp/resources/stat_region.rb +121 -0
  33. data/lib/esp/resources/stat_service.rb +121 -0
  34. data/lib/esp/resources/stat_signature.rb +121 -0
  35. data/lib/esp/resources/sub_organization.rb +69 -0
  36. data/lib/esp/resources/suppression/region.rb +99 -0
  37. data/lib/esp/resources/suppression/signature.rb +107 -0
  38. data/lib/esp/resources/suppression/unique_identifier.rb +60 -0
  39. data/lib/esp/resources/suppression.rb +86 -0
  40. data/lib/esp/resources/tag.rb +45 -0
  41. data/lib/esp/resources/team.rb +79 -0
  42. data/lib/esp/resources/user.rb +46 -0
  43. data/lib/esp/version.rb +3 -0
  44. data/lib/esp.rb +95 -0
  45. data/lib/esp_sdk.rb +9 -45
  46. data/lib/tasks/rubocop.rake +2 -0
  47. data/lib/tasks/testing.rake +3 -0
  48. data/rdoc/ActiveResource/Formats.html +176 -0
  49. data/rdoc/ActiveResource/PaginatedCollection.html +910 -0
  50. data/rdoc/ActiveResource.html +180 -0
  51. data/rdoc/ESP/Alert.html +771 -0
  52. data/rdoc/ESP/CloudTrailEvent.html +375 -0
  53. data/rdoc/ESP/ContactRequest.html +366 -0
  54. data/rdoc/ESP/CustomSignature.html +746 -0
  55. data/rdoc/ESP/Dashboard.html +355 -0
  56. data/rdoc/ESP/ExternalAccount.html +565 -0
  57. data/rdoc/ESP/Organization.html +590 -0
  58. data/rdoc/ESP/Region.html +399 -0
  59. data/rdoc/ESP/Report.html +622 -0
  60. data/rdoc/ESP/Service.html +380 -0
  61. data/rdoc/ESP/Signature.html +555 -0
  62. data/rdoc/ESP/Stat.html +1778 -0
  63. data/rdoc/ESP/StatCustomSignature.html +1599 -0
  64. data/rdoc/ESP/StatRegion.html +1598 -0
  65. data/rdoc/ESP/StatService.html +1598 -0
  66. data/rdoc/ESP/StatSignature.html +1598 -0
  67. data/rdoc/ESP/SubOrganization.html +540 -0
  68. data/rdoc/ESP/Suppression/Region.html +454 -0
  69. data/rdoc/ESP/Suppression/Signature.html +470 -0
  70. data/rdoc/ESP/Suppression/UniqueIdentifier.html +417 -0
  71. data/rdoc/ESP/Suppression.html +649 -0
  72. data/rdoc/ESP/Tag.html +371 -0
  73. data/rdoc/ESP/Team.html +584 -0
  74. data/rdoc/ESP/User.html +483 -0
  75. data/rdoc/ESP.html +546 -0
  76. data/rdoc/README_md.html +501 -0
  77. data/rdoc/created.rid +30 -0
  78. data/rdoc/images/add.png +0 -0
  79. data/rdoc/images/arrow_up.png +0 -0
  80. data/rdoc/images/brick.png +0 -0
  81. data/rdoc/images/brick_link.png +0 -0
  82. data/rdoc/images/bug.png +0 -0
  83. data/rdoc/images/bullet_black.png +0 -0
  84. data/rdoc/images/bullet_toggle_minus.png +0 -0
  85. data/rdoc/images/bullet_toggle_plus.png +0 -0
  86. data/rdoc/images/date.png +0 -0
  87. data/rdoc/images/delete.png +0 -0
  88. data/rdoc/images/find.png +0 -0
  89. data/rdoc/images/loadingAnimation.gif +0 -0
  90. data/rdoc/images/macFFBgHack.png +0 -0
  91. data/rdoc/images/package.png +0 -0
  92. data/rdoc/images/page_green.png +0 -0
  93. data/rdoc/images/page_white_text.png +0 -0
  94. data/rdoc/images/page_white_width.png +0 -0
  95. data/rdoc/images/plugin.png +0 -0
  96. data/rdoc/images/ruby.png +0 -0
  97. data/rdoc/images/tag_blue.png +0 -0
  98. data/rdoc/images/tag_green.png +0 -0
  99. data/rdoc/images/transparent.png +0 -0
  100. data/rdoc/images/wrench.png +0 -0
  101. data/rdoc/images/wrench_orange.png +0 -0
  102. data/rdoc/images/zoom.png +0 -0
  103. data/rdoc/index.html +134 -0
  104. data/rdoc/js/darkfish.js +155 -0
  105. data/rdoc/js/jquery.js +4 -0
  106. data/rdoc/js/navigation.js +142 -0
  107. data/rdoc/js/search.js +94 -0
  108. data/rdoc/js/search_index.js +1 -0
  109. data/rdoc/js/searcher.js +228 -0
  110. data/rdoc/rdoc.css +595 -0
  111. data/rdoc/table_of_contents.html +927 -0
  112. data/test/esp/extensions/active_resource/formats/json_api_format_test.rb +109 -0
  113. data/test/esp/extensions/active_resource/paginated_collection_test.rb +435 -0
  114. data/test/esp/extensions/active_resource/validations_test.rb +59 -0
  115. data/test/esp/resources/alert_test.rb +263 -0
  116. data/test/esp/resources/cloud_trail_event_test.rb +98 -0
  117. data/test/esp/resources/contact_request_test.rb +73 -0
  118. data/test/esp/resources/custom_signature_test.rb +241 -0
  119. data/test/esp/resources/dashboard_test.rb +71 -0
  120. data/test/esp/resources/external_account_test.rb +125 -0
  121. data/test/esp/resources/organization_test.rb +175 -0
  122. data/test/esp/resources/region_test.rb +84 -0
  123. data/test/esp/resources/report_test.rb +180 -0
  124. data/test/esp/resources/resource_test.rb +183 -0
  125. data/test/esp/resources/service_test.rb +64 -0
  126. data/test/esp/resources/signature_test.rb +177 -0
  127. data/test/esp/resources/stat_custom_signature_test.rb +115 -0
  128. data/test/esp/resources/stat_region_test.rb +114 -0
  129. data/test/esp/resources/stat_service_test.rb +114 -0
  130. data/test/esp/resources/stat_signature_test.rb +115 -0
  131. data/test/esp/resources/stat_test.rb +159 -0
  132. data/test/esp/resources/sub_organization_test.rb +127 -0
  133. data/test/esp/resources/suppression/region_test.rb +115 -0
  134. data/test/esp/resources/suppression/signature_test.rb +117 -0
  135. data/test/esp/resources/suppression/unique_identifier_test.rb +79 -0
  136. data/test/esp/resources/suppression_test.rb +226 -0
  137. data/test/esp/resources/tag_test.rb +98 -0
  138. data/test/esp/resources/team_test.rb +140 -0
  139. data/test/esp/resources/user_test.rb +113 -0
  140. data/test/esp_test.rb +139 -0
  141. data/test/factories/alerts.rb +234 -0
  142. data/test/factories/cloud_trail_events.rb +16 -0
  143. data/test/factories/contact_requests.rb +14 -0
  144. data/test/factories/custom_signatures.rb +30 -0
  145. data/test/factories/dashboards.rb +91 -0
  146. data/test/factories/errors.rb +24 -0
  147. data/test/factories/external_accounts.rb +44 -0
  148. data/test/factories/organizations.rb +48 -0
  149. data/test/factories/regions.rb +9 -0
  150. data/test/factories/reports.rb +56 -0
  151. data/test/factories/services.rb +12 -0
  152. data/test/factories/signatures.rb +28 -0
  153. data/test/factories/stat_custom_signatures.rb +97 -0
  154. data/test/factories/stat_regions.rb +97 -0
  155. data/test/factories/stat_services.rb +97 -0
  156. data/test/factories/stat_signautures.rb +97 -0
  157. data/test/factories/stats.rb +129 -0
  158. data/test/factories/sub_organizations.rb +34 -0
  159. data/test/factories/suppression/regions.rb +90 -0
  160. data/test/factories/suppression/signatures.rb +117 -0
  161. data/test/factories/suppression/unique_identifiers.rb +111 -0
  162. data/test/factories/suppressions.rb +71 -0
  163. data/test/factories/tags.rb +12 -0
  164. data/test/factories/teams.rb +32 -0
  165. data/test/factories/users.rb +54 -0
  166. data/test/json_strategy.rb +25 -0
  167. data/test/test_helper.rb +44 -5
  168. metadata +387 -119
  169. data/bin/esp_repl +0 -60
  170. data/lib/esp_sdk/api.rb +0 -33
  171. data/lib/esp_sdk/client.rb +0 -62
  172. data/lib/esp_sdk/configure.rb +0 -40
  173. data/lib/esp_sdk/end_points/base.rb +0 -102
  174. data/lib/esp_sdk/end_points/contact_requests.rb +0 -6
  175. data/lib/esp_sdk/end_points/custom_signatures.rb +0 -41
  176. data/lib/esp_sdk/end_points/dashboard.rb +0 -35
  177. data/lib/esp_sdk/end_points/external_accounts.rb +0 -9
  178. data/lib/esp_sdk/end_points/organizations.rb +0 -6
  179. data/lib/esp_sdk/end_points/reports.rb +0 -6
  180. data/lib/esp_sdk/end_points/services.rb +0 -6
  181. data/lib/esp_sdk/end_points/signatures.rb +0 -39
  182. data/lib/esp_sdk/end_points/sub_organizations.rb +0 -6
  183. data/lib/esp_sdk/end_points/teams.rb +0 -6
  184. data/lib/esp_sdk/end_points/users.rb +0 -6
  185. data/lib/esp_sdk/exceptions.rb +0 -8
  186. data/lib/esp_sdk/extensions/rest_client/request.rb +0 -9
  187. data/lib/esp_sdk/repl.rb +0 -61
  188. data/lib/esp_sdk/version.rb +0 -3
  189. data/test/esp_sdk/api_test.rb +0 -36
  190. data/test/esp_sdk/client_test.rb +0 -129
  191. data/test/esp_sdk/configure_test.rb +0 -65
  192. data/test/esp_sdk/end_points/.keep +0 -0
  193. data/test/esp_sdk/end_points/base_test.rb +0 -230
  194. data/test/esp_sdk/end_points/custom_signatures_test.rb +0 -90
  195. data/test/esp_sdk/end_points/dashboard_test.rb +0 -55
  196. data/test/esp_sdk/end_points/external_accounts_test.rb +0 -20
  197. data/test/esp_sdk/end_points/signatures_test.rb +0 -83
  198. data/test/esp_sdk/exceptions_test.rb +0 -41
  199. data/test/esp_sdk_test.rb +0 -70
data/rdoc/ESP.html ADDED
@@ -0,0 +1,546 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>module ESP - ESPSDK</title>
8
+
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="module">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+
47
+
48
+ <div id="file-metadata">
49
+ <nav id="file-list-section" class="section">
50
+ <h3 class="section-header">Defined In</h3>
51
+ <ul>
52
+ <li>lib/esp.rb
53
+ <li>lib/esp/resources/alert.rb
54
+ <li>lib/esp/resources/cloud_trail_event.rb
55
+ <li>lib/esp/resources/concerns/stat_totals.rb
56
+ <li>lib/esp/resources/contact_request.rb
57
+ <li>lib/esp/resources/custom_signature.rb
58
+ <li>lib/esp/resources/dashboard.rb
59
+ <li>lib/esp/resources/external_account.rb
60
+ <li>lib/esp/resources/organization.rb
61
+ <li>lib/esp/resources/region.rb
62
+ <li>lib/esp/resources/report.rb
63
+ <li>lib/esp/resources/resource.rb
64
+ <li>lib/esp/resources/service.rb
65
+ <li>lib/esp/resources/signature.rb
66
+ <li>lib/esp/resources/stat.rb
67
+ <li>lib/esp/resources/stat_custom_signature.rb
68
+ <li>lib/esp/resources/stat_region.rb
69
+ <li>lib/esp/resources/stat_service.rb
70
+ <li>lib/esp/resources/stat_signature.rb
71
+ <li>lib/esp/resources/sub_organization.rb
72
+ <li>lib/esp/resources/suppression.rb
73
+ <li>lib/esp/resources/suppression/region.rb
74
+ <li>lib/esp/resources/suppression/signature.rb
75
+ <li>lib/esp/resources/suppression/unique_identifier.rb
76
+ <li>lib/esp/resources/tag.rb
77
+ <li>lib/esp/resources/team.rb
78
+ <li>lib/esp/resources/user.rb
79
+ </ul>
80
+ </nav>
81
+
82
+
83
+ </div>
84
+
85
+ <div id="class-metadata">
86
+
87
+
88
+
89
+
90
+ <!-- Method Quickref -->
91
+ <nav id="method-list-section" class="section">
92
+ <h3 class="section-header">Methods</h3>
93
+
94
+ <ul class="link-list">
95
+
96
+ <li ><a href="#method-c-access_key_id">::access_key_id</a>
97
+
98
+ <li ><a href="#method-c-access_key_id-3D">::access_key_id=</a>
99
+
100
+ <li ><a href="#method-c-configure">::configure</a>
101
+
102
+ <li ><a href="#method-c-env">::env</a>
103
+
104
+ <li ><a href="#method-c-host-3D">::host=</a>
105
+
106
+ <li ><a href="#method-c-secret_access_key">::secret_access_key</a>
107
+
108
+ <li ><a href="#method-c-secret_access_key-3D">::secret_access_key=</a>
109
+
110
+ <li ><a href="#method-c-site">::site</a>
111
+
112
+ </ul>
113
+ </nav>
114
+
115
+ </div>
116
+
117
+ <div id="project-metadata">
118
+ <nav id="fileindex-section" class="section project-section">
119
+ <h3 class="section-header">Pages</h3>
120
+
121
+ <ul>
122
+
123
+ <li class="file"><a href="./README_md.html">README</a>
124
+
125
+ </ul>
126
+ </nav>
127
+
128
+ <nav id="classindex-section" class="section project-section">
129
+ <h3 class="section-header">Class and Module Index</h3>
130
+
131
+ <ul class="link-list">
132
+
133
+ <li><a href="./ActiveResource.html">ActiveResource</a>
134
+
135
+ <li><a href="./ActiveResource/Formats.html">ActiveResource::Formats</a>
136
+
137
+ <li><a href="./ActiveResource/PaginatedCollection.html">ActiveResource::PaginatedCollection</a>
138
+
139
+ <li><a href="./ESP.html">ESP</a>
140
+
141
+ <li><a href="./ESP/Alert.html">ESP::Alert</a>
142
+
143
+ <li><a href="./ESP/CloudTrailEvent.html">ESP::CloudTrailEvent</a>
144
+
145
+ <li><a href="./ESP/ContactRequest.html">ESP::ContactRequest</a>
146
+
147
+ <li><a href="./ESP/CustomSignature.html">ESP::CustomSignature</a>
148
+
149
+ <li><a href="./ESP/Dashboard.html">ESP::Dashboard</a>
150
+
151
+ <li><a href="./ESP/ExternalAccount.html">ESP::ExternalAccount</a>
152
+
153
+ <li><a href="./ESP/Organization.html">ESP::Organization</a>
154
+
155
+ <li><a href="./ESP/Region.html">ESP::Region</a>
156
+
157
+ <li><a href="./ESP/Report.html">ESP::Report</a>
158
+
159
+ <li><a href="./ESP/Service.html">ESP::Service</a>
160
+
161
+ <li><a href="./ESP/Signature.html">ESP::Signature</a>
162
+
163
+ <li><a href="./ESP/Stat.html">ESP::Stat</a>
164
+
165
+ <li><a href="./ESP/StatCustomSignature.html">ESP::StatCustomSignature</a>
166
+
167
+ <li><a href="./ESP/StatRegion.html">ESP::StatRegion</a>
168
+
169
+ <li><a href="./ESP/StatService.html">ESP::StatService</a>
170
+
171
+ <li><a href="./ESP/StatSignature.html">ESP::StatSignature</a>
172
+
173
+ <li><a href="./ESP/SubOrganization.html">ESP::SubOrganization</a>
174
+
175
+ <li><a href="./ESP/Suppression.html">ESP::Suppression</a>
176
+
177
+ <li><a href="./ESP/Suppression/Region.html">ESP::Suppression::Region</a>
178
+
179
+ <li><a href="./ESP/Suppression/Signature.html">ESP::Suppression::Signature</a>
180
+
181
+ <li><a href="./ESP/Suppression/UniqueIdentifier.html">ESP::Suppression::UniqueIdentifier</a>
182
+
183
+ <li><a href="./ESP/Tag.html">ESP::Tag</a>
184
+
185
+ <li><a href="./ESP/Team.html">ESP::Team</a>
186
+
187
+ <li><a href="./ESP/User.html">ESP::User</a>
188
+
189
+ </ul>
190
+ </nav>
191
+
192
+ </div>
193
+ </nav>
194
+
195
+ <div id="documentation">
196
+ <h1 class="module">module ESP</h1>
197
+
198
+ <div id="description" class="description">
199
+
200
+ </div><!-- description -->
201
+
202
+
203
+
204
+
205
+ <section id="5Buntitled-5D" class="documentation-section">
206
+
207
+
208
+
209
+
210
+
211
+ <!-- Constants -->
212
+ <section id="constants-list" class="section">
213
+ <h3 class="section-header">Constants</h3>
214
+ <dl>
215
+
216
+ <dt id="PATH">PATH
217
+
218
+ <dd class="description">
219
+
220
+
221
+ </dl>
222
+ </section>
223
+
224
+
225
+
226
+
227
+ <!-- Methods -->
228
+
229
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
230
+ <h3 class="section-header">Public Class Methods</h3>
231
+
232
+
233
+ <div id="method-c-access_key_id" class="method-detail ">
234
+
235
+ <div class="method-heading">
236
+ <span class="method-name">access_key_id</span><span
237
+ class="method-args">()</span>
238
+
239
+ <span class="method-click-advice">click to toggle source</span>
240
+
241
+ </div>
242
+
243
+
244
+ <div class="method-description">
245
+
246
+ <p>Reads the `ESP_ACCESS_KEY_ID` environment variable if <a
247
+ href="ESP.html#method-c-access_key_id">::access_key_id</a> was not set
248
+ manually.</p>
249
+
250
+
251
+
252
+
253
+ <div class="method-source-code" id="access_key_id-source">
254
+ <pre><span class="ruby-comment"># File lib/esp.rb, line 11</span>
255
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">access_key_id</span>
256
+ <span class="ruby-ivar">@access_key_id</span> <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;ESP_ACCESS_KEY_ID&#39;</span>]
257
+ <span class="ruby-keyword">end</span></pre>
258
+ </div><!-- access_key_id-source -->
259
+
260
+ </div>
261
+
262
+
263
+
264
+
265
+ </div><!-- access_key_id-method -->
266
+
267
+
268
+ <div id="method-c-access_key_id-3D" class="method-detail ">
269
+
270
+ <div class="method-heading">
271
+ <span class="method-name">access_key_id=</span><span
272
+ class="method-args">(access_key_id)</span>
273
+
274
+ <span class="method-click-advice">click to toggle source</span>
275
+
276
+ </div>
277
+
278
+
279
+ <div class="method-description">
280
+
281
+ <p>Manually set the <a
282
+ href="ESP.html#method-c-access_key_id">::access_key_id</a> you created from
283
+ <a
284
+ href="https://esp.evident.io/settings/api_keys">esp.evident.io/settings/api_keys</a>.</p>
285
+
286
+ <p>You can optionally set the `ESP_ACCESS_KEY_ID` environment variable.</p>
287
+
288
+
289
+
290
+
291
+ <div class="method-source-code" id="access_key_id-3D-source">
292
+ <pre><span class="ruby-comment"># File lib/esp.rb, line 5</span>
293
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">access_key_id=</span>(<span class="ruby-identifier">access_key_id</span>)
294
+ <span class="ruby-ivar">@access_key_id</span> = <span class="ruby-identifier">access_key_id</span>
295
+ <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">Resource</span>.<span class="ruby-identifier">hmac_access_id</span> = <span class="ruby-identifier">access_key_id</span>
296
+ <span class="ruby-keyword">end</span></pre>
297
+ </div><!-- access_key_id-3D-source -->
298
+
299
+ </div>
300
+
301
+
302
+
303
+
304
+ </div><!-- access_key_id-3D-method -->
305
+
306
+
307
+ <div id="method-c-configure" class="method-detail ">
308
+
309
+ <div class="method-heading">
310
+ <span class="method-name">configure</span><span
311
+ class="method-args">() { |self| ... }</span>
312
+
313
+ <span class="method-click-advice">click to toggle source</span>
314
+
315
+ </div>
316
+
317
+
318
+ <div class="method-description">
319
+
320
+ <p>For use in a Rails initializer to set the <a
321
+ href="ESP.html#method-c-access_key_id">::access_key_id</a>, <a
322
+ href="ESP.html#method-c-secret_access_key">::secret_access_key</a> and <a
323
+ href="ESP.html#method-c-site">::site</a>.</p>
324
+
325
+ <h4 id="method-c-configure-label-Example">Example<span><a href="#method-c-configure-label-Example">&para;</a> <a href="#documentation">&uarr;</a></span></h4>
326
+
327
+ <pre class="ruby"><span class="ruby-constant">ESP</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">config</span><span class="ruby-operator">|</span>
328
+ <span class="ruby-identifier">config</span>.<span class="ruby-identifier">access_key_id</span> = <span class="ruby-operator">&lt;</span><span class="ruby-identifier">your</span> <span class="ruby-identifier">key</span><span class="ruby-operator">&gt;</span>
329
+ <span class="ruby-identifier">config</span>.<span class="ruby-identifier">secret_access_key</span> = <span class="ruby-operator">&lt;</span><span class="ruby-identifier">your</span> <span class="ruby-identifier">secret</span> <span class="ruby-identifier">key</span><span class="ruby-operator">&gt;</span>
330
+ <span class="ruby-identifier">config</span>.<span class="ruby-identifier">host</span> = <span class="ruby-operator">&lt;</span><span class="ruby-identifier">host</span> <span class="ruby-identifier">of</span> <span class="ruby-identifier">your</span> <span class="ruby-identifier">appliance</span> <span class="ruby-identifier">instance</span><span class="ruby-operator">&gt;</span>
331
+ <span class="ruby-keyword">end</span>
332
+ </pre>
333
+
334
+
335
+
336
+
337
+ <div class="method-source-code" id="configure-source">
338
+ <pre><span class="ruby-comment"># File lib/esp.rb, line 58</span>
339
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">configure</span>
340
+ <span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span>
341
+ <span class="ruby-keyword">end</span></pre>
342
+ </div><!-- configure-source -->
343
+
344
+ </div>
345
+
346
+
347
+
348
+
349
+ </div><!-- configure-method -->
350
+
351
+
352
+ <div id="method-c-env" class="method-detail ">
353
+
354
+ <div class="method-heading">
355
+ <span class="method-name">env</span><span
356
+ class="method-args">()</span>
357
+
358
+ <span class="method-click-advice">click to toggle source</span>
359
+
360
+ </div>
361
+
362
+
363
+ <div class="method-description">
364
+
365
+ <p>Default environment is production which will set <a
366
+ href="ESP.html#method-c-site">::site</a> to “<a
367
+ href="https://api.evident.io/api/v2">api.evident.io/api/v2</a>”.</p>
368
+
369
+
370
+
371
+
372
+ <div class="method-source-code" id="env-source">
373
+ <pre><span class="ruby-comment"># File lib/esp.rb, line 63</span>
374
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">env</span>
375
+ <span class="ruby-ivar">@env</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">StringInquirer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;ESP_ENV&#39;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;RAILS_ENV&#39;</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&#39;production&#39;</span>)
376
+ <span class="ruby-keyword">end</span></pre>
377
+ </div><!-- env-source -->
378
+
379
+ </div>
380
+
381
+
382
+
383
+
384
+ </div><!-- env-method -->
385
+
386
+
387
+ <div id="method-c-host-3D" class="method-detail ">
388
+
389
+ <div class="method-heading">
390
+ <span class="method-name">host=</span><span
391
+ class="method-args">(host)</span>
392
+
393
+ <span class="method-click-advice">click to toggle source</span>
394
+
395
+ </div>
396
+
397
+
398
+ <div class="method-description">
399
+
400
+ <p>Users of the Evident.io marketplace appliance application will need to set
401
+ the host for their instance.</p>
402
+
403
+ <h4 id="method-c-host-3D-label-Attribute">Attribute<span><a href="#method-c-host-3D-label-Attribute">&para;</a> <a href="#documentation">&uarr;</a></span></h4>
404
+ <ul><li>
405
+ <p><code>host</code> - The host for the installed appliance instance.</p>
406
+ </li></ul>
407
+
408
+
409
+
410
+
411
+ <div class="method-source-code" id="host-3D-source">
412
+ <pre><span class="ruby-comment"># File lib/esp.rb, line 39</span>
413
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">host=</span>(<span class="ruby-identifier">host</span>)
414
+ <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
415
+ <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">Resource</span>.<span class="ruby-identifier">site</span> = <span class="ruby-identifier">site</span>
416
+ <span class="ruby-keyword">end</span></pre>
417
+ </div><!-- host-3D-source -->
418
+
419
+ </div>
420
+
421
+
422
+
423
+
424
+ </div><!-- host-3D-method -->
425
+
426
+
427
+ <div id="method-c-secret_access_key" class="method-detail ">
428
+
429
+ <div class="method-heading">
430
+ <span class="method-name">secret_access_key</span><span
431
+ class="method-args">()</span>
432
+
433
+ <span class="method-click-advice">click to toggle source</span>
434
+
435
+ </div>
436
+
437
+
438
+ <div class="method-description">
439
+
440
+ <p>Reads the `ESP_SECRET_ACCESS_KEY` environment variable if <a
441
+ href="ESP.html#method-c-secret_access_key">::secret_access_key</a> was not
442
+ set manually.</p>
443
+
444
+
445
+
446
+
447
+ <div class="method-source-code" id="secret_access_key-source">
448
+ <pre><span class="ruby-comment"># File lib/esp.rb, line 24</span>
449
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">secret_access_key</span>
450
+ <span class="ruby-ivar">@secret_access_key</span> <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;ESP_SECRET_ACCESS_KEY&#39;</span>]
451
+ <span class="ruby-keyword">end</span></pre>
452
+ </div><!-- secret_access_key-source -->
453
+
454
+ </div>
455
+
456
+
457
+
458
+
459
+ </div><!-- secret_access_key-method -->
460
+
461
+
462
+ <div id="method-c-secret_access_key-3D" class="method-detail ">
463
+
464
+ <div class="method-heading">
465
+ <span class="method-name">secret_access_key=</span><span
466
+ class="method-args">(secret_access_key)</span>
467
+
468
+ <span class="method-click-advice">click to toggle source</span>
469
+
470
+ </div>
471
+
472
+
473
+ <div class="method-description">
474
+
475
+ <p>Manually set the <a
476
+ href="ESP.html#method-c-secret_access_key">::secret_access_key</a> you
477
+ created from <a
478
+ href="https://esp.evident.io/settings/api_keys">esp.evident.io/settings/api_keys</a>.</p>
479
+
480
+ <p>You can optionally set the `ESP_SECRET_ACCESS_KEY` environment variable.</p>
481
+
482
+
483
+
484
+
485
+ <div class="method-source-code" id="secret_access_key-3D-source">
486
+ <pre><span class="ruby-comment"># File lib/esp.rb, line 18</span>
487
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">secret_access_key=</span>(<span class="ruby-identifier">secret_access_key</span>)
488
+ <span class="ruby-ivar">@secret_access_key</span> = <span class="ruby-identifier">secret_access_key</span>
489
+ <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">Resource</span>.<span class="ruby-identifier">hmac_secret_key</span> = <span class="ruby-identifier">secret_access_key</span>
490
+ <span class="ruby-keyword">end</span></pre>
491
+ </div><!-- secret_access_key-3D-source -->
492
+
493
+ </div>
494
+
495
+
496
+
497
+
498
+ </div><!-- secret_access_key-3D-method -->
499
+
500
+
501
+ <div id="method-c-site" class="method-detail ">
502
+
503
+ <div class="method-heading">
504
+ <span class="method-name">site</span><span
505
+ class="method-args">()</span>
506
+
507
+ <span class="method-click-advice">click to toggle source</span>
508
+
509
+ </div>
510
+
511
+
512
+ <div class="method-description">
513
+
514
+ <p>The site the SDK will hit.</p>
515
+
516
+
517
+
518
+
519
+ <div class="method-source-code" id="site-source">
520
+ <pre><span class="ruby-comment"># File lib/esp.rb, line 45</span>
521
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">site</span>
522
+ <span class="ruby-node">&quot;#{(@host || HOST[ESP.env.to_sym] || ENV[&#39;ESP_HOST&#39;])}#{PATH}&quot;</span>
523
+ <span class="ruby-keyword">end</span></pre>
524
+ </div><!-- site-source -->
525
+
526
+ </div>
527
+
528
+
529
+
530
+
531
+ </div><!-- site-method -->
532
+
533
+
534
+ </section><!-- public-class-method-details -->
535
+
536
+ </section><!-- 5Buntitled-5D -->
537
+
538
+ </div><!-- documentation -->
539
+
540
+
541
+ <footer id="validator-badges">
542
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
543
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
544
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
545
+ </footer>
546
+