Class: Rafflesia::InfraRequestRecord

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/system/infra_request_record.rb

Constant Summary collapse

HASH_ATTRS =
{
  actor: :actor,
  attempt: :attempt,
  created_at: :created_at,
  duration_ms: :duration_ms,
  error_code: :error_code,
  error_message: :error_message,
  finished_at: :finished_at,
  infra_request_id: :infra_request_id,
  is_ok: :is_ok,
  metadata: :metadata,
  method: :method,
  operation: :operation,
  provenance: :provenance,
  query_string: :query_string,
  request_digest: :request_digest,
  request_id: :request_id,
  request_size_bytes: :request_size_bytes,
  resource_path: :resource_path,
  response_size_bytes: :response_size_bytes,
  started_at: :started_at,
  status: :status,
  status_code: :status_code,
  target: :target,
  target_endpoint: :target_endpoint
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ InfraRequestRecord

Returns a new instance of InfraRequestRecord.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rafflesia/system/infra_request_record.rb', line 61

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @actor = hash[:actor] ? Rafflesia::AuditLogActor.new(hash[:actor]) : nil
  @attempt = hash[:attempt]
  @created_at = hash[:created_at]
  @duration_ms = hash[:duration_ms]
  @error_code = hash[:error_code]
  @error_message = hash[:error_message]
  @finished_at = hash[:finished_at]
  @infra_request_id = hash[:infra_request_id]
  @is_ok = hash[:is_ok]
  @metadata = hash[:metadata] || {}
  @method = hash[:method]
  @operation = hash[:operation]
  @provenance = hash[:provenance] || {}
  @query_string = hash[:query_string]
  @request_digest = hash[:request_digest]
  @request_id = hash[:request_id]
  @request_size_bytes = hash[:request_size_bytes]
  @resource_path = hash[:resource_path]
  @response_size_bytes = hash[:response_size_bytes]
  @started_at = hash[:started_at]
  @status = hash[:status]
  @status_code = hash[:status_code]
  @target = hash[:target]
  @target_endpoint = hash[:target_endpoint]
end

Instance Attribute Details

#actorObject

Returns the value of attribute actor.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def actor
  @actor
end

#attemptObject

Returns the value of attribute attempt.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def attempt
  @attempt
end

#created_atObject

Returns the value of attribute created_at.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def created_at
  @created_at
end

#duration_msObject

Returns the value of attribute duration_ms.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def duration_ms
  @duration_ms
end

#error_codeObject

Returns the value of attribute error_code.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def error_code
  @error_code
end

#error_messageObject

Returns the value of attribute error_message.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def error_message
  @error_message
end

#finished_atObject

Returns the value of attribute finished_at.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def finished_at
  @finished_at
end

#infra_request_idObject

Returns the value of attribute infra_request_id.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def infra_request_id
  @infra_request_id
end

#is_okObject

Returns the value of attribute is_ok.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def is_ok
  @is_ok
end

#metadataObject

Returns the value of attribute metadata.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def 
  @metadata
end

#methodObject

Returns the value of attribute method.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def method
  @method
end

#operationObject

Returns the value of attribute operation.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def operation
  @operation
end

#provenanceObject

Returns the value of attribute provenance.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def provenance
  @provenance
end

#query_stringObject

Returns the value of attribute query_string.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def query_string
  @query_string
end

#request_digestObject

Returns the value of attribute request_digest.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def request_digest
  @request_digest
end

#request_idObject

Returns the value of attribute request_id.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def request_id
  @request_id
end

#request_size_bytesObject

Returns the value of attribute request_size_bytes.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def request_size_bytes
  @request_size_bytes
end

#resource_pathObject

Returns the value of attribute resource_path.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def resource_path
  @resource_path
end

#response_size_bytesObject

Returns the value of attribute response_size_bytes.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def response_size_bytes
  @response_size_bytes
end

#started_atObject

Returns the value of attribute started_at.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def status
  @status
end

#status_codeObject

Returns the value of attribute status_code.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def status_code
  @status_code
end

#targetObject

Returns the value of attribute target.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def target
  @target
end

#target_endpointObject

Returns the value of attribute target_endpoint.



35
36
37
# File 'lib/rafflesia/system/infra_request_record.rb', line 35

def target_endpoint
  @target_endpoint
end