esp_sdk 2.0.0.rc1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/Gemfile.lock +1 -15
  4. data/assets/esp_logo.ans +27 -0
  5. data/bin/esp_console +2 -6
  6. data/esp_sdk.gemspec +0 -3
  7. data/lib/esp/extensions/active_resource/formats/json_api_format.rb +22 -3
  8. data/lib/esp/resources/alert.rb +6 -0
  9. data/lib/esp/resources/metadata.rb +50 -0
  10. data/lib/esp/resources/resource.rb +1 -0
  11. data/lib/esp/resources/signature.rb +5 -5
  12. data/lib/esp/version.rb +1 -1
  13. data/lib/esp.rb +1 -0
  14. data/lib/esp_sdk.rb +0 -1
  15. data/rdoc/ActiveResource/Formats.html +2 -0
  16. data/rdoc/ActiveResource/PaginatedCollection.html +2 -0
  17. data/rdoc/ActiveResource.html +2 -0
  18. data/rdoc/ESP/Alert.html +44 -7
  19. data/rdoc/ESP/CloudTrailEvent.html +2 -0
  20. data/rdoc/ESP/ContactRequest.html +2 -0
  21. data/rdoc/ESP/CustomSignature.html +2 -0
  22. data/rdoc/ESP/Dashboard.html +2 -0
  23. data/rdoc/ESP/ExternalAccount.html +2 -0
  24. data/rdoc/ESP/Metadata.html +411 -0
  25. data/rdoc/ESP/Organization.html +2 -0
  26. data/rdoc/ESP/Region.html +2 -0
  27. data/rdoc/ESP/Report.html +2 -0
  28. data/rdoc/ESP/Service.html +2 -0
  29. data/rdoc/ESP/Signature.html +9 -7
  30. data/rdoc/ESP/Stat.html +2 -0
  31. data/rdoc/ESP/StatCustomSignature.html +2 -0
  32. data/rdoc/ESP/StatRegion.html +2 -0
  33. data/rdoc/ESP/StatService.html +2 -0
  34. data/rdoc/ESP/StatSignature.html +2 -0
  35. data/rdoc/ESP/SubOrganization.html +2 -0
  36. data/rdoc/ESP/Suppression/Region.html +2 -0
  37. data/rdoc/ESP/Suppression/Signature.html +2 -0
  38. data/rdoc/ESP/Suppression/UniqueIdentifier.html +2 -0
  39. data/rdoc/ESP/Suppression.html +2 -0
  40. data/rdoc/ESP/Tag.html +2 -0
  41. data/rdoc/ESP/Team.html +2 -0
  42. data/rdoc/ESP/User.html +2 -0
  43. data/rdoc/ESP.html +3 -0
  44. data/rdoc/README_md.html +2 -0
  45. data/rdoc/created.rid +31 -30
  46. data/rdoc/index.html +2 -0
  47. data/rdoc/js/search_index.js +1 -1
  48. data/rdoc/table_of_contents.html +218 -203
  49. data/test/esp/extensions/active_resource/formats/json_api_format_test.rb +28 -5
  50. data/test/esp/resources/alert_test.rb +26 -4
  51. data/test/esp/resources/custom_signature_test.rb +2 -2
  52. data/test/esp/resources/metadata_test.rb +98 -0
  53. data/test/esp/resources/resource_test.rb +10 -0
  54. data/test/esp/resources/signature_test.rb +9 -9
  55. data/test/esp/resources/suppression_test.rb +4 -4
  56. data/test/factories/alerts.rb +5 -1
  57. data/test/factories/cloud_trail_events.rb +1 -1
  58. data/test/factories/contact_requests.rb +15 -8
  59. data/test/factories/metadata.rb +9 -0
  60. data/test/test_helper.rb +0 -1
  61. metadata +12 -46
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 375b1160781a13a88cefd9a083eff938b826902d
4
- data.tar.gz: 16a16aefa8bec1cde0b74c74de232700ed77bbd1
3
+ metadata.gz: 346fea31e490e4806a446f57683828c302ef3289
4
+ data.tar.gz: 8c429d99558d3b111eb4eabb7d7a35419391ab23
5
5
  SHA512:
6
- metadata.gz: 6f7342eb640fb5eb04e02e0bab60b7e7ed7b8073cccab9c9d5759faac55762c711191f4ce63581e64131be3b7ed8b47335da5e1f5091704993ce6de70e7b3908
7
- data.tar.gz: 9da7a80cff4b9ee24e24a804f4a68191887bc73ec4f6a10f19763936209179fa802762608f27ce90ba9362b1688acba52f4aab010d29cb227f9e8a418604172c
6
+ metadata.gz: 6ad3f1c191a879a5c17b3042941b7a590918f48a34e597beaf1c06d293d653cb49ac958f4e539ee717d24cac092861fbfce903e870e8ec0be09557542e3e0d82
7
+ data.tar.gz: d68c27b4c8fd22fe0dd65a2c4d702b4f8d2a19376e5e826514f1f6d9c8a40f2f316dbf6d6549cccbc164418a463c73e35a2a9e05433bb11f11888526a1a5e246
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ ## [Unreleased]
2
+ ### Added
3
+ - Implemented searching using `where` on many object.
4
+
5
+ ## [2.0.0] - 2015-12-16
6
+ ### Added
7
+ - Separate Metadata object
8
+ - Metadata relationship to the Alert object.
9
+ - Set the User-Agent header to "Ruby SDK #{ESP::VERSION}"
10
+
11
+ ### Removed
12
+ - Unnecessary dependencies.
13
+
14
+ ## [2.0.0.rc1] - 2015-11-05
15
+ ### Added
16
+ - Complete rewrite. See the README for the new DSL.
data/Gemfile.lock CHANGED
@@ -1,12 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- esp_sdk (2.0.0.rc1)
4
+ esp_sdk (2.0.0)
5
5
  activeresource (~> 4.0.0)
6
6
  api-auth
7
- artii
8
- awesome_print
9
- catpix
10
7
  rack
11
8
 
12
9
  GEM
@@ -28,19 +25,12 @@ GEM
28
25
  addressable (2.3.8)
29
26
  ansi (1.5.0)
30
27
  api-auth (1.3.2)
31
- artii (2.1.1)
32
28
  ast (2.0.0)
33
29
  astrolabe (1.3.1)
34
30
  parser (~> 2.2)
35
- awesome_print (1.6.1)
36
31
  bourne (1.6.0)
37
32
  mocha (~> 1.1)
38
33
  builder (3.2.2)
39
- catpix (0.2.0)
40
- docopt (~> 0.5, >= 0.5.0)
41
- rmagick (~> 2.15, >= 2.15.2)
42
- ruby-terminfo (~> 0.1, >= 0.1.1)
43
- tco (~> 0.1, >= 0.1.8)
44
34
  coderay (1.1.0)
45
35
  coveralls (0.8.0)
46
36
  multi_json (~> 1.10)
@@ -51,7 +41,6 @@ GEM
51
41
  crack (0.4.2)
52
42
  safe_yaml (~> 1.0.0)
53
43
  docile (1.1.5)
54
- docopt (0.5.0)
55
44
  factory_girl (4.5.0)
56
45
  activesupport (>= 3.0.0)
57
46
  ffi (1.9.10)
@@ -114,7 +103,6 @@ GEM
114
103
  rest-client (1.7.3)
115
104
  mime-types (>= 1.16, < 3.0)
116
105
  netrc (~> 0.7)
117
- rmagick (2.15.4)
118
106
  rubocop (0.34.2)
119
107
  astrolabe (~> 1.3)
120
108
  parser (>= 2.2.2.5, < 3.0)
@@ -122,7 +110,6 @@ GEM
122
110
  rainbow (>= 1.99.1, < 3.0)
123
111
  ruby-progressbar (~> 1.4)
124
112
  ruby-progressbar (1.7.5)
125
- ruby-terminfo (0.1.1)
126
113
  safe_yaml (1.0.4)
127
114
  shellany (0.0.1)
128
115
  shoulda (3.5.0)
@@ -137,7 +124,6 @@ GEM
137
124
  simplecov-html (~> 0.9.0)
138
125
  simplecov-html (0.9.0)
139
126
  slop (3.6.0)
140
- tco (0.1.8)
141
127
  term-ansicolor (1.3.0)
142
128
  tins (~> 1.0)
143
129
  thor (0.19.1)
@@ -0,0 +1,27 @@
1
+
2
+
3
+
4
+
5
+
6
+ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
7
+                                    
8
+      ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀     
9
+ ▀                               ▀    
10
+     ▀    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀        
11
+     ▀    ▀                ▀   ▀    
12
+      ▀   ▀                ▀▀▀▀    ▀
13
+     ▀    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀    
14
+ ▀    ▀                     ▀    ▀
15
+ ▀    ▀     ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀    
16
+ ▀    ▀▀   ▀▀      ▀▀▀▀▀▀    ▀
17
+ ▀    ▀▀    ▀▀  ▀▀    ▀     
18
+ ▀     ▀▀          ▀▀    ▀
19
+ ▀    ▀▀▀      ▀▀     ▀
20
+ ▀      ▀▀▀▀▀▀     ▀
21
+ ▀             ▀
22
+ ▀▀        ▀
23
+ ▀▀▀▀▀
24
+
25
+
26
+
27
+
data/bin/esp_console CHANGED
@@ -53,13 +53,9 @@ module ESP
53
53
  end
54
54
 
55
55
  begin
56
- require 'catpix'
57
- logo = File.expand_path(File.dirname(__FILE__) + '/../assets/logo.png')
58
- Catpix::print_image logo
56
+ puts File.read(File.expand_path(File.dirname(__FILE__) + '/../assets/esp_logo.ans'))
59
57
  rescue
60
- require 'artii'
61
- artii = Artii::Base.new(font: 'slant')
62
- print artii.asciify('E.S.P')
58
+ #swallow the error
63
59
  end
64
60
  print <<-banner
65
61
 
data/esp_sdk.gemspec CHANGED
@@ -38,7 +38,4 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency 'activeresource', '~> 4.0.0'
39
39
  spec.add_dependency 'api-auth'
40
40
  spec.add_dependency 'rack'
41
- spec.add_dependency 'awesome_print'
42
- spec.add_dependency 'artii'
43
- spec.add_dependency 'catpix'
44
41
  end
@@ -72,7 +72,7 @@ module ActiveResource
72
72
 
73
73
  def self.parse_relationships!(object, included)
74
74
  object.fetch('relationships', {}).each do |assoc, details|
75
- extract_foreign_keys!(object, assoc, details['data'])
75
+ extract_foreign_keys!(object, assoc, details)
76
76
  merge_included_objects!(object, assoc, details['data'], included)
77
77
  end
78
78
  end
@@ -82,8 +82,17 @@ module ActiveResource
82
82
  object.merge! object.delete('attributes') unless object['attributes'].blank?
83
83
  end
84
84
 
85
- def self.extract_foreign_keys!(object, assoc, data)
86
- return if data.blank?
85
+ def self.extract_foreign_keys!(object, assoc, assoc_details)
86
+ data = assoc_details['data']
87
+ related_link = assoc_details.fetch('links', {}).fetch('related', {})
88
+ if data.present?
89
+ parse_data(object, assoc, data)
90
+ elsif related_link.present?
91
+ parse_related_link(object, assoc, related_link)
92
+ end
93
+ end
94
+
95
+ def self.parse_data(object, assoc, data)
87
96
  if data.is_a? Array
88
97
  object["#{assoc.singularize}_ids"] = data.map { |d| d['id'] }
89
98
  else
@@ -91,6 +100,16 @@ module ActiveResource
91
100
  end
92
101
  end
93
102
 
103
+ def self.parse_related_link(object, assoc, related_link)
104
+ # parse the url to get the id if the data node is not returned
105
+ related_link.scan(%r{/(\d+)\.json$}) do |id|
106
+ object["#{assoc}_id"] = id.first
107
+ end
108
+ return if object["#{assoc}_id"].present?
109
+ uri = URI.parse(related_link)
110
+ object["#{assoc.singularize}_ids"] = Rack::Utils.parse_nested_query(CGI.unescape(uri.query)).fetch('filter', {}).fetch('id_in', []) if uri.query.present?
111
+ end
112
+
94
113
  def self.merge_included_objects!(object, assoc, data, included)
95
114
  return if included.blank?
96
115
  object[assoc] = case data
@@ -28,6 +28,12 @@ module ESP
28
28
  # Returns the tags associated with this alert.
29
29
  has_many :tags, class_name: 'ESP::Tag'
30
30
 
31
+ ##
32
+ # Returns the metadata associated with this alert.
33
+ def metadata
34
+ ESP::Metadata.for_alert(id)
35
+ end
36
+
31
37
  # Not Implemented. You cannot create or update an Alert.
32
38
  def save
33
39
  fail ESP::NotImplementedError
@@ -0,0 +1,50 @@
1
+ module ESP
2
+ class Metadata < ESP::Resource
3
+ # Not Implemented. You cannot search for Metadata.
4
+ def self.where(*)
5
+ fail ESP::NotImplementedError
6
+ end
7
+
8
+ # Not Implemented. You cannot create or update Metadata.
9
+ def save
10
+ fail ESP::NotImplementedError
11
+ end
12
+
13
+ # Not Implemented. You cannot destroy Metadata.
14
+ def destroy
15
+ fail ESP::NotImplementedError
16
+ end
17
+
18
+ # Returns a metadata object for the given alert_id
19
+ # Convenience method to use instead of ::find since an alert_id is required to return metadata.
20
+ #
21
+ # ==== Parameter
22
+ #
23
+ # +alert_id+ | Required | The ID of the alert to retrieve metadata for
24
+ #
25
+ # ==== Example
26
+ # alerts = ESP::Metadata.for_alert(1194)
27
+ def self.for_alert(alert_id = nil)
28
+ fail ArgumentError, "You must supply an alert id." unless alert_id.present?
29
+ from = "#{prefix}alerts/#{alert_id}/metadata.json"
30
+ find(:one, from: from)
31
+ end
32
+
33
+ # Find a Metadata object by id
34
+ #
35
+ # ==== Parameter
36
+ #
37
+ # +id+ | Required | The ID of the metadata object to retrieve
38
+ #
39
+ # :call-seq:
40
+ # find(id)
41
+ def self.find(*arguments)
42
+ scope = arguments.slice!(0)
43
+ options = (arguments.slice!(0) || {}).with_indifferent_access
44
+ return super(scope, options) if scope.is_a?(Numeric) || options[:from].present?
45
+ params = options.fetch(:params, {}).with_indifferent_access
46
+ alert_id = params.delete(:alert_id)
47
+ for_alert(alert_id)
48
+ end
49
+ end
50
+ end
@@ -4,6 +4,7 @@ module ESP
4
4
  self.format = ActiveResource::Formats::JsonAPIFormat
5
5
  with_api_auth(ESP.access_key_id, ESP.secret_access_key)
6
6
  headers["Content-Type"] = format.mime_type
7
+ headers["User-Agent"] = "Ruby SDK #{ESP::VERSION}"
7
8
 
8
9
  self.collection_parser = ActiveResource::PaginatedCollection
9
10
 
@@ -26,11 +26,11 @@ module ESP
26
26
  #
27
27
  # +external_account_id+ | Required | The ID of the external account to run this custom signature against
28
28
  #
29
- # +regions+ | Required | Array of region names to run this custom signature against
29
+ # +region+ | Required | Region name to run this custom signature against
30
30
  #
31
31
  # ==== Example
32
32
  # signature = ESP::Signature.find(3)
33
- # alerts = signature.run!(external_account_id: 3, regions: ['us_east_1'])
33
+ # alerts = signature.run!(external_account_id: 3, region: 'us_east_1')
34
34
  def run!(arguments = {})
35
35
  result = run(arguments)
36
36
  return result if result.is_a?(ActiveResource::Collection)
@@ -50,15 +50,15 @@ module ESP
50
50
  #
51
51
  # +external_account_id+ | Required | The ID of the external account to run this custom signature against
52
52
  #
53
- # +regions+ | Required | Array of region names to run this custom signature against
53
+ # +region+ | Required | Region name to run this custom signature against
54
54
  #
55
55
  # ==== Example
56
56
  # signature = ESP::Signature.find(3)
57
- # alerts = signature.run(external_account_id: 3, regions: ['us_east_1'])
57
+ # alerts = signature.run(external_account_id: 3, region: 'us_east_1')
58
58
  def run(arguments = {})
59
59
  arguments = arguments.with_indifferent_access
60
60
  attributes['external_account_id'] ||= arguments[:external_account_id]
61
- attributes['regions'] ||= Array(arguments[:regions])
61
+ attributes['region'] ||= arguments[:region]
62
62
 
63
63
  response = connection.post("#{self.class.prefix}signatures/#{id}/run.json", to_json)
64
64
  ESP::Alert.send(:instantiate_collection, self.class.format.decode(response.body))
data/lib/esp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ESP
2
- VERSION = '2.0.0.rc1'
2
+ VERSION = '2.0.0'
3
3
  end
data/lib/esp.rb CHANGED
@@ -79,6 +79,7 @@ module ESP
79
79
  autoload :RawAlert, File.expand_path(File.dirname(__FILE__) + '/esp/resources/raw_alert')
80
80
  autoload :Dashboard, File.expand_path(File.dirname(__FILE__) + '/esp/resources/dashboard')
81
81
  autoload :CloudTrailEvent, File.expand_path(File.dirname(__FILE__) + '/esp/resources/cloud_trail_event')
82
+ autoload :Metadata, File.expand_path(File.dirname(__FILE__) + '/esp/resources/metadata')
82
83
  autoload :Tag, File.expand_path(File.dirname(__FILE__) + '/esp/resources/tag')
83
84
  autoload :Region, File.expand_path(File.dirname(__FILE__) + '/esp/resources/region')
84
85
  autoload :Suppression, File.expand_path(File.dirname(__FILE__) + '/esp/resources/suppression')
data/lib/esp_sdk.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'active_support/all'
2
2
  require 'active_resource'
3
3
  require 'api_auth'
4
- require 'awesome_print'
5
4
  require_relative 'esp/extensions/active_resource/paginated_collection'
6
5
  require_relative 'esp/extensions/active_resource/validations'
7
6
  require_relative 'esp/extensions/active_resource/formats/json_api_format'
@@ -100,6 +100,8 @@
100
100
 
101
101
  <li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
102
102
 
103
+ <li><a href="../ESP/Metadata.html">ESP::Metadata</a>
104
+
103
105
  <li><a href="../ESP/Organization.html">ESP::Organization</a>
104
106
 
105
107
  <li><a href="../ESP/Region.html">ESP::Region</a>
@@ -148,6 +148,8 @@
148
148
 
149
149
  <li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
150
150
 
151
+ <li><a href="../ESP/Metadata.html">ESP::Metadata</a>
152
+
151
153
  <li><a href="../ESP/Organization.html">ESP::Organization</a>
152
154
 
153
155
  <li><a href="../ESP/Region.html">ESP::Region</a>
@@ -104,6 +104,8 @@
104
104
 
105
105
  <li><a href="./ESP/ExternalAccount.html">ESP::ExternalAccount</a>
106
106
 
107
+ <li><a href="./ESP/Metadata.html">ESP::Metadata</a>
108
+
107
109
  <li><a href="./ESP/Organization.html">ESP::Organization</a>
108
110
 
109
111
  <li><a href="./ESP/Region.html">ESP::Region</a>
data/rdoc/ESP/Alert.html CHANGED
@@ -85,6 +85,8 @@
85
85
 
86
86
  <li ><a href="#method-i-external_account">#external_account</a>
87
87
 
88
+ <li ><a href="#method-i-metadata">#metadata</a>
89
+
88
90
  <li ><a href="#method-i-region">#region</a>
89
91
 
90
92
  <li ><a href="#method-i-save">#save</a>
@@ -142,6 +144,8 @@
142
144
 
143
145
  <li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
144
146
 
147
+ <li><a href="../ESP/Metadata.html">ESP::Metadata</a>
148
+
145
149
  <li><a href="../ESP/Organization.html">ESP::Organization</a>
146
150
 
147
151
  <li><a href="../ESP/Region.html">ESP::Region</a>
@@ -240,7 +244,7 @@
240
244
 
241
245
 
242
246
  <div class="method-source-code" id="find-source">
243
- <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 90</span>
247
+ <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 96</span>
244
248
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">find</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">arguments</span>)
245
249
  <span class="ruby-identifier">scope</span> = <span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>)
246
250
  <span class="ruby-identifier">options</span> = (<span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>) <span class="ruby-operator">||</span> {}).<span class="ruby-identifier">with_indifferent_access</span>
@@ -328,7 +332,7 @@ signatures with the given identifier.</p>
328
332
 
329
333
 
330
334
  <div class="method-source-code" id="for_report-source">
331
- <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 76</span>
335
+ <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 82</span>
332
336
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">for_report</span>(<span class="ruby-identifier">report_id</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">arguments</span> = {})
333
337
  <span class="ruby-identifier">fail</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">&quot;You must supply a report id.&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">report_id</span>.<span class="ruby-identifier">present?</span>
334
338
  <span class="ruby-identifier">from</span> = <span class="ruby-node">&quot;#{prefix}reports/#{report_id}/alerts.json&quot;</span>
@@ -435,7 +439,7 @@ signature or custom signature but not both will be present.</p>
435
439
 
436
440
 
437
441
  <div class="method-source-code" id="destroy-source">
438
- <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 37</span>
442
+ <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 43</span>
439
443
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">destroy</span>
440
444
  <span class="ruby-identifier">fail</span> <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">NotImplementedError</span>
441
445
  <span class="ruby-keyword">end</span></pre>
@@ -481,6 +485,39 @@ signature or custom signature but not both will be present.</p>
481
485
  </div><!-- external_account-method -->
482
486
 
483
487
 
488
+ <div id="method-i-metadata" class="method-detail ">
489
+
490
+ <div class="method-heading">
491
+ <span class="method-name">metadata</span><span
492
+ class="method-args">()</span>
493
+
494
+ <span class="method-click-advice">click to toggle source</span>
495
+
496
+ </div>
497
+
498
+
499
+ <div class="method-description">
500
+
501
+ <p>Returns the metadata associated with this alert.</p>
502
+
503
+
504
+
505
+
506
+ <div class="method-source-code" id="metadata-source">
507
+ <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 33</span>
508
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">metadata</span>
509
+ <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">Metadata</span>.<span class="ruby-identifier">for_alert</span>(<span class="ruby-identifier">id</span>)
510
+ <span class="ruby-keyword">end</span></pre>
511
+ </div><!-- metadata-source -->
512
+
513
+ </div>
514
+
515
+
516
+
517
+
518
+ </div><!-- metadata-method -->
519
+
520
+
484
521
  <div id="method-i-region" class="method-detail ">
485
522
 
486
523
  <div class="method-heading">
@@ -533,7 +570,7 @@ href="Alert.html">Alert</a>.</p>
533
570
 
534
571
 
535
572
  <div class="method-source-code" id="save-source">
536
- <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 32</span>
573
+ <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 38</span>
537
574
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">save</span>
538
575
  <span class="ruby-identifier">fail</span> <span class="ruby-constant">ESP</span><span class="ruby-operator">::</span><span class="ruby-constant">NotImplementedError</span>
539
576
  <span class="ruby-keyword">end</span></pre>
@@ -603,7 +640,7 @@ custom signature but not both will be present.</p>
603
640
 
604
641
 
605
642
  <div class="method-source-code" id="suppress_region-source">
606
- <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 111</span>
643
+ <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 117</span>
607
644
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">suppress_region</span>(<span class="ruby-identifier">reason</span> = <span class="ruby-keyword">nil</span>)
608
645
  <span class="ruby-identifier">suppress</span>(<span class="ruby-constant">Suppression</span><span class="ruby-operator">::</span><span class="ruby-constant">Region</span>, <span class="ruby-identifier">reason</span>)
609
646
  <span class="ruby-keyword">end</span></pre>
@@ -640,7 +677,7 @@ custom signature but not both will be present.</p>
640
677
 
641
678
 
642
679
  <div class="method-source-code" id="suppress_signature-source">
643
- <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 103</span>
680
+ <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 109</span>
644
681
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">suppress_signature</span>(<span class="ruby-identifier">reason</span> = <span class="ruby-keyword">nil</span>)
645
682
  <span class="ruby-identifier">suppress</span>(<span class="ruby-constant">Suppression</span><span class="ruby-operator">::</span><span class="ruby-constant">Signature</span>, <span class="ruby-identifier">reason</span>)
646
683
  <span class="ruby-keyword">end</span></pre>
@@ -677,7 +714,7 @@ custom signature but not both will be present.</p>
677
714
 
678
715
 
679
716
  <div class="method-source-code" id="suppress_unique_identifier-source">
680
- <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 119</span>
717
+ <pre><span class="ruby-comment"># File lib/esp/resources/alert.rb, line 125</span>
681
718
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">suppress_unique_identifier</span>(<span class="ruby-identifier">reason</span> = <span class="ruby-keyword">nil</span>)
682
719
  <span class="ruby-identifier">suppress</span>(<span class="ruby-constant">Suppression</span><span class="ruby-operator">::</span><span class="ruby-constant">UniqueIdentifier</span>, <span class="ruby-identifier">reason</span>)
683
720
  <span class="ruby-keyword">end</span></pre>
@@ -122,6 +122,8 @@
122
122
 
123
123
  <li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
124
124
 
125
+ <li><a href="../ESP/Metadata.html">ESP::Metadata</a>
126
+
125
127
  <li><a href="../ESP/Organization.html">ESP::Organization</a>
126
128
 
127
129
  <li><a href="../ESP/Region.html">ESP::Region</a>
@@ -122,6 +122,8 @@
122
122
 
123
123
  <li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
124
124
 
125
+ <li><a href="../ESP/Metadata.html">ESP::Metadata</a>
126
+
125
127
  <li><a href="../ESP/Organization.html">ESP::Organization</a>
126
128
 
127
129
  <li><a href="../ESP/Region.html">ESP::Region</a>
@@ -134,6 +134,8 @@
134
134
 
135
135
  <li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
136
136
 
137
+ <li><a href="../ESP/Metadata.html">ESP::Metadata</a>
138
+
137
139
  <li><a href="../ESP/Organization.html">ESP::Organization</a>
138
140
 
139
141
  <li><a href="../ESP/Region.html">ESP::Region</a>
@@ -122,6 +122,8 @@
122
122
 
123
123
  <li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
124
124
 
125
+ <li><a href="../ESP/Metadata.html">ESP::Metadata</a>
126
+
125
127
  <li><a href="../ESP/Organization.html">ESP::Organization</a>
126
128
 
127
129
  <li><a href="../ESP/Region.html">ESP::Region</a>
@@ -132,6 +132,8 @@
132
132
 
133
133
  <li><a href="../ESP/ExternalAccount.html">ESP::ExternalAccount</a>
134
134
 
135
+ <li><a href="../ESP/Metadata.html">ESP::Metadata</a>
136
+
135
137
  <li><a href="../ESP/Organization.html">ESP::Organization</a>
136
138
 
137
139
  <li><a href="../ESP/Region.html">ESP::Region</a>