Class: Jamf::ManagementHistory::MdmCommand
- 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
-
#completed_epoch ⇒ Integer
readonly
a unix epoch timestamp with milliseconds.
-
#error ⇒ String
readonly
The error message if status == :failed.
-
#failed_epoch ⇒ Integer
readonly
a unix epoch timestamp with milliseconds.
-
#issued_epoch ⇒ Integer
readonly
When the command was issued, as a unix epoch timestamp with milliseconds.
-
#last_push_epoch ⇒ Integer
readonly
pending command, a unix epoch timestamp with milliseconds.
-
#name ⇒ String
readonly
The name of the command.
-
#status ⇒ Symbol
readonly
:completed, :pending, or :failed.
-
#username ⇒ String
readonly
The username of associated with the command.
Instance Method Summary collapse
- #[](attr) ⇒ Object included from HashLike
-
#completed ⇒ Time
When the command completed, as a ruby Time object.
-
#failed ⇒ Time
When the command failed, as a ruby Time object.
-
#initialize(**args) ⇒ MdmCommand
constructor
A new instance of MdmCommand.
-
#issued ⇒ Time
When the command was issued, as a ruby Time object.
-
#last_push ⇒ Time
When the most recent attempt was made on a pending command, as a ruby Time object.
Constructor Details
#initialize(**args) ⇒ MdmCommand
Returns a new instance of MdmCommand.
54 55 56 57 58 59 |
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 54 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_epoch ⇒ Integer (readonly)
a unix epoch timestamp with milliseconds
|
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 81
|
#error ⇒ String (readonly)
Returns The error message if status == :failed.
|
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 70
|
#failed_epoch ⇒ Integer (readonly)
a unix epoch timestamp with milliseconds
|
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 77
|
#issued_epoch ⇒ Integer (readonly)
Returns 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 73
|
#last_push_epoch ⇒ Integer (readonly)
pending command, a unix epoch timestamp with milliseconds
|
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 85
|
#name ⇒ String (readonly)
Returns the name of the command.
|
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 61
|
#status ⇒ Symbol (readonly)
Returns :completed, :pending, or :failed.
|
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 67
|
#username ⇒ String (readonly)
Returns the username of associated with the command.
|
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 64
|
Instance Method Details
#completed ⇒ Time
Returns When the command completed, as a ruby Time object.
106 107 108 |
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 106 def completed JSS.epoch_to_time @completed_epoch if @completed_epoch end |
#failed ⇒ Time
Returns When the command failed, as a ruby Time object.
99 100 101 |
# File 'lib/jamf/api/classic/api_objects/management_history/mdm_command.rb', line 99 def failed JSS.epoch_to_time @failed_epoch if @failed_epoch end |