Class: LogStash::Inputs::AkamaiSiem::Exception

Inherits:
Struct
  • Object
show all
Extended by:
MiddlewareRegistry
Defined in:
lib/logstash/inputs/akamai_siem/exception.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MiddlewareRegistry

lookup_middleware, register_middleware, registered_middleware, unregister_middleware

Instance Attribute Details

#client_ipObject

Returns the value of attribute client_ip

Returns:

  • (Object)

    the current value of client_ip



4
5
6
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 4

def client_ip
  @client_ip
end

#detailObject

Returns the value of attribute detail

Returns:

  • (Object)

    the current value of detail



4
5
6
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 4

def detail
  @detail
end

#instanceObject

Returns the value of attribute instance

Returns:

  • (Object)

    the current value of instance



4
5
6
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 4

def instance
  @instance
end

#request_idObject

Returns the value of attribute request_id

Returns:

  • (Object)

    the current value of request_id



4
5
6
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 4

def request_id
  @request_id
end

#request_timeObject

Returns the value of attribute request_time

Returns:

  • (Object)

    the current value of request_time



4
5
6
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 4

def request_time
  @request_time
end

#server_ipObject

Returns the value of attribute server_ip

Returns:

  • (Object)

    the current value of server_ip



4
5
6
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 4

def server_ip
  @server_ip
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



4
5
6
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 4

def title
  @title
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



4
5
6
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 4

def type
  @type
end

Class Method Details

.create(body) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 7

def self.create(body)
  data = ::LogStash::Json.jruby_load(body)
  exception = new(data['type'])
  exception.type = data['type']
  exception.title = data['title']
  exception.instance = data['instance']
  exception.detail = data['detail']
  exception.server_ip = data['serverIp']
  exception.client_ip = data['clientIp']
  exception.request_id = data['requestId']
  exception.request_time = data['requestTime']
  exception
end

Instance Method Details

#backtraceObject



25
26
27
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 25

def backtrace
  []
end

#marshal_dumpObject



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 29

def marshal_dump
  {
    type: self.type,
    title: self.title,
    instance: self.instance,
    detail: self.detail,
    server_ip: self.server_ip,
    client_ip: self.client_ip,
    request_id: self.request_id,
    request_time: self.request_time,
  }
end

#marshal_load(serialised) ⇒ Object

Marshal serialization support. Restores the instance variables according to the serialised.

Parameters:

  • serialised (Hash)

    the serialised object.



45
46
47
48
49
50
51
52
53
54
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 45

def marshal_load(serialised)
  self.type = serialised[:type]
  self.title = serialised[:title]
  self.instance = serialised[:instance]
  self.detail = serialised[:detail]
  self.server_ip = serialised[:server_ip]
  self.client_ip = serialised[:client_ip]
  self.request_id = serialised[:request_id]
  self.request_time = serialised[:request_time]
end

#to_sObject



21
22
23
# File 'lib/logstash/inputs/akamai_siem/exception.rb', line 21

def to_s
  self.detail
end