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