[OpenAFS] building swig based interfaces

Jakub Moscicki Jakub.Moscicki@cern.ch
Sun, 1 Sep 2013 11:13:23 +0000


What is the use case you are trying to address?

Part of our service mgmt infrastructure is python-based, including a fairly=
 complex backup system. However, it builds on an API layer which internally=
 uses CLI via a subprocess (vos, fs, =85) and we found this is completely s=
ufficient.  Moreover, you do not expose to the python layer any runtime pro=
blems occurring in extension libraries such as crashes, memory leaks etc...=
 (this is effectively encapsulated in a subprocess) so I would even argue t=
hat from this point of view it is a technically more desirable approach (an=
d easier, too). However our internal API implements only what we need and i=
s quite limited.=20

Simple example of usage (sum the size occupied by volumes (which follow a c=
ertain name pattern) on all partitions of a file server)::

from cernafs import vos

  >>> for p in vos.listpart('afs108'):
  ...    print p, sum([v.sizeKB for v in vos.listvol('afs108',p) if v.name =
and v.name[0] in ['q','s']])/1024./1024.
   b 154.509589195
   c 260.041460991
   d 215.590883255
   e 292.481509209
   f 221.171380043
   g 262.226537704
   h 214.474150658
   i 159.367405891
   j 336.694796562
   k 227.23085022
   l 338.797628403
   m 283.453014374
   n 235.3145895
   o 148.527907372
   s 0.000127792358398


On Sep 1, 2013, at 12:27 PM, G=E9mes G=E9za <geza@kzsdabas.hu>

> Hi,
> I've decided to start a project for building a swig based python interfac=
e for afs commands/functions. The advantage is that a swig interface can be=
 further used for creating interfaces for other languages. Currently I know=
 about only one limited python-afs interface which calls the afs binary com=
mands instead of implementing an interface to the C code (https://github.co=
m/openafs-contrib/afspy). On the other hand the (to my knowledge) only inte=
rface: AFSPerl (http://cpansearch.perl.org/src/NOG/AFS-2.6.3/) uses subopti=
mal interfaces making it incompatible with 1.6.x and 64 bit (https://lists.=
> So if you can give me some pointers about where should I look in the open=
afs source for the declaration of different functions? My first guess would=
 be the files in libadmin, but I'm probably wrong :-(
> Thank you in advance!
> Cheers
> Geza Gemes
> _______________________________________________
> OpenAFS-info mailing list
> OpenAFS-info@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-info