Command line manipulation of objects
By Fat Bloke on Jul 05, 2007
Up to version 4.31 SGD has had 2 GUI sysadmin tools:
- Object Manager - configuration of apps, servers and users;
- Array Manager - configuration of the SGD software itself.
In this blog we'll look at Object Manager equivalent command lines, and in later blogs we'll cover the Array Manager equivalents.
Manipulation of objects is all via the
/opt/tarantella/bin/tarantella object command. There are 2 types of objects:leaf objects and container objects; and objects can be created, deleted, edited and listed.
As a simple example here's how you can browse the SGD datastore: A default datastore starts off with a root container called "o=organization" and you can list the contents of containers using the
/opt/tarantella/bin/tarantella object list_contents --name "o=organization"
Doing this you get output like this:
And then you can examine the leaf objects, so:
/opt/tarantella/bin/tarantella object list_attributes --name "o=organization/cn=xclock (servername)"
Attributes for .../_ens/o=organization/cn=xclock (servername):
Name: "xclock (servername)"
appserv: "o=organization/cn=Tarantella server servername"
args: "-bw 1 geometry 198x198+0+0"
You can change the object's attributes from the command line too. For example, let's make the clock bigger...
/opt/tarantella/bin/tarantella object edit --name "o=organization/cn=xclock (servername)" --width 1000 --height 1000 --args "-bw 1 -geometry 1000x1000+0+0"
Notice how we changed 3 attribute values at once here.
Finally for now, the more observant amongst you may realize that when you run a command line, SGD starts up a jvm instance. And so running a script of multiple command lines may take some time as jvm's start up and close down. So we recommend in this instance that you use the
/opt/tarantella/bin/tarantella object script"command.
Fat Bloke uses this command in this simple script to provision his servers after install.