Friday Sep 07, 2007

Using Python API scripts with Sun Connection


Did you know that you can use Python API scripts to automate Sun Connection tasks?

There's a new article in BigAdmin, Getting Started With the Sun Connection Satellite Python API,
which describes how to install and configure the Sun Connection Python
API software. It also includes a pointer to sample API scripts for both
the Solaris OS and Linux.

To find more API documentation, including  classes, use the pydoc script. The
pydoc module is bundled with Python and the pydoc script is usually
installed at the same place where the python interpreter is located:

$ cat /usr/sfw/bin/pydoc
#!/usr/sfw/bin/python

import pydoc
pydoc.cli()

Use the pydoc command to get the information that you want.

For Solaris OS

$ pydoc /opt/SUNWuce/api/python/lib/PyOsApi/OsApi.py
$ pydoc /opt/SUNWuce/api/python/lib/PyOsApi/OsApiConstants.py
$ pydoc /opt/SUNWuce/api/python/lib/PyOsApi/OsApiExceptions.py
$ pydoc /opt/SUNWuce/api/python/lib/PyOsApi/DataStructures/OsApiDataStructures.py

For Linux OS

$ pydoc /opt/local/uce/api/python/lib/PyOsApi/OsApi.py
$ pydoc /opt/local/uce/api/python/lib/PyOsApi/OsApiConstants.py
$ pydoc /opt/local/uce/api/python/lib/PyOsApi/OsApiExceptions.py
$ pydoc /opt/local/uce/api/python/lib/PyOsApi/DataStructures/OsApiDataStructures.py

Example
For example, use this command to find the available API classes for the Solaris OS: 
# pydoc /opt/SUNWuce/api/python/lib/PyOsApi/OsApi.py

About

sunconnection

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today