Class: CtdDocumentation::Event
- Defined in:
- lib/ctd_documentation/models/event.rb
Overview
Event Model.
Instance Attribute Summary collapse
-
#alert_id ⇒ Integer
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService.
-
#description ⇒ String
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#last_updated ⇒ String
TODO: Write general description for this method.
-
#resource_id ⇒ String
TODO: Write general description for this method.
-
#site_id ⇒ Integer
TODO: Write general description for this method.
-
#status ⇒ String
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService.
-
#timestamp ⇒ String
TODO: Write general description for this method.
-
#type_name ⇒ String
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService.
-
#type_number ⇒ Integer
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(resource_id = SKIP, id = SKIP, site_id = SKIP, timestamp = SKIP, last_updated = SKIP, type_number = SKIP, description = SKIP, alert_id = SKIP, status = SKIP, type_name = SKIP) ⇒ Event
constructor
A new instance of Event.
Methods inherited from BaseModel
Constructor Details
#initialize(resource_id = SKIP, id = SKIP, site_id = SKIP, timestamp = SKIP, last_updated = SKIP, type_number = SKIP, description = SKIP, alert_id = SKIP, status = SKIP, type_name = SKIP) ⇒ Event
Returns a new instance of Event.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/ctd_documentation/models/event.rb', line 124 def initialize(resource_id = SKIP, id = SKIP, site_id = SKIP, = SKIP, last_updated = SKIP, type_number = SKIP, description = SKIP, alert_id = SKIP, status = SKIP, type_name = SKIP) @resource_id = resource_id unless resource_id == SKIP @id = id unless id == SKIP @site_id = site_id unless site_id == SKIP @timestamp = unless == SKIP @last_updated = last_updated unless last_updated == SKIP @type_number = type_number unless type_number == SKIP @description = description unless description == SKIP @alert_id = alert_id unless alert_id == SKIP @status = status unless status == SKIP @type_name = type_name unless type_name == SKIP end |
Instance Attribute Details
#alert_id ⇒ Integer
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService
63 64 65 |
# File 'lib/ctd_documentation/models/event.rb', line 63 def alert_id @alert_id end |
#description ⇒ String
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService
52 53 54 |
# File 'lib/ctd_documentation/models/event.rb', line 52 def description @description end |
#id ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/ctd_documentation/models/event.rb', line 18 def id @id end |
#last_updated ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/ctd_documentation/models/event.rb', line 30 def last_updated @last_updated end |
#resource_id ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/ctd_documentation/models/event.rb', line 14 def resource_id @resource_id end |
#site_id ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/ctd_documentation/models/event.rb', line 22 def site_id @site_id end |
#status ⇒ String
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService
74 75 76 |
# File 'lib/ctd_documentation/models/event.rb', line 74 def status @status end |
#timestamp ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/ctd_documentation/models/event.rb', line 26 def @timestamp end |
#type_name ⇒ String
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService
85 86 87 |
# File 'lib/ctd_documentation/models/event.rb', line 85 def type_name @type_name end |
#type_number ⇒ Integer
0: eNewAsset | 1: eAssetConflict | 2: eBaselineDeviation | 3: eThreat | 4: eAssetInformationChange | 5: eProtocolSpecific 6: eBaselineDown | 8: eBaselineVolumeDeviationHigh | 9: eBaselineVolumeDeviationLow | 10: eFTPData 11: eBaselineRule | 12: eHighArpActivity | 13: eKnownThreatEvent | 14: eFalseMac | 15: eSuspiciousFileTransfer 16: ePolicyViolation | 17: ePolicyRuleMatch | 18: eHostScan | 19: ePortScan | 20: eDenialOfService
41 42 43 |
# File 'lib/ctd_documentation/models/event.rb', line 41 def type_number @type_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/ctd_documentation/models/event.rb', line 147 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP last_updated = hash.key?('last_updated') ? hash['last_updated'] : SKIP type_number = hash.key?('type_number') ? hash['type_number'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP alert_id = hash.key?('alert_id') ? hash['alert_id'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP type_name = hash.key?('type_name') ? hash['type_name'] : SKIP # Create object from extracted values. Event.new(resource_id, id, site_id, , last_updated, type_number, description, alert_id, status, type_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/ctd_documentation/models/event.rb', line 88 def self.names @_hash = {} if @_hash.nil? @_hash['resource_id'] = 'resource_id' @_hash['id'] = 'id' @_hash['site_id'] = 'site_id' @_hash['timestamp'] = 'timestamp' @_hash['last_updated'] = 'last_updated' @_hash['type_number'] = 'type_number' @_hash['description'] = 'description' @_hash['alert_id'] = 'alert_id' @_hash['status'] = 'status' @_hash['type_name'] = 'type_name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
120 121 122 |
# File 'lib/ctd_documentation/models/event.rb', line 120 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/ctd_documentation/models/event.rb', line 104 def self.optionals %w[ resource_id id site_id timestamp last_updated type_number description alert_id status type_name ] end |