Class: Jamf::ComputerGroup

Inherits:
Group show all
Includes:
MDM, MacOSManagedUpdates, MacOSRedeployMgmtFramework
Defined in:
lib/jamf/api/classic/api_objects/computer_group.rb

Overview

A computer group in the JSS

See also the parent class Jamf::Group

See Also:

Constant Summary collapse

RSRC_BASE =

The base for REST resources of this class

'computergroups'
RSRC_LIST_KEY =

the hash key used for the JSON list output of all objects in the JSS

:computer_groups
RSRC_OBJECT_KEY =

The hash key used for the JSON object output. It’s also used in various error messages

:computer_group
MEMBER_CLASS =

this allows the parent Group class to do things right

Jamf::Computer
ADD_MEMBERS_ELEMENT =

the XML element for immediate member additions via PUT

'computer_additions'.freeze
REMOVE_MEMBERS_ELEMENT =

the XML element for immediate member removals via PUT

'computer_deletions'.freeze
OBJECT_HISTORY_OBJECT_TYPE =

the object type for this object in the object history table. See APIObject#add_object_history_entry

7
MDM_COMMAND_TARGET =

what kind of devices are these WRT MDM

:computergroups

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Jamf::Group

Instance Attribute Details

#criteriaJamf::Criteriable::Criteria Originally defined in module Criteriable

Returns the criteria for the instance into which we’re mixed.

Returns:

#need_to_updateBoolean (readonly) Originally defined in module Updatable

Returns do we have unsaved changes?.

Returns:

  • (Boolean)

    do we have unsaved changes?

Instance Method Details

#blank_pushvoid Also known as: send_blank_push, noop Originally defined in module MDM

This method returns an undefined value.

Send a blank push to this object

#clear_passcodeObject Originally defined in module MDM

Send an clear_passcode command to this object

#clear_restrictions_passwordObject Originally defined in module MDM

Send an clear_restrictions_password command to this object

#delete_user(user) ⇒ Object Originally defined in module MDM

Send a delete_user command to this computer or group

Parameters:

  • user (String)

    the username of the acct to delete

#device_lock(passcode_or_message = '') ⇒ Object Also known as: lock, lock_device Originally defined in module MDM

Send a dev lock to this object

Parameters:

  • passcode_or_message (String) (defaults to: '')

    a six-char passcode, required for computers & computergroups Or an optional message to display on mobiledevices & mobiledevicegroups

#device_name(name) ⇒ Object Also known as: set_name, set_device_name Originally defined in module MDM

Send a device_name command to this object

Parameters:

  • name (String)

    The new name

#disable_app_analyticsObject Originally defined in module MDM

Send a disable_app_analytics command to this object

#disable_data_roamingObject Originally defined in module MDM

Send a disable_data_roaming command to this object

#disable_diagnostic_submissionObject Originally defined in module MDM

Send a disable_diagnostic_submission command to this object

#disable_lost_modeObject Originally defined in module MDM

Send a disable_lost_mode command to this object

#disable_remote_desktopObject Originally defined in module MDM

Send a disable_remote_desktop command to this computer or group

#disable_voice_roamingObject Originally defined in module MDM

Send a disable_voice_roaming command to this object

#enable_app_analyticsObject Originally defined in module MDM

Send an enable_app_analytics command to this object

#enable_data_roamingObject Originally defined in module MDM

Send an enable_data_roaming command to this object

#enable_diagnostic_submissionObject Originally defined in module MDM

Send an enable_diagnostic_submission command to this object

#enable_lost_mode(message: nil, phone: nil, footnote: nil, enforce_lost_mode: false, play_sound: false) ⇒ Object Originally defined in module MDM

Send a enable_lost_mode command to one or more targets

Either or both of message and phone number must be provided

Parameters:

  • message (String) (defaults to: nil)

    The message to display on the lock screen

  • phone_number (String)

    The phone number to display on the lock screen

  • footnote (String) (defaults to: nil)

    Optional footnote to display on the lock screen

  • play_sound (Boolean) (defaults to: false)

    Play a sound when entering lost mode

  • enforce_lost_mode (Boolean) (defaults to: false)

    Re-enable lost mode when re-enrolled after wipe. Default is false

#enable_remote_desktopObject Originally defined in module MDM

Send an enable_remote_desktop command to this computer or group

#enable_voice_roamingObject Originally defined in module MDM

Send an enable_voice_roaming command to this object

#erase_device(passcode = '', preserve_data_plan: false) ⇒ Object Also known as: wipe_device, wipe_computer, wipe, erase Originally defined in module MDM

Send an erase device command to this object

Parameters:

  • passcode (String) (defaults to: '')

    a six-char passcode, required for computers & computergroups

#flush_mdm_commands(status) ⇒ void Originally defined in module MDM

This method returns an undefined value.

flush pending and/or failed MDM commands for this object

Parameters:

  • status (String)

    a key from Commandable::FLUSHABLE_STATUSES

#member_mac_addressesArray<String>

Return an array of the mac_addrs of members in this group

Returns:



96
97
98
# File 'lib/jamf/api/classic/api_objects/computer_group.rb', line 96

def member_mac_addresses
  @members.map { |m| m[:mac_address] } + @members.map { |m| m[:alt_mac_address] }
end

#member_serial_numbersArray<String>

The serial numbers of members in this group

Returns:



87
88
89
# File 'lib/jamf/api/classic/api_objects/computer_group.rb', line 87

def member_serial_numbers
  @members.map { |m| m[:serial_number] }
end

#passcode_lock_grace_period(secs) ⇒ Object Originally defined in module MDM

Send a passcode_lock_grace_period command to this object

Parameters:

  • secs (Integer)

    The numer of seconds for the grace period

#play_lost_mode_soundObject Originally defined in module MDM

Send a play_lost_mode_sound command to this object

#redeploy_mgmt_frameworkObject Originally defined in module MacOSRedeployMgmtFramework

Send a managed update command to an instance of Computer or ComputerGroup. This just calls the class method of the same name.

#restart_deviceObject Also known as: restart Originally defined in module MDM

Send a restart_device command to this object

#send_managed_os_update(updateAction:, maxDeferrals: nil, version: nil, skipVersionVerification: false, applyMajorUpdate: false, forceRestart: false) ⇒ Object Originally defined in module MacOSManagedUpdates

Send a managed update command to an instance of Computer or ComputerGroup. This just calls the class method of the same name.

#shut_down_deviceObject Also known as: shutdown_device, shut_down, shutdown Originally defined in module MDM

Send a shut_down_device command to this object

#unlock_user_account(user) ⇒ Object Originally defined in module MDM

Send an unlock_user_account command to this computer or group

Parameters:

  • user (String)

    the username of the acct to unlock

#unmanage_deviceObject Also known as: remove_mdm_profile Originally defined in module MDM

Send an unmanage device command to this object

NOTE: when used with computers, the mdm profile will probably be re-installed immediately unless the computer is also no longer managed by Jamf Pro itself. To fully unmanage a computer, use the Computer#make_unmanaged instance method.

#update_inventoryObject Also known as: recon Originally defined in module MDM

Send an update_inventory command to this object

#wallpaper(wallpaper_setting: nil, wallpaper_content: nil, wallpaper_id: nil) ⇒ Object Also known as: set_wallpaper Originally defined in module MDM

Send a wallpaper command to this object

Parameters:

  • wallpaper_setting (Symbol) (defaults to: nil)

    :lock_screen, :home_screen, or :lock_and_home_screen

  • wallpaper_content (String, Pathname) (defaults to: nil)

    The local path to a .png or .jpg to use as the walpaper image, required if no wallpaper_id

  • wallpaper_id (Symbol) (defaults to: nil)

    The id of an Icon in Jamf Pro to use as the wallpaper image, required if no wallpaper_content