lib/jss/api_object/mdm.rb
# Flush pending or failed commands on devices or groups
#
# @param targets[String,Integer,Array<String,Integer>]
#   the name or id of the device or group to flush commands, or
#   an array of such names or ids, or a comma-separated string
#   of them. NOTE: when calling this on a Group class, the targets
#   are the groups themselves, not the individual members.
#
# @param status[String] a key from {JSS::Commandable::FLUSHABLE_STATUSES}
#
# @param api[JSS::APIConnection] an API connection to use.
#   Defaults to the corrently active API. See {JSS::APIConnection}
#
# @return [void]
#
Flush pending or failed commands on devices or groups
Flush pending or failed commands on devices or groups
def flush_mdm_commands(targets, status: nil, api: JSS.api)
        raise JSS::InvalidDataError, "Status must be one of :#{FLUSHABLE_STATUSES.keys.join ', :'}" unless FLUSHABLE_STATUSES.keys.include? status
        status = FLUSHABLE_STATUSES[status]
        target_ids = raw_targets_to_ids targets, api: api, expand_groups: false
        command_flush_rsrc = "commandflush/#{self::MDM_COMMAND_TARGET}/id"
        flush_rsrc = "#{command_flush_rsrc}/#{target_ids.join ','}/status/#{status}"
        puts "Sending API DELETE: #{flush_rsrc}" if JSS.devmode?
        api.delete_rsrc flush_rsrc
      end
def flush_mdm_commands ( targets , status : nil , api : JSS . api ) raise JSS :: InvalidDataError , "Status must be one of :#{FLUSHABLE_STATUSES.keys.join ', :'}" unless FLUSHABLE_STATUSES . keys . include? status status = FLUSHABLE_STATUSES [ status ] target_ids = raw_targets_to_ids targets , api : api , expand_groups : false command_flush_rsrc = "commandflush/#{self::MDM_COMMAND_TARGET}/id" flush_rsrc = "#{command_flush_rsrc}/#{target_ids.join ','}/status/#{status}" puts "Sending API DELETE: #{flush_rsrc}" if JSS . devmode? api . delete_rsrc flush_rsrc end
Flush pending or failed commands on devices or groups
Flush pending or failed commands on devices or groups
None
void
targets
the name or id of the device or group to flush commands, or an array of such names or ids, or a comma-separated string of them. NOTE: when calling this on a Group class, the targets are the groups themselves, not the individual members.
the name or id of the device or group to flush commands or an array of such names or ids or a comma - separated string of them . NOTE : when calling this on a Group class the targets are the groups themselves not the individual members .
status
a key from {JSS::Commandable::FLUSHABLE_STATUSES}
a key from { JSS :: Commandable :: FLUSHABLE_STATUSES }
api
an API connection to use. Defaults to the corrently active API. See {JSS::APIConnection}
an API connection to use . Defaults to the corrently active API . See { JSS :: APIConnection }