Class: JSS::ManagementHistory::MDMCommand

Inherits:
Object
  • Object
show all
Includes:
HashLike
Defined in:
lib/jss/api_object/management_history/mdm_command.rb

Overview

MDMCommand - an issued MDM command in a Jamf Object's Management History

This should only be instantiated by the ManagementHistory.mdm_commands method when mixed in to Computers or Mobile devices.

That method will return an array of these objects.

NOTE: some attributes will be nil for some statuses (e.g. no error message if not failed, no completed time if not completed)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ MDMCommand


30
31
32
33
34
35
# File 'lib/jss/api_object/management_history/mdm_command.rb', line 30

def initialize(args = {})
  args[:completed_epoch] ||= args[:date_time_completed_epoch]
  args[:issued_epoch] ||= args[:date_time_issued_epoch]
  args[:failed_epoch] ||= args[:date_time_failed_epoch]
  super args
end

Instance Attribute Details

#completed_epochInteger (readonly)

a unix epoch timestamp with milliseconds


# File 'lib/jss/api_object/management_history/mdm_command.rb', line 57

#errorString (readonly)


# File 'lib/jss/api_object/management_history/mdm_command.rb', line 46

#failed_epochInteger (readonly)

a unix epoch timestamp with milliseconds


# File 'lib/jss/api_object/management_history/mdm_command.rb', line 53

#issued_epochInteger (readonly)


# File 'lib/jss/api_object/management_history/mdm_command.rb', line 49

#last_push_epochInteger (readonly)

pending command, a unix epoch timestamp with milliseconds


# File 'lib/jss/api_object/management_history/mdm_command.rb', line 61

#nameString (readonly)


# File 'lib/jss/api_object/management_history/mdm_command.rb', line 37

#statusSymbol (readonly)


# File 'lib/jss/api_object/management_history/mdm_command.rb', line 43

#usernameString (readonly)


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

Instance Method Details

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

#completedTime


82
83
84
# File 'lib/jss/api_object/management_history/mdm_command.rb', line 82

def completed
  JSS.epoch_to_time @completed_epoch if @completed_epoch
end

#failedTime


75
76
77
# File 'lib/jss/api_object/management_history/mdm_command.rb', line 75

def failed
  JSS.epoch_to_time @failed_epoch if @failed_epoch
end

#issuedTime


68
69
70
# File 'lib/jss/api_object/management_history/mdm_command.rb', line 68

def issued
  JSS.epoch_to_time @issued_epoch if @issued_epoch
end

#last_pushTime


89
90
91
# File 'lib/jss/api_object/management_history/mdm_command.rb', line 89

def last_push
  JSS.epoch_to_time @last_push_epoch if @last_push_epoch
end