Groups¶
The groups resource adds support for managing chef groups.
Supported Operations¶
API Reference¶
-
class
pastry.resources.groups.
Groups
[source]¶ Provides access to the chef groups resource
-
classmethod
create
(group)[source]¶ Creates a new chef group on the server
The group hash should be in the form:
{ 'groupname': <groupname>, 'name': <groupname>, 'actors': { #optional 'users': <list of usernames>, # optional 'clients': <list of clients>, #optional 'groups': <list of groups> #optional } }
Parameters: group (hash) – The group to create Returns: The groupname and url Return type: hash
-
classmethod
delete
(groupname)[source]¶ Deletes a group from the chef server
Parameters: groupname (string) – The Group’s groupname Returns: The deleted group’s name Return type: hash
-
classmethod
exists
(groupname)[source]¶ Checks if a group exists on the chef server
Parameters: username – The Group’s groupname Returns: If the group exists Return type: boolean
-
classmethod
get
(groupname)[source]¶ Fetches a group from the chef server
Note
Chef returns a slightly different format to what it expects for create/update groups.
Parameters: groupname (string) – The Group’s name Returns: The chef group and members Return type: hash
-
classmethod