esp_sdk 2.0.0 → 2.1.0
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 +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/Signature.html
DELETED
|
@@ -1,557 +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>class ESP::Signature - 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="class">
|
|
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/resources/signature.rb
|
|
53
|
-
</ul>
|
|
54
|
-
</nav>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<div id="class-metadata">
|
|
60
|
-
|
|
61
|
-
<nav id="parent-class-section" class="section">
|
|
62
|
-
<h3 class="section-header">Parent</h3>
|
|
63
|
-
|
|
64
|
-
<p class="link">ESP::Resource
|
|
65
|
-
|
|
66
|
-
</nav>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<!-- Method Quickref -->
|
|
71
|
-
<nav id="method-list-section" class="section">
|
|
72
|
-
<h3 class="section-header">Methods</h3>
|
|
73
|
-
|
|
74
|
-
<ul class="link-list">
|
|
75
|
-
|
|
76
|
-
<li ><a href="#method-c-all">::all</a>
|
|
77
|
-
|
|
78
|
-
<li ><a href="#method-c-find">::find</a>
|
|
79
|
-
|
|
80
|
-
<li ><a href="#method-i-destroy">#destroy</a>
|
|
81
|
-
|
|
82
|
-
<li ><a href="#method-i-run">#run</a>
|
|
83
|
-
|
|
84
|
-
<li ><a href="#method-i-run-21">#run!</a>
|
|
85
|
-
|
|
86
|
-
<li ><a href="#method-i-save">#save</a>
|
|
87
|
-
|
|
88
|
-
<li ><a href="#method-i-service">#service</a>
|
|
89
|
-
|
|
90
|
-
<li ><a href="#method-i-suppress">#suppress</a>
|
|
91
|
-
|
|
92
|
-
</ul>
|
|
93
|
-
</nav>
|
|
94
|
-
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<div id="project-metadata">
|
|
98
|
-
<nav id="fileindex-section" class="section project-section">
|
|
99
|
-
<h3 class="section-header">Pages</h3>
|
|
100
|
-
|
|
101
|
-
<ul>
|
|
102
|
-
|
|
103
|
-
<li class="file"><a href="../README_md.html">README</a>
|
|
104
|
-
|
|
105
|
-
</ul>
|
|
106
|
-
</nav>
|
|
107
|
-
|
|
108
|
-
<nav id="classindex-section" class="section project-section">
|
|
109
|
-
<h3 class="section-header">Class and Module Index</h3>
|
|
110
|
-
|
|
111
|
-
<ul class="link-list">
|
|
112
|
-
|
|
113
|
-
<li><a href="../ActiveResource.html">ActiveResource</a>
|
|
114
|
-
|
|
115
|
-
<li><a href="../ActiveResource/Formats.html">ActiveResource::Formats</a>
|
|
116
|
-
|
|
117
|
-
<li><a href="../ActiveResource/PaginatedCollection.html">ActiveResource::PaginatedCollection</a>
|
|
118
|
-
|
|
119
|
-
<li><a href="../ESP.html">ESP</a>
|
|
120
|
-
|
|
121
|
-
<li><a href="../ESP/Alert.html">ESP::Alert</a>
|
|
122
|
-
|
|
123
|
-
<li><a href="../ESP/CloudTrailEvent.html">ESP::CloudTrailEvent</a>
|
|
124
|
-
|
|
125
|
-
<li><a href="../ESP/ContactRequest.html">ESP::ContactRequest</a>
|
|
126
|
-
|
|
127
|
-
<li><a href="../ESP/CustomSignature.html">ESP::CustomSignature</a>
|
|
128
|
-
|
|
129
|
-
<li><a href="../ESP/Dashboard.html">ESP::Dashboard</a>
|
|
130
|
-
|
|
131
|
-
<li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
|
|
132
|
-
|
|
133
|
-
<li><a href="../ESP/Metadata.html">ESP::Metadata</a>
|
|
134
|
-
|
|
135
|
-
<li><a href="../ESP/Organization.html">ESP::Organization</a>
|
|
136
|
-
|
|
137
|
-
<li><a href="../ESP/Region.html">ESP::Region</a>
|
|
138
|
-
|
|
139
|
-
<li><a href="../ESP/Report.html">ESP::Report</a>
|
|
140
|
-
|
|
141
|
-
<li><a href="../ESP/Service.html">ESP::Service</a>
|
|
142
|
-
|
|
143
|
-
<li><a href="../ESP/Signature.html">ESP::Signature</a>
|
|
144
|
-
|
|
145
|
-
<li><a href="../ESP/Stat.html">ESP::Stat</a>
|
|
146
|
-
|
|
147
|
-
<li><a href="../ESP/StatCustomSignature.html">ESP::StatCustomSignature</a>
|
|
148
|
-
|
|
149
|
-
<li><a href="../ESP/StatRegion.html">ESP::StatRegion</a>
|
|
150
|
-
|
|
151
|
-
<li><a href="../ESP/StatService.html">ESP::StatService</a>
|
|
152
|
-
|
|
153
|
-
<li><a href="../ESP/StatSignature.html">ESP::StatSignature</a>
|
|
154
|
-
|
|
155
|
-
<li><a href="../ESP/SubOrganization.html">ESP::SubOrganization</a>
|
|
156
|
-
|
|
157
|
-
<li><a href="../ESP/Suppression.html">ESP::Suppression</a>
|
|
158
|
-
|
|
159
|
-
<li><a href="../ESP/Suppression/Region.html">ESP::Suppression::Region</a>
|
|
160
|
-
|
|
161
|
-
<li><a href="../ESP/Suppression/Signature.html">ESP::Suppression::Signature</a>
|
|
162
|
-
|
|
163
|
-
<li><a href="../ESP/Suppression/UniqueIdentifier.html">ESP::Suppression::UniqueIdentifier</a>
|
|
164
|
-
|
|
165
|
-
<li><a href="../ESP/Tag.html">ESP::Tag</a>
|
|
166
|
-
|
|
167
|
-
<li><a href="../ESP/Team.html">ESP::Team</a>
|
|
168
|
-
|
|
169
|
-
<li><a href="../ESP/User.html">ESP::User</a>
|
|
170
|
-
|
|
171
|
-
</ul>
|
|
172
|
-
</nav>
|
|
173
|
-
|
|
174
|
-
</div>
|
|
175
|
-
</nav>
|
|
176
|
-
|
|
177
|
-
<div id="documentation">
|
|
178
|
-
<h1 class="class">class ESP::Signature</h1>
|
|
179
|
-
|
|
180
|
-
<div id="description" class="description">
|
|
181
|
-
|
|
182
|
-
</div><!-- description -->
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
<!-- Methods -->
|
|
197
|
-
|
|
198
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
|
199
|
-
<h3 class="section-header">Public Class Methods</h3>
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<div id="method-c-all" class="method-detail ">
|
|
203
|
-
|
|
204
|
-
<div class="method-heading">
|
|
205
|
-
<span class="method-name">all</span><span
|
|
206
|
-
class="method-args">()</span>
|
|
207
|
-
|
|
208
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
209
|
-
|
|
210
|
-
</div>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
<div class="method-description">
|
|
214
|
-
|
|
215
|
-
<p>Return a paginated <a href="Signature.html">Signature</a> list</p>
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
<div class="method-source-code" id="all-source">
|
|
221
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/signature.rb, line 105</span>
|
|
222
|
-
</pre>
|
|
223
|
-
</div><!-- all-source -->
|
|
224
|
-
|
|
225
|
-
</div>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
</div><!-- all-method -->
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
<div id="method-c-find" class="method-detail ">
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
<div class="method-heading">
|
|
237
|
-
<span class="method-callseq">
|
|
238
|
-
find(id)
|
|
239
|
-
</span>
|
|
240
|
-
|
|
241
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
242
|
-
|
|
243
|
-
</div>
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
<div class="method-description">
|
|
248
|
-
|
|
249
|
-
<p>Find a <a href="Signature.html">Signature</a> by id</p>
|
|
250
|
-
|
|
251
|
-
<h4 id="method-c-find-label-Parameter">Parameter<span><a href="#method-c-find-label-Parameter">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
252
|
-
|
|
253
|
-
<p><code>id</code> | Required | The ID of the signature to retrieve</p>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
<div class="method-source-code" id="find-source">
|
|
259
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/signature.rb, line 103</span>
|
|
260
|
-
</pre>
|
|
261
|
-
</div><!-- find-source -->
|
|
262
|
-
|
|
263
|
-
</div>
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
</div><!-- find-method -->
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
</section><!-- public-class-method-details -->
|
|
272
|
-
|
|
273
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
|
274
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
<div id="method-i-destroy" class="method-detail ">
|
|
278
|
-
|
|
279
|
-
<div class="method-heading">
|
|
280
|
-
<span class="method-name">destroy</span><span
|
|
281
|
-
class="method-args">()</span>
|
|
282
|
-
|
|
283
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
284
|
-
|
|
285
|
-
</div>
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
<div class="method-description">
|
|
289
|
-
|
|
290
|
-
<p>Not Implemented. You cannot destroy a <a
|
|
291
|
-
href="Signature.html">Signature</a>.</p>
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
<div class="method-source-code" id="destroy-source">
|
|
297
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/signature.rb, line 13</span>
|
|
298
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">destroy</span>
|
|
299
|
-
<span class="ruby-identifier">fail</span> <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">NotImplementedError</span>
|
|
300
|
-
<span class="ruby-keyword">end</span></pre>
|
|
301
|
-
</div><!-- destroy-source -->
|
|
302
|
-
|
|
303
|
-
</div>
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
</div><!-- destroy-method -->
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
<div id="method-i-run" class="method-detail ">
|
|
312
|
-
|
|
313
|
-
<div class="method-heading">
|
|
314
|
-
<span class="method-name">run</span><span
|
|
315
|
-
class="method-args">(arguments = {})</span>
|
|
316
|
-
|
|
317
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
318
|
-
|
|
319
|
-
</div>
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
<div class="method-description">
|
|
323
|
-
|
|
324
|
-
<p>Run this signature. Returns a collection of alerts. If not successful,
|
|
325
|
-
returns a <a href="Signature.html">Signature</a> object with the errors
|
|
326
|
-
object populated.</p>
|
|
327
|
-
|
|
328
|
-
<h4 id="method-i-run-label-Parameters">Parameters<span><a href="#method-i-run-label-Parameters">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
329
|
-
|
|
330
|
-
<p><code>arguments</code> | Required | A hash of run arguments</p>
|
|
331
|
-
|
|
332
|
-
<h5 id="method-i-run-label-Valid+Arguments">Valid Arguments<span><a href="#method-i-run-label-Valid+Arguments">¶</a> <a href="#documentation">↑</a></span></h5>
|
|
333
|
-
|
|
334
|
-
<p><code>external_account_id</code> | Required | The ID of the external
|
|
335
|
-
account to run this custom signature against</p>
|
|
336
|
-
|
|
337
|
-
<p><code>region</code> | Required | <a href="Region.html">Region</a> name to
|
|
338
|
-
run this custom signature against</p>
|
|
339
|
-
|
|
340
|
-
<h4 id="method-i-run-label-Example">Example<span><a href="#method-i-run-label-Example">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
341
|
-
|
|
342
|
-
<pre>signature = ESP::Signature.find(3)
|
|
343
|
-
alerts = signature.run(external_account_id: 3, region: 'us_east_1')</pre>
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
<div class="method-source-code" id="run-source">
|
|
349
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/signature.rb, line 58</span>
|
|
350
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">arguments</span> = {})
|
|
351
|
-
<span class="ruby-identifier">arguments</span> = <span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">with_indifferent_access</span>
|
|
352
|
-
<span class="ruby-identifier">attributes</span>[<span class="ruby-string">'external_account_id'</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">arguments</span>[<span class="ruby-value">:external_account_id</span>]
|
|
353
|
-
<span class="ruby-identifier">attributes</span>[<span class="ruby-string">'region'</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">arguments</span>[<span class="ruby-value">:region</span>]
|
|
354
|
-
|
|
355
|
-
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">post</span>(<span class="ruby-node">"#{self.class.prefix}signatures/#{id}/run.json"</span>, <span class="ruby-identifier">to_json</span>)
|
|
356
|
-
<span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">Alert</span>.<span class="ruby-identifier">send</span>(<span class="ruby-value">:instantiate_collection</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">format</span>.<span class="ruby-identifier">decode</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>))
|
|
357
|
-
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">ActiveResource</span><span class="ruby-operator">::</span><span class="ruby-constant">BadRequest</span>, <span class="ruby-constant">ActiveResource</span><span class="ruby-operator">::</span><span class="ruby-constant">ResourceInvalid</span>, <span class="ruby-constant">ActiveResource</span><span class="ruby-operator">::</span><span class="ruby-constant">ResourceNotFound</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">error</span>
|
|
358
|
-
<span class="ruby-identifier">load_remote_errors</span>(<span class="ruby-identifier">error</span>, <span class="ruby-keyword">true</span>)
|
|
359
|
-
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">code</span> = <span class="ruby-identifier">error</span>.<span class="ruby-identifier">response</span>.<span class="ruby-identifier">code</span>
|
|
360
|
-
<span class="ruby-keyword">self</span>
|
|
361
|
-
<span class="ruby-keyword">end</span></pre>
|
|
362
|
-
</div><!-- run-source -->
|
|
363
|
-
|
|
364
|
-
</div>
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
</div><!-- run-method -->
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
<div id="method-i-run-21" class="method-detail ">
|
|
373
|
-
|
|
374
|
-
<div class="method-heading">
|
|
375
|
-
<span class="method-name">run!</span><span
|
|
376
|
-
class="method-args">(arguments = {})</span>
|
|
377
|
-
|
|
378
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
379
|
-
|
|
380
|
-
</div>
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
<div class="method-description">
|
|
384
|
-
|
|
385
|
-
<p>Run this signature. Returns a collection of alerts. Throws an error if not
|
|
386
|
-
successful.</p>
|
|
387
|
-
|
|
388
|
-
<h4 id="method-i-run-21-label-Parameters">Parameters<span><a href="#method-i-run-21-label-Parameters">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
389
|
-
|
|
390
|
-
<p><code>arguments</code> | Required | A hash of run arguments</p>
|
|
391
|
-
|
|
392
|
-
<h5 id="method-i-run-21-label-Valid+Arguments">Valid Arguments<span><a href="#method-i-run-21-label-Valid+Arguments">¶</a> <a href="#documentation">↑</a></span></h5>
|
|
393
|
-
|
|
394
|
-
<p><code>external_account_id</code> | Required | The ID of the external
|
|
395
|
-
account to run this custom signature against</p>
|
|
396
|
-
|
|
397
|
-
<p><code>region</code> | Required | <a href="Region.html">Region</a> name to
|
|
398
|
-
run this custom signature against</p>
|
|
399
|
-
|
|
400
|
-
<h4 id="method-i-run-21-label-Example">Example<span><a href="#method-i-run-21-label-Example">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
401
|
-
|
|
402
|
-
<pre>signature = ESP::Signature.find(3)
|
|
403
|
-
alerts = signature.run!(external_account_id: 3, region: 'us_east_1')</pre>
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
<div class="method-source-code" id="run-21-source">
|
|
409
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/signature.rb, line 34</span>
|
|
410
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">run!</span>(<span class="ruby-identifier">arguments</span> = {})
|
|
411
|
-
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">run</span>(<span class="ruby-identifier">arguments</span>)
|
|
412
|
-
<span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ActiveResource</span><span class="ruby-operator">::</span><span class="ruby-constant">Collection</span>)
|
|
413
|
-
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">message</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">full_messages</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
|
|
414
|
-
<span class="ruby-identifier">fail</span>(<span class="ruby-constant">ActiveResource</span><span class="ruby-operator">::</span><span class="ruby-constant">ResourceInvalid</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>)) <span class="ruby-comment"># rubocop:disable Style/RaiseArgs</span>
|
|
415
|
-
<span class="ruby-keyword">end</span></pre>
|
|
416
|
-
</div><!-- run-21-source -->
|
|
417
|
-
|
|
418
|
-
</div>
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
</div><!-- run-21-method -->
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
<div id="method-i-save" class="method-detail ">
|
|
427
|
-
|
|
428
|
-
<div class="method-heading">
|
|
429
|
-
<span class="method-name">save</span><span
|
|
430
|
-
class="method-args">()</span>
|
|
431
|
-
|
|
432
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
433
|
-
|
|
434
|
-
</div>
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
<div class="method-description">
|
|
438
|
-
|
|
439
|
-
<p>Not Implemented. You cannot create or update a <a
|
|
440
|
-
href="Signature.html">Signature</a>.</p>
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
<div class="method-source-code" id="save-source">
|
|
446
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/signature.rb, line 8</span>
|
|
447
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">save</span>
|
|
448
|
-
<span class="ruby-identifier">fail</span> <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">NotImplementedError</span>
|
|
449
|
-
<span class="ruby-keyword">end</span></pre>
|
|
450
|
-
</div><!-- save-source -->
|
|
451
|
-
|
|
452
|
-
</div>
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
</div><!-- save-method -->
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
<div id="method-i-service" class="method-detail ">
|
|
461
|
-
|
|
462
|
-
<div class="method-heading">
|
|
463
|
-
<span class="method-name">service</span><span
|
|
464
|
-
class="method-args">()</span>
|
|
465
|
-
|
|
466
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
467
|
-
|
|
468
|
-
</div>
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
<div class="method-description">
|
|
472
|
-
|
|
473
|
-
<p>The service this signature belongs to.</p>
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
<div class="method-source-code" id="service-source">
|
|
479
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/signature.rb, line 5</span>
|
|
480
|
-
<span class="ruby-identifier">belongs_to</span> <span class="ruby-value">:service</span>, <span class="ruby-identifier">class_name</span><span class="ruby-operator">:</span> <span class="ruby-string">'ESP::Service'</span>
|
|
481
|
-
</pre>
|
|
482
|
-
</div><!-- service-source -->
|
|
483
|
-
|
|
484
|
-
</div>
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
</div><!-- service-method -->
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
<div id="method-i-suppress" class="method-detail ">
|
|
493
|
-
|
|
494
|
-
<div class="method-heading">
|
|
495
|
-
<span class="method-name">suppress</span><span
|
|
496
|
-
class="method-args">(arguments = {})</span>
|
|
497
|
-
|
|
498
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
499
|
-
|
|
500
|
-
</div>
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
<div class="method-description">
|
|
504
|
-
|
|
505
|
-
<p>Create a suppression for this signature.</p>
|
|
506
|
-
|
|
507
|
-
<h4 id="method-i-suppress-label-Parameter">Parameter<span><a href="#method-i-suppress-label-Parameter">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
508
|
-
|
|
509
|
-
<p><code>arguments</code> | Required | A hash of signature suppression
|
|
510
|
-
attributes</p>
|
|
511
|
-
|
|
512
|
-
<h5 id="method-i-suppress-label-Valid+Arguments">Valid Arguments<span><a href="#method-i-suppress-label-Valid+Arguments">¶</a> <a href="#documentation">↑</a></span></h5>
|
|
513
|
-
|
|
514
|
-
<p><code>regions</code> | Required | An array of region names to suppress.</p>
|
|
515
|
-
|
|
516
|
-
<p><code>external_account_ids</code> | Required | An Array of the external
|
|
517
|
-
accounts identified by <code>external_account_id</code> to suppress the
|
|
518
|
-
signature or custom signature on.</p>
|
|
519
|
-
|
|
520
|
-
<p><code>reason</code> | Required | The reason for creating the suppression.</p>
|
|
521
|
-
|
|
522
|
-
<h4 id="method-i-suppress-label-Example">Example<span><a href="#method-i-suppress-label-Example">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
523
|
-
|
|
524
|
-
<pre>suppress(regions: ['us_east_1'], external_account_ids: [5], reason: 'My very good reason for creating this suppression')</pre>
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
<div class="method-source-code" id="suppress-source">
|
|
530
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/signature.rb, line 87</span>
|
|
531
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">suppress</span>(<span class="ruby-identifier">arguments</span> = {})
|
|
532
|
-
<span class="ruby-identifier">arguments</span> = <span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">with_indifferent_access</span>
|
|
533
|
-
<span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">Suppression</span><span class="ruby-operator">::</span><span class="ruby-constant">Signature</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">signature_ids</span><span class="ruby-operator">:</span> [<span class="ruby-identifier">id</span>], <span class="ruby-identifier">regions</span><span class="ruby-operator">:</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">arguments</span>[<span class="ruby-value">:regions</span>]), <span class="ruby-identifier">external_account_ids</span><span class="ruby-operator">:</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">arguments</span>[<span class="ruby-value">:external_account_ids</span>]), <span class="ruby-identifier">reason</span><span class="ruby-operator">:</span> <span class="ruby-identifier">arguments</span>[<span class="ruby-value">:reason</span>])
|
|
534
|
-
<span class="ruby-keyword">end</span></pre>
|
|
535
|
-
</div><!-- suppress-source -->
|
|
536
|
-
|
|
537
|
-
</div>
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
</div><!-- suppress-method -->
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
</section><!-- public-instance-method-details -->
|
|
546
|
-
|
|
547
|
-
</section><!-- 5Buntitled-5D -->
|
|
548
|
-
|
|
549
|
-
</div><!-- documentation -->
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
<footer id="validator-badges">
|
|
553
|
-
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
|
554
|
-
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
|
555
|
-
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
|
556
|
-
</footer>
|
|
557
|
-
|