Class: JSS::ComputerGroup

Inherits:
Group show all
Defined in:
lib/jss-api/api_object/group/computer_group.rb,
lib/jss-api.rb

Overview

A computer group in the JSS

See also the parent class JSS::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
VALID_DATA_KEYS =

these keys, as well as :id and :name, are present in valid API JSON data for this class

[:is_smart, :computers ]
MEMBER_CLASS =

this allows the parent Group class to do things right

JSS::Computer

Constants inherited from Group

Group::GROUP_TYPES

Constants included from Criteriable

JSS::Criteriable::CRITERIABLE

Constants included from Updatable

Updatable::UPDATABLE

Constants included from Creatable

JSS::Creatable::CREATABLE

Constants inherited from APIObject

APIObject::DEFAULT_LOOKUP_KEYS, APIObject::REQUIRED_DATA_KEYS

Instance Attribute Summary

Attributes inherited from Group

#is_smart, #members, #notify_on_change, #site

Attributes included from Criteriable

#criteria

Attributes included from Updatable

#need_to_update

Attributes inherited from APIObject

#id, #in_jss, #name, #rest_rsrc

Instance Method Summary collapse

Methods inherited from Group

#add_member, all_smart, all_static, #clear, #create, #criteria=, #delete, #initialize, #member_ids, #member_names, #refresh_members, #remove_member, #size, #update

Methods included from Criteriable

#parse_criteria, #should_update

Methods included from Updatable

#name=, #update

Methods included from Creatable

#create

Methods inherited from APIObject

all, all_ids, all_names, #delete, get_name, #initialize, map_all_ids_to, #save, xml_list

Constructor Details

This class inherits a constructor from JSS::Group

Instance Method Details

#member_mac_addressesArray<String>

Return an array of the mac_addrs of members in this group

Returns:



114
115
116
# File 'lib/jss-api/api_object/group/computer_group.rb', line 114

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:



105
106
107
# File 'lib/jss-api/api_object/group/computer_group.rb', line 105

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