Class: JSS::ManagementHistory::PolicyLog

Inherits:
Object
  • Object
show all
Includes:
HashLike
Defined in:
lib/jss/api_object/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.



24
25
26
27
28
# File 'lib/jss/api_object/management_history/policy_log.rb', line 24

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/jss/api_object/management_history/policy_log.rb', line 43

#policy_idInteger (readonly) Also known as: id

Returns the jss id of the poolicy.

Returns:

  • (Integer)

    the jss id of the poolicy



33
# File 'lib/jss/api_object/management_history/policy_log.rb', line 33

alias id policy_id

#policy_nameString (readonly) Also known as: name

Returns the name of the policy.

Returns:

  • (String)

    the name of the policy.



38
# File 'lib/jss/api_object/management_history/policy_log.rb', line 38

alias name policy_name

#statusSymbol (readonly)

Returns :completed or :failed.

Returns:

  • (Symbol)

    :completed or :failed



# File 'lib/jss/api_object/management_history/policy_log.rb', line 47

#usernameString (readonly)

Returns The username active for the policy.

Returns:

  • (String)

    The username active for the policy



# File 'lib/jss/api_object/management_history/policy_log.rb', line 40

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



52
53
54
# File 'lib/jss/api_object/management_history/policy_log.rb', line 52

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