Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Creating groups through API

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Creating groups through API

Chronological Thread 
  • From: "Waldbieser, Carl" <>
  • To: "Katika,Shanthi Swaroop" <>
  • Cc:
  • Subject: Re: [grouper-users] Creating groups through API
  • Date: Thu, 5 May 2016 16:14:35 -0400 (EDT)


I'm not sure exactly what you are after, but when I found myself creating the
same pattern of folders and groups for each application we added to Grouper,
I wrote a script to use from the Grouper Shell Wrappers project[1] (which
just wraps the Grouper Shell in a nice REPL).

Here is my repository of handy scripts:

The "" script is one I use when setting up an "application" in
Grouper. I typical session would be like:

DEV grouper.apiBinary-2.2.2]# ./bin/gsh.jython
Using GROUPER_HOME: /opt/internet2/grouper/grouper.apiBinary-2.2.2
Using GROUPER_CONF: /opt/internet2/grouper/grouper.apiBinary-2.2.2/conf
Using JAVA: java
using MEMORY: 64m-750m
>>> import sys
>>> sys.path.append("/root/grouper_scripts")
>>> import skeleton
>>> print(skeleton.createAppSkeleton.__doc__)

Create the skeleton folder structure for a new application including
an administrative group.

:param:`session`: Grouper session.
:param:`parent_stem_path`: String path to parent folder.
:param:`app_extension`: String name of the app folder (*not* full
:param:`app_name`: String "friendly" name of app folder (defaults to
app extension).

>>> session = getRootSession()
Grouper starting up: version: 2.2.2, build date: null, env: <no label
configured> read from:
Grouper current directory is: /var/opt/internet2/grouper/grouper.apiBinary read from:
Grouper is logging to file:
/var/opt/internet2/grouper/grouper.apiBinary/logs/grouper_error.log, at min
level WARN for package: edu.internet2.middleware.grouper, based on
sources.xml read from:
sources.xml groupersource id: g:gsa
sources.xml ldap source id: ldap: /etc/grouper/
sources.xml groupersource id: grouperEntities
sources.xml jdbc source id: jdbc: GrouperJdbcConnectionProvider
>>> skeleton.createAppSkeleton(session, "lc:app", "myapp")

The script then uses the Grouper API to create a basic folder structure and
an admin group.

Carl Waldbieser
ITS Systems Programmer
Lafayette College


----- Original Message -----
From: "Katika,Shanthi Swaroop"

Sent: Thursday, May 5, 2016 3:24:07 PM
Subject: [grouper-users] Creating groups through API

I’m just starting to learn the application. I have the basic canonical groups
set up but I’m trying to create some custom groups on the fly based on the
field values. Is there a way in grouper to do it through api or config
changes without having to create each and every group manually? I have gone
through the documentation but haven’t found anything that alludes to it.

Also, I’m trying to do the same with opt in, opt out and overall groups. Is
there a way to create all those required groups without having to create them
manually for each canonical group ?


Archive powered by MHonArc 2.6.16.

Top of Page