Class: Jamf::ManagementHistory::MdmCommand

Inherits:
Object
  • Object
show all
Includes:
HashLike
Defined in:
lib/jamf/api/classic/api_objects/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

Returns a new instance of MdmCommand.



33
34
35
36
37
38
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 33

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
end

Instance Attribute Details

#completed_epochInteger (readonly)

a unix epoch timestamp with milliseconds

Returns:

  • (Integer)

    When the command was completed, as



# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 60


#errorString (readonly)

Returns The error message if status == :failed.

Returns:

  • (String)

    The error message if status == :failed



# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 49


#failed_epochInteger (readonly)

a unix epoch timestamp with milliseconds

Returns:

  • (Integer)

    When the command failed, as



# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 56


#issued_epochInteger (readonly)

Returns When the command was issued, as a unix epoch timestamp with milliseconds.

Returns:

  • (Integer)

    When the command was issued, as a unix epoch timestamp with milliseconds



# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 52


#last_push_epochInteger (readonly)

pending command, a unix epoch timestamp with milliseconds

Returns:

  • (Integer)

    When the most recent attempt was made on a



# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 64


#nameString (readonly)

Returns the name of the command.

Returns:

  • (String)

    the name of the command.



# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 40


#statusSymbol (readonly)

Returns :completed, :pending, or :failed.

Returns:

  • (Symbol)

    :completed, :pending, or :failed



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


#usernameString (readonly)

Returns the username of associated with the command.

Returns:

  • (String)

    the username of associated with the command.



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


Instance Method Details

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

#completedTime

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

Returns:

  • (Time)

    When the command completed, as a ruby Time object



85
86
87
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 85

def completed
  JSS.epoch_to_time @completed_epoch if @completed_epoch
end

#failedTime

Returns When the command failed, as a ruby Time object.

Returns:

  • (Time)

    When the command failed, as a ruby Time object



78
79
80
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 78

def failed
  JSS.epoch_to_time @failed_epoch if @failed_epoch
end

#issuedTime

Returns When the command was issued, as a ruby Time object.

Returns:

  • (Time)

    When the command was issued, as a ruby Time object



71
72
73
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 71

def issued
  JSS.epoch_to_time @issued_epoch if @issued_epoch
end

#last_pushTime

Returns When the most recent attempt was made on a pending command, as a ruby Time object.

Returns:

  • (Time)

    When the most recent attempt was made on a pending command, as a ruby Time object



92
93
94
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 92

def last_push
  JSS.epoch_to_time @last_push_epoch if @last_push_epoch
end