Class: Jamf::ManagementHistory::PolicyLog

Inherits:
Object
  • Object
show all
Includes:
HashLike
Defined in:
lib/jamf/api/classic/api_objects/management_history/policy_log.rb

Overview

PolicyLog - A Computer policy log history entry

This should only be instantiated by the ManagementHistory.policy_logs method when mixed in to Computers.

That method will return an array of these objects.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ PolicyLog

Returns a new instance of PolicyLog.



27
28
29
30
31
# File 'lib/jamf/api/classic/api_objects/management_history/policy_log.rb', line 27

def initialize(**args)
  # we want the status as a Symbol
  args[:status] &&= args[:status].downcase.to_sym
  super
end

Instance Attribute Details

#date_completed_epochInteger (readonly)

a unix epoch timestamp with milliseconds

Returns:

  • (Integer)

    When the policy completed, as



# File 'lib/jamf/api/classic/api_objects/management_history/policy_log.rb', line 46

#policy_idInteger (readonly) Also known as: id

Returns the jss id of the poolicy.

Returns:

  • (Integer)

    the jss id of the poolicy



36
# File 'lib/jamf/api/classic/api_objects/management_history/policy_log.rb', line 36

alias id policy_id

#policy_nameString (readonly) Also known as: name

Returns the name of the policy.

Returns:

  • (String)

    the name of the policy.



41
# File 'lib/jamf/api/classic/api_objects/management_history/policy_log.rb', line 41

alias name policy_name

#statusSymbol (readonly)

Returns :completed or :failed.

Returns:

  • (Symbol)

    :completed or :failed



# File 'lib/jamf/api/classic/api_objects/management_history/policy_log.rb', line 50

#usernameString (readonly)

Returns The username active for the policy.

Returns:

  • (String)

    The username active for the policy



# File 'lib/jamf/api/classic/api_objects/management_history/policy_log.rb', line 43

Instance Method Details

#[](attr) ⇒ Object Originally defined in module HashLike

#date_completedTime Also known as: completed

Returns When the policy completed, as a ruby Time object.

Returns:

  • (Time)

    When the policy completed, as a ruby Time object



55
56
57
# File 'lib/jamf/api/classic/api_objects/management_history/policy_log.rb', line 55

def date_completed
  JSS.epoch_to_time(@date_completed_epoch) if @date_completed_epoch
end