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)

Swaroop,

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:

https://github.com/cwaldbieser/grouper_jython_scripts

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


[root@grouper0
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
path).
: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>
grouper.properties read from:
/var/opt/internet2/grouper/grouper.apiBinary/conf/grouper.properties
Grouper current directory is: /var/opt/internet2/grouper/grouper.apiBinary
log4j.properties read from:
/var/opt/internet2/grouper/grouper.apiBinary/conf/log4j.properties
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
log4j.properties
grouper.hibernate.properties:
/var/opt/internet2/grouper/grouper.apiBinary/conf/grouper.hibernate.properties
grouper.hibernate.properties:
null@null
sources.xml read from:
/var/opt/internet2/grouper/grouper.apiBinary/conf/sources.xml
sources.xml groupersource id: g:gsa
sources.xml ldap source id: ldap: /etc/grouper/ldap.local.properties
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.

Thanks,
Carl Waldbieser
ITS Systems Programmer
Lafayette College

[1] https://github.com/wgthom/groovysh4grouper

----- Original Message -----
From: "Katika,Shanthi Swaroop"
<>
To:

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

Hi,
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 ?

Thanks!
Swaroop



Archive powered by MHonArc 2.6.16.

Top of Page