Class: NewRelic::Security::Agent::Control::AppInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/newrelic_security/agent/control/app_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAppInfo

Returns a new instance of AppInfo.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/newrelic_security/agent/control/app_info.rb', line 20

def initialize
  @collectorType = RUBY
  @language = Ruby
  @jsonName = :applicationinfo
  @collectorVersion = NewRelic::Security::VERSION
  @buildNumber = nil
  @jsonVersion = NewRelic::Security::Agent.config[:json_version]
  @startTime = current_time_millis
  @applicationUUID = NewRelic::Security::Agent.config[:uuid]
  @appAccountId = NewRelic::Security::Agent.config[:account_id]
  @appEntityGuid = NewRelic::Security::Agent.config[:entity_guid]
  @framework = NewRelic::Security::Agent.config[:framework]
  @groupName = NewRelic::Security::Agent.config[:mode]
  @userProvidedApplicationInfo = Hash.new
  @policyVersion = nil
  @userDir = nil
  @libraryPath = library_path
  @bootLibraryPath = EMPTY_STRING
  @binaryName = binary_name
  @binaryVersion = binary_version
  @pid = pid
  @cpid = cpid
  @binaryPath = binary_path
  @agentAttachmentType = STATIC
  @sha256 = sha_256
  @runCommand = run_command
  @cmdline = [run_command]
  @procStartTime = current_time_millis
  @osArch = os_arch
  @osName = os_name
  @osVersion = os_version
  @serverInfo = Hash.new # TODO: Fill this
  @identifier = Hash.new # TODO: Fill this
   = 
end

Instance Attribute Details

#jsonNameObject (readonly)

Returns the value of attribute jsonName.



18
19
20
# File 'lib/newrelic_security/agent/control/app_info.rb', line 18

def jsonName
  @jsonName
end

Instance Method Details

#as_jsonObject



56
57
58
59
60
# File 'lib/newrelic_security/agent/control/app_info.rb', line 56

def as_json
  instance_variables.map! do |ivar|
    [ivar[1..-1].to_sym, instance_variable_get(ivar)]
  end.to_h
end

#to_jsonObject



62
63
64
# File 'lib/newrelic_security/agent/control/app_info.rb', line 62

def to_json
  as_json.to_json
end

#update_app_infoObject



66
67
68
# File 'lib/newrelic_security/agent/control/app_info.rb', line 66

def update_app_info
  @identifier[KIND] = 'HOST' # TODO: Added other identifier details
end