Class: CmdbVulnerabilitySite

Inherits:
Domain::Model show all
Defined in:
lib/domain/site/model.rb

Overview

CmdbVulnerabilitySite represents a site from the Configuration Management Database (CMDB). It contains various attributes related to the site’s location, business context, and network information.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::Model

columns, from_csv, from_json, headers, #initialize, primary_key, table_name, #to_csv, #to_hash, #to_s

Constructor Details

This class inherits a constructor from Domain::Model

Instance Attribute Details

#assetsObject

Returns the value of attribute assets.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def assets
  @assets
end

#business_unit_codeObject

Returns the value of attribute business_unit_code.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def business_unit_code
  @business_unit_code
end

#country_codeObject

Returns the value of attribute country_code.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def country_code
  @country_code
end

#country_discovery_site_idObject

Returns the value of attribute country_discovery_site_id.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def country_discovery_site_id
  @country_discovery_site_id
end

#end_dayObject

Returns the value of attribute end_day.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def end_day
  @end_day
end

#end_hourObject

Returns the value of attribute end_hour.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def end_hour
  @end_hour
end

#engine_poolObject

Returns the value of attribute engine_pool.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def engine_pool
  @engine_pool
end

#network_zoneObject

Returns the value of attribute network_zone.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def network_zone
  @network_zone
end

#scan_engine_pool_idObject

Returns the value of attribute scan_engine_pool_id.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def scan_engine_pool_id
  @scan_engine_pool_id
end

#start_dayObject

Returns the value of attribute start_day.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def start_day
  @start_day
end

#start_hourObject

Returns the value of attribute start_hour.



123
124
125
# File 'lib/domain/site/model.rb', line 123

def start_hour
  @start_hour
end

Class Method Details

.viewObject



149
150
151
# File 'lib/domain/site/model.rb', line 149

def self.view
  'cmdb_vulnerability_site_view'
end

Instance Method Details

#asset_group_nameObject



141
142
143
# File 'lib/domain/site/model.rb', line 141

def asset_group_name
  [country_code, network_zone, business_unit_code].join(':')
end

#duration_in_hoursObject



145
146
147
# File 'lib/domain/site/model.rb', line 145

def duration_in_hours
  Service::TimeZone.duration_in_hours(start_day, start_hour, end_day, end_hour)
end

#nameObject



135
136
137
138
139
# File 'lib/domain/site/model.rb', line 135

def name
  prefix = [country_code, network_zone, business_unit_code].join ':'
  suffix = 'Vulnerability Scan'
  "#{prefix} #{suffix}"
end