DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing a SCOadmin manager

Object call example

An example of a typical object call and its return value follows. This call gets the home directory for the user object forbin:

   ObjectGet {sco user} forbin {pw_dir}
This returns:
   {get {sco user} forbin {{pw_dir /u/forbin}} {} {} {}}
The return value consists of a Tcl list of responses (sometimes referred to as ``BMIP responses'') for each object. In this case there was only one object, forbin. The return consists of seven fields, some of which are empty: Routines deecribed in the Bmip(TCL_ADM) manual page can be used in Tcl scripts to extract values of specific fields within BMIP responses.

You must use the object definition to determine what operations are legal for a specific object. A readonly object will not honor an ObjectReplace call and will return an error. For example, the storage device OSA is mostly readonly - it can only read information about storage devices, but cannot change their characteristics (aside from formatting a disk). Therefore, the only legal object calls are ObjectGet and ObjectAction. ObjectAction is only legal if the specified action has been defined for that class. It is an extension of the object API which allows for operations which do not fit into any of the predefined operations. A typical use of ObjectAction to format a floppy is:

   osavtcl> ObjectAction {sco LogicalStorageDevice} \
   	{{FloppyDisk0 /dev/rfd0135ds18}} format {}
For object calls that work with attributes (ObjectGet, ObjectReplaceWithDefault, ObjectReplace, ObjectAdd, and ObjectRemove), the specific attributes of the object class must be known. Also, ObjectAdd and ObjectRemove work only with attributes that are set-valued; that is, they can contain more than one value. An example of using set-valued attributes follows, in which the set of groups for the user forbin is changed:
   ObjectReplace {sco user} forbin {{groups {other backup}}}

Next topic: Remote object calls
Previous topic: About SCOadmin objects

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003