Unsolved
This post is more than 5 years old
1 Rookie
•
8 Posts
0
4029
November 17th, 2017 07:00
OneFS modules for python.
I am planning to write python scripts for Isilon. What are the modules that I need to use and are they built in in python? Could someone give me as much details as you can.
No Events found!



Peter_Sero
4 Operator
•
1.2K Posts
1
November 17th, 2017 08:00
Take a look here:
Isilon SDK Info Hub
rajasekhar_redd
1 Rookie
•
8 Posts
0
November 19th, 2017 21:00
Thank you Peter Serocka for the helpful documentation on the API.
jepstein2
9 Posts
0
November 21st, 2017 10:00
This heavily depends on what you're trying to do. If you want to write scripts that will interface with the cluster from a remote machine, use Peter's suggestion by taking advantage of the API. If you would like to write scripts that will run on the cluster, you'll need to have an idea of what it is you want to write a script to do in order to figure out if the modules you need to use are available. You can look at the python modules available on any version of OneFS from the python interpreter prompt:
>>> help('modules')
You can then look at the methods/attributes available in any of the modules listed, for example, the io module:
>>> dir('io')
['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
Alternatively, you can use the inspect module to get more information about a module:
>>> import inspect
>>> for item in inspect.getmembers(io):
... print item
Further reading on any given python module can be found in the documentation (be sure to use the 2.6 docs):
The Python Standard Library — Python v2.6.9 documentation
OneFS uses 2.6.1, so there will be some slight differences here and there to what is listed in the 2.6.9 documentation.
As with any scripting, it is best to use a virtual machine or test cluster to test anything you write prior to running it on a production machine.