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/Report.html
DELETED
|
@@ -1,624 +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::Report - 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/report.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 class="calls-super" ><a href="#method-c-create">::create</a>
|
|
79
|
-
|
|
80
|
-
<li ><a href="#method-c-find">::find</a>
|
|
81
|
-
|
|
82
|
-
<li ><a href="#method-i-alerts">#alerts</a>
|
|
83
|
-
|
|
84
|
-
<li ><a href="#method-i-destroy">#destroy</a>
|
|
85
|
-
|
|
86
|
-
<li ><a href="#method-i-organization">#organization</a>
|
|
87
|
-
|
|
88
|
-
<li ><a href="#method-i-stat">#stat</a>
|
|
89
|
-
|
|
90
|
-
<li ><a href="#method-i-sub_organization">#sub_organization</a>
|
|
91
|
-
|
|
92
|
-
<li ><a href="#method-i-team">#team</a>
|
|
93
|
-
|
|
94
|
-
<li ><a href="#method-i-update">#update</a>
|
|
95
|
-
|
|
96
|
-
</ul>
|
|
97
|
-
</nav>
|
|
98
|
-
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
<div id="project-metadata">
|
|
102
|
-
<nav id="fileindex-section" class="section project-section">
|
|
103
|
-
<h3 class="section-header">Pages</h3>
|
|
104
|
-
|
|
105
|
-
<ul>
|
|
106
|
-
|
|
107
|
-
<li class="file"><a href="../README_md.html">README</a>
|
|
108
|
-
|
|
109
|
-
</ul>
|
|
110
|
-
</nav>
|
|
111
|
-
|
|
112
|
-
<nav id="classindex-section" class="section project-section">
|
|
113
|
-
<h3 class="section-header">Class and Module Index</h3>
|
|
114
|
-
|
|
115
|
-
<ul class="link-list">
|
|
116
|
-
|
|
117
|
-
<li><a href="../ActiveResource.html">ActiveResource</a>
|
|
118
|
-
|
|
119
|
-
<li><a href="../ActiveResource/Formats.html">ActiveResource::Formats</a>
|
|
120
|
-
|
|
121
|
-
<li><a href="../ActiveResource/PaginatedCollection.html">ActiveResource::PaginatedCollection</a>
|
|
122
|
-
|
|
123
|
-
<li><a href="../ESP.html">ESP</a>
|
|
124
|
-
|
|
125
|
-
<li><a href="../ESP/Alert.html">ESP::Alert</a>
|
|
126
|
-
|
|
127
|
-
<li><a href="../ESP/CloudTrailEvent.html">ESP::CloudTrailEvent</a>
|
|
128
|
-
|
|
129
|
-
<li><a href="../ESP/ContactRequest.html">ESP::ContactRequest</a>
|
|
130
|
-
|
|
131
|
-
<li><a href="../ESP/CustomSignature.html">ESP::CustomSignature</a>
|
|
132
|
-
|
|
133
|
-
<li><a href="../ESP/Dashboard.html">ESP::Dashboard</a>
|
|
134
|
-
|
|
135
|
-
<li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
|
|
136
|
-
|
|
137
|
-
<li><a href="../ESP/Metadata.html">ESP::Metadata</a>
|
|
138
|
-
|
|
139
|
-
<li><a href="../ESP/Organization.html">ESP::Organization</a>
|
|
140
|
-
|
|
141
|
-
<li><a href="../ESP/Region.html">ESP::Region</a>
|
|
142
|
-
|
|
143
|
-
<li><a href="../ESP/Report.html">ESP::Report</a>
|
|
144
|
-
|
|
145
|
-
<li><a href="../ESP/Service.html">ESP::Service</a>
|
|
146
|
-
|
|
147
|
-
<li><a href="../ESP/Signature.html">ESP::Signature</a>
|
|
148
|
-
|
|
149
|
-
<li><a href="../ESP/Stat.html">ESP::Stat</a>
|
|
150
|
-
|
|
151
|
-
<li><a href="../ESP/StatCustomSignature.html">ESP::StatCustomSignature</a>
|
|
152
|
-
|
|
153
|
-
<li><a href="../ESP/StatRegion.html">ESP::StatRegion</a>
|
|
154
|
-
|
|
155
|
-
<li><a href="../ESP/StatService.html">ESP::StatService</a>
|
|
156
|
-
|
|
157
|
-
<li><a href="../ESP/StatSignature.html">ESP::StatSignature</a>
|
|
158
|
-
|
|
159
|
-
<li><a href="../ESP/SubOrganization.html">ESP::SubOrganization</a>
|
|
160
|
-
|
|
161
|
-
<li><a href="../ESP/Suppression.html">ESP::Suppression</a>
|
|
162
|
-
|
|
163
|
-
<li><a href="../ESP/Suppression/Region.html">ESP::Suppression::Region</a>
|
|
164
|
-
|
|
165
|
-
<li><a href="../ESP/Suppression/Signature.html">ESP::Suppression::Signature</a>
|
|
166
|
-
|
|
167
|
-
<li><a href="../ESP/Suppression/UniqueIdentifier.html">ESP::Suppression::UniqueIdentifier</a>
|
|
168
|
-
|
|
169
|
-
<li><a href="../ESP/Tag.html">ESP::Tag</a>
|
|
170
|
-
|
|
171
|
-
<li><a href="../ESP/Team.html">ESP::Team</a>
|
|
172
|
-
|
|
173
|
-
<li><a href="../ESP/User.html">ESP::User</a>
|
|
174
|
-
|
|
175
|
-
</ul>
|
|
176
|
-
</nav>
|
|
177
|
-
|
|
178
|
-
</div>
|
|
179
|
-
</nav>
|
|
180
|
-
|
|
181
|
-
<div id="documentation">
|
|
182
|
-
<h1 class="class">class ESP::Report</h1>
|
|
183
|
-
|
|
184
|
-
<div id="description" class="description">
|
|
185
|
-
|
|
186
|
-
</div><!-- description -->
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
<!-- Methods -->
|
|
201
|
-
|
|
202
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
|
203
|
-
<h3 class="section-header">Public Class Methods</h3>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
<div id="method-c-all" class="method-detail ">
|
|
207
|
-
|
|
208
|
-
<div class="method-heading">
|
|
209
|
-
<span class="method-name">all</span><span
|
|
210
|
-
class="method-args">()</span>
|
|
211
|
-
|
|
212
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
213
|
-
|
|
214
|
-
</div>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
<div class="method-description">
|
|
218
|
-
|
|
219
|
-
<p>Return a paginated <a href="Report.html">Report</a> list</p>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
<div class="method-source-code" id="all-source">
|
|
225
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 99</span>
|
|
226
|
-
</pre>
|
|
227
|
-
</div><!-- all-source -->
|
|
228
|
-
|
|
229
|
-
</div>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
</div><!-- all-method -->
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
<div id="method-c-create" class="method-detail ">
|
|
238
|
-
|
|
239
|
-
<div class="method-heading">
|
|
240
|
-
<span class="method-name">create</span><span
|
|
241
|
-
class="method-args">(arguments = {})</span>
|
|
242
|
-
|
|
243
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
244
|
-
|
|
245
|
-
</div>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
<div class="method-description">
|
|
249
|
-
|
|
250
|
-
<p>Enqueue a report to be run for the given team. Returns a <a
|
|
251
|
-
href="Report.html">Report</a> object with a status of 'queued' and
|
|
252
|
-
an id</p>
|
|
253
|
-
|
|
254
|
-
<h4 id="method-c-create-label-Attribute">Attribute<span><a href="#method-c-create-label-Attribute">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
255
|
-
|
|
256
|
-
<p><code>team_id</code> | Required | The ID of the team to create a report for</p>
|
|
257
|
-
|
|
258
|
-
<p>Periodically check the API</p>
|
|
259
|
-
|
|
260
|
-
<pre>ESP::Report.find(<id>)</pre>
|
|
261
|
-
|
|
262
|
-
<p>until status is 'complete'.</p>
|
|
263
|
-
|
|
264
|
-
<p>If not successful, returns a <a href="Report.html">Report</a> object with
|
|
265
|
-
the errors object populated.</p>
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
<div class="method-calls-super">
|
|
269
|
-
Calls superclass method
|
|
270
|
-
|
|
271
|
-
</div>
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
<div class="method-source-code" id="create-source">
|
|
276
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 36</span>
|
|
277
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">arguments</span> = {})
|
|
278
|
-
<span class="ruby-identifier">fail</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">"You must supply a team id."</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">with_indifferent_access</span>[<span class="ruby-value">:team_id</span>].<span class="ruby-identifier">present?</span>
|
|
279
|
-
<span class="ruby-keyword">super</span>
|
|
280
|
-
<span class="ruby-keyword">rescue</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>
|
|
281
|
-
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">arguments</span>).<span class="ruby-identifier">tap</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">load_remote_errors</span>(<span class="ruby-identifier">error</span>, <span class="ruby-keyword">true</span>) }
|
|
282
|
-
<span class="ruby-keyword">end</span></pre>
|
|
283
|
-
</div><!-- create-source -->
|
|
284
|
-
|
|
285
|
-
</div>
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
</div><!-- create-method -->
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
<div id="method-c-find" class="method-detail ">
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
<div class="method-heading">
|
|
297
|
-
<span class="method-callseq">
|
|
298
|
-
find(id)
|
|
299
|
-
</span>
|
|
300
|
-
|
|
301
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
302
|
-
|
|
303
|
-
</div>
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
<div class="method-description">
|
|
308
|
-
|
|
309
|
-
<p>Find a <a href="Report.html">Report</a> by id</p>
|
|
310
|
-
|
|
311
|
-
<h4 id="method-c-find-label-Parameter">Parameter<span><a href="#method-c-find-label-Parameter">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
312
|
-
|
|
313
|
-
<p><code>id</code> | Required | The ID of the report to retrieve</p>
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
<div class="method-source-code" id="find-source">
|
|
319
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 97</span>
|
|
320
|
-
</pre>
|
|
321
|
-
</div><!-- find-source -->
|
|
322
|
-
|
|
323
|
-
</div>
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
</div><!-- find-method -->
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
</section><!-- public-class-method-details -->
|
|
332
|
-
|
|
333
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
|
334
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
<div id="method-i-alerts" class="method-detail ">
|
|
338
|
-
|
|
339
|
-
<div class="method-heading">
|
|
340
|
-
<span class="method-name">alerts</span><span
|
|
341
|
-
class="method-args">(arguments = {})</span>
|
|
342
|
-
|
|
343
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
344
|
-
|
|
345
|
-
</div>
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
<div class="method-description">
|
|
349
|
-
|
|
350
|
-
<p>Returns a paginated collection of alerts for the report</p>
|
|
351
|
-
|
|
352
|
-
<h4 id="method-i-alerts-label-Parameters">Parameters<span><a href="#method-i-alerts-label-Parameters">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
353
|
-
|
|
354
|
-
<p><code>arguments</code> | Not Required | An optional hash of search criteria
|
|
355
|
-
to filter the returned collection</p>
|
|
356
|
-
|
|
357
|
-
<h5 id="method-i-alerts-label-Valid+Arguments">Valid Arguments<span><a href="#method-i-alerts-label-Valid+Arguments">¶</a> <a href="#documentation">↑</a></span></h5>
|
|
358
|
-
|
|
359
|
-
<p><code>region_id</code> | Not Required | Return only alerts for this region.</p>
|
|
360
|
-
|
|
361
|
-
<p><code>status</code> | Not Required | Return only alerts for the give
|
|
362
|
-
status(es). Valid values are fail, warn, error, pass, info</p>
|
|
363
|
-
|
|
364
|
-
<p><code>first_seen</code> | Not Required | Return only alerts that have
|
|
365
|
-
started within a number of hours of the report. For example, first_seen of
|
|
366
|
-
3 will return alerts that started showing up within the last 3 hours of the
|
|
367
|
-
report.</p>
|
|
368
|
-
|
|
369
|
-
<p><code>suppressed</code> | Not Required | Return only suppressed alerts</p>
|
|
370
|
-
|
|
371
|
-
<p><code>team_id</code> | Not Required | Return only alerts for the given
|
|
372
|
-
team.</p>
|
|
373
|
-
|
|
374
|
-
<p><code>external_account_id</code> | Not Required | Return only alerts for
|
|
375
|
-
the given external id.</p>
|
|
376
|
-
|
|
377
|
-
<p><code>service_id</code> | Not Required | Return only alerts on signatures
|
|
378
|
-
with the given service.</p>
|
|
379
|
-
|
|
380
|
-
<p><code>signature_severity</code> | Not Required | Return only alerts for
|
|
381
|
-
signatures with the given risk_level. Valid values are Low, Medium, High</p>
|
|
382
|
-
|
|
383
|
-
<p><code>signature_name</code> | Not Required | Return only alerts for
|
|
384
|
-
signatures with the given name.</p>
|
|
385
|
-
|
|
386
|
-
<p><code>resource</code> | Not Required | Return only alerts for the given
|
|
387
|
-
resource or tag.</p>
|
|
388
|
-
|
|
389
|
-
<p><code>signature_identifier</code> | Not Required | Return only alerts for
|
|
390
|
-
signatures with the given identifier.</p>
|
|
391
|
-
|
|
392
|
-
<h4 id="method-i-alerts-label-Example">Example<span><a href="#method-i-alerts-label-Example">¶</a> <a href="#documentation">↑</a></span></h4>
|
|
393
|
-
|
|
394
|
-
<pre>report = ESP::Report.find(345)
|
|
395
|
-
alerts = report.alerts(status: 'fail', signature_severity: 'High')</pre>
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
<div class="method-source-code" id="alerts-source">
|
|
401
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 77</span>
|
|
402
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">alerts</span>(<span class="ruby-identifier">arguments</span> = {})
|
|
403
|
-
<span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">Alert</span>.<span class="ruby-identifier">for_report</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">arguments</span>)
|
|
404
|
-
<span class="ruby-keyword">end</span></pre>
|
|
405
|
-
</div><!-- alerts-source -->
|
|
406
|
-
|
|
407
|
-
</div>
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
</div><!-- alerts-method -->
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
<div id="method-i-destroy" class="method-detail ">
|
|
416
|
-
|
|
417
|
-
<div class="method-heading">
|
|
418
|
-
<span class="method-name">destroy</span><span
|
|
419
|
-
class="method-args">()</span>
|
|
420
|
-
|
|
421
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
422
|
-
|
|
423
|
-
</div>
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
<div class="method-description">
|
|
427
|
-
|
|
428
|
-
<p>Not Implemented. You cannot destroy a <a href="Report.html">Report</a>.</p>
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
<div class="method-source-code" id="destroy-source">
|
|
434
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 21</span>
|
|
435
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">destroy</span>
|
|
436
|
-
<span class="ruby-identifier">fail</span> <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">NotImplementedError</span>
|
|
437
|
-
<span class="ruby-keyword">end</span></pre>
|
|
438
|
-
</div><!-- destroy-source -->
|
|
439
|
-
|
|
440
|
-
</div>
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
</div><!-- destroy-method -->
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
<div id="method-i-organization" class="method-detail ">
|
|
449
|
-
|
|
450
|
-
<div class="method-heading">
|
|
451
|
-
<span class="method-name">organization</span><span
|
|
452
|
-
class="method-args">()</span>
|
|
453
|
-
|
|
454
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
455
|
-
|
|
456
|
-
</div>
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
<div class="method-description">
|
|
460
|
-
|
|
461
|
-
<p>The organization the report belongs to.</p>
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
<div class="method-source-code" id="organization-source">
|
|
467
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 5</span>
|
|
468
|
-
<span class="ruby-identifier">belongs_to</span> <span class="ruby-value">:organization</span>, <span class="ruby-identifier">class_name</span><span class="ruby-operator">:</span> <span class="ruby-string">'ESP::Organization'</span>
|
|
469
|
-
</pre>
|
|
470
|
-
</div><!-- organization-source -->
|
|
471
|
-
|
|
472
|
-
</div>
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
</div><!-- organization-method -->
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
<div id="method-i-stat" class="method-detail ">
|
|
481
|
-
|
|
482
|
-
<div class="method-heading">
|
|
483
|
-
<span class="method-name">stat</span><span
|
|
484
|
-
class="method-args">()</span>
|
|
485
|
-
|
|
486
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
487
|
-
|
|
488
|
-
</div>
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
<div class="method-description">
|
|
492
|
-
|
|
493
|
-
<p>Returns the stats for this report</p>
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
<div class="method-source-code" id="stat-source">
|
|
499
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 82</span>
|
|
500
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">stat</span>
|
|
501
|
-
<span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">Stat</span>.<span class="ruby-identifier">for_report</span>(<span class="ruby-identifier">id</span>)
|
|
502
|
-
<span class="ruby-keyword">end</span></pre>
|
|
503
|
-
</div><!-- stat-source -->
|
|
504
|
-
|
|
505
|
-
</div>
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
</div><!-- stat-method -->
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
<div id="method-i-sub_organization" class="method-detail ">
|
|
514
|
-
|
|
515
|
-
<div class="method-heading">
|
|
516
|
-
<span class="method-name">sub_organization</span><span
|
|
517
|
-
class="method-args">()</span>
|
|
518
|
-
|
|
519
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
520
|
-
|
|
521
|
-
</div>
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
<div class="method-description">
|
|
525
|
-
|
|
526
|
-
<p>The <a href="Report.html#method-i-sub_organization">#sub_organization</a>
|
|
527
|
-
the report belongs to.</p>
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
<div class="method-source-code" id="sub_organization-source">
|
|
533
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 9</span>
|
|
534
|
-
<span class="ruby-identifier">belongs_to</span> <span class="ruby-value">:sub_organization</span>, <span class="ruby-identifier">class_name</span><span class="ruby-operator">:</span> <span class="ruby-string">'ESP::SubOrganization'</span>
|
|
535
|
-
</pre>
|
|
536
|
-
</div><!-- sub_organization-source -->
|
|
537
|
-
|
|
538
|
-
</div>
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
</div><!-- sub_organization-method -->
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
<div id="method-i-team" class="method-detail ">
|
|
547
|
-
|
|
548
|
-
<div class="method-heading">
|
|
549
|
-
<span class="method-name">team</span><span
|
|
550
|
-
class="method-args">()</span>
|
|
551
|
-
|
|
552
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
553
|
-
|
|
554
|
-
</div>
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
<div class="method-description">
|
|
558
|
-
|
|
559
|
-
<p>The team the report belongs to.</p>
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
<div class="method-source-code" id="team-source">
|
|
565
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 13</span>
|
|
566
|
-
<span class="ruby-identifier">belongs_to</span> <span class="ruby-value">:team</span>, <span class="ruby-identifier">class_name</span><span class="ruby-operator">:</span> <span class="ruby-string">'ESP::Team'</span>
|
|
567
|
-
</pre>
|
|
568
|
-
</div><!-- team-source -->
|
|
569
|
-
|
|
570
|
-
</div>
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
</div><!-- team-method -->
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
<div id="method-i-update" class="method-detail ">
|
|
579
|
-
|
|
580
|
-
<div class="method-heading">
|
|
581
|
-
<span class="method-name">update</span><span
|
|
582
|
-
class="method-args">()</span>
|
|
583
|
-
|
|
584
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
585
|
-
|
|
586
|
-
</div>
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
<div class="method-description">
|
|
590
|
-
|
|
591
|
-
<p>Not Implemented. You cannot create or update a <a
|
|
592
|
-
href="Report.html">Report</a>.</p>
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
<div class="method-source-code" id="update-source">
|
|
598
|
-
<pre><span class="ruby-comment"># File lib/esp/resources/report.rb, line 16</span>
|
|
599
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">update</span>
|
|
600
|
-
<span class="ruby-identifier">fail</span> <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">NotImplementedError</span>
|
|
601
|
-
<span class="ruby-keyword">end</span></pre>
|
|
602
|
-
</div><!-- update-source -->
|
|
603
|
-
|
|
604
|
-
</div>
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
</div><!-- update-method -->
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
</section><!-- public-instance-method-details -->
|
|
613
|
-
|
|
614
|
-
</section><!-- 5Buntitled-5D -->
|
|
615
|
-
|
|
616
|
-
</div><!-- documentation -->
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
<footer id="validator-badges">
|
|
620
|
-
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
|
621
|
-
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
|
622
|
-
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
|
623
|
-
</footer>
|
|
624
|
-
|