Class: ESP::CloudTrailEvent

Inherits:
Resource
  • Object
show all
Defined in:
lib/esp/resources/cloud_trail_event.rb

Constant Summary

Constants inherited from Resource

Resource::PREDICATES

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

arrange_options, filters, make_pageable, #serializable_hash

Class Method Details

.find(*arguments) ⇒ Object

Find a CloudTrailEvent by id

Parameter

id | Required | The ID of the cloud trail event to retrieve

:call-seq:

find(id)


41
42
43
44
45
46
47
48
# File 'lib/esp/resources/cloud_trail_event.rb', line 41

def self.find(*arguments)
  scope = arguments.slice!(0)
  options = (arguments.slice!(0) || {}).with_indifferent_access
  return super(scope, options) if scope.is_a?(Numeric) || options[:from].present?
  params = options.fetch(:params, {}).with_indifferent_access
  alert_id = params.delete(:alert_id)
  for_alert(alert_id)
end

.for_alert(alert_id = nil) ⇒ Object

Returns a paginated collection of cloud trail events for the given alert_id Convenience method to use instead of ::find since an alert_id is required to return cloud trail events.

Parameter

alert_id | Required | The ID of the alert to retrieve cloud trail events for

Example

alerts = ESP::CloudTrailEvent.for_alert(1194)


27
28
29
30
31
# File 'lib/esp/resources/cloud_trail_event.rb', line 27

def self.for_alert(alert_id = nil)
  fail ArgumentError, "You must supply an alert id." unless alert_id.present?
  from = "#{prefix}alerts/#{alert_id}/cloud_trail_events.json"
  find(:all, from: from)
end

.whereObject

Not Implemented. You cannot search for a CloudTrailEvent.



4
5
6
# File 'lib/esp/resources/cloud_trail_event.rb', line 4

def self.where(*)
  fail ESP::NotImplementedError
end

Instance Method Details

#destroyObject

Not Implemented. You cannot destroy a CloudTrailEvent.



14
15
16
# File 'lib/esp/resources/cloud_trail_event.rb', line 14

def destroy
  fail ESP::NotImplementedError
end

#saveObject

Not Implemented. You cannot create or update a CloudTrailEvent.



9
10
11
# File 'lib/esp/resources/cloud_trail_event.rb', line 9

def save
  fail ESP::NotImplementedError
end