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.



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

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 67

#policy_idInteger (readonly) Also known as: id

Returns the jss id of the poolicy.

Returns:

  • (Integer)

    the jss id of the poolicy



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

alias id policy_id

#policy_nameString (readonly) Also known as: name

Returns the name of the policy.

Returns:

  • (String)

    the name of the policy.



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

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 71

#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 64

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



76
77
78
# File 'lib/jamf/api/classic/api_objects/management_history/policy_log.rb', line 76

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