Class: CfnGuardian::Models::HttpEvent

Inherits:
BaseEvent
  • Object
show all
Defined in:
lib/cfnguardian/models/event.rb

Direct Known Subclasses

InternalHttpEvent

Instance Attribute Summary collapse

Attributes inherited from BaseEvent

#cron, #enabled, #environment, #group, #hash, #name, #resource, #ssm_parameters, #target, #type

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ HttpEvent

Returns a new instance of HttpEvent.



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/cfnguardian/models/event.rb', line 44

def initialize(resource)
  super(resource)
  @group = 'Http'
  @name = 'HttpEvent'
  @target = 'HttpCheckFunction'
  @endpoint = resource['Id']
  @method = resource.fetch('Method','GET')
  @timeout = resource.fetch('Timeout',50)
  @status_code = resource.fetch('StatusCode',200)
  @body_regex = resource.fetch('BodyRegex',nil)
  @headers = resource.fetch('Headers',nil)
  @user_agent = resource.fetch('UserAgent',nil)
  @payload = resource.fetch('Payload',nil)
  @compressed = resource.fetch('Compressed',false)
end

Instance Attribute Details

#body_regexObject

Returns the value of attribute body_regex.



36
37
38
# File 'lib/cfnguardian/models/event.rb', line 36

def body_regex
  @body_regex
end

#endpointObject

Returns the value of attribute endpoint.



36
37
38
# File 'lib/cfnguardian/models/event.rb', line 36

def endpoint
  @endpoint
end

#headersObject

Returns the value of attribute headers.



36
37
38
# File 'lib/cfnguardian/models/event.rb', line 36

def headers
  @headers
end

#methodObject

Returns the value of attribute method.



36
37
38
# File 'lib/cfnguardian/models/event.rb', line 36

def method
  @method
end

#payloadObject

Returns the value of attribute payload.



36
37
38
# File 'lib/cfnguardian/models/event.rb', line 36

def payload
  @payload
end

#status_codeObject

Returns the value of attribute status_code.



36
37
38
# File 'lib/cfnguardian/models/event.rb', line 36

def status_code
  @status_code
end

#timeoutObject

Returns the value of attribute timeout.



36
37
38
# File 'lib/cfnguardian/models/event.rb', line 36

def timeout
  @timeout
end