Sha256: 27e0a2f8a4ddf41056de7e065d8d164ccdfbe7c5dd3383626eb7df1d3d1ee760

Contents?: true

Size: 1014 Bytes

Versions: 1

Compression:

Stored size: 1014 Bytes

Contents

# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'contrast/agent/reporting/reporting_events/reporting_event'
require 'contrast/config'

module Contrast
  module Agent
    module Reporting
      #	AgentStartup Event which sends the agent data to TeamServer on the startup of a server or process,
      # used to create a new Server entity there.
      class AgentStartup < Contrast::Agent::Reporting::ReportingEvent
        def initialize
          @event_method = :PUT
          @event_endpoint = Contrast::Agent::Reporting::Endpoints::NG_ENDPOINTS[:agent_startup]
          @event_type = :agent_startup
          super
        end

        def to_controlled_hash
          {
              environment: ::Contrast::CONFIG.root.server.environment,
              tags: ::Contrast::CONFIG.root.server.tags,
              version: Contrast::Agent::VERSION
          }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
contrast-agent-6.0.0 lib/contrast/agent/reporting/reporting_events/agent_startup.rb