BigAdmin System Administration Portal
Sun Docs
Print-friendly VersionPrint-friendly Version

Finding Documentation for the Sun Connection Satellite Python API Classes and Data Structures

Juergen Fleischer, September 21, 2007

This Tech Tip supplements the Getting Started With the Sun Connection Satellite Python API Tech Tip, and explains how to find the embedded Python application program interface (API) documentation.


The Python API Documentation

The Getting Started With the Sun Connection Satellite Python API Tech Tip explains how to use the Python API scripts within the Sun Connection satellite deployment architecture to automate complex tasks that would otherwise require lots of time using the browser interface. This Tech Tip provides further information on the Python API class and data structure documentation. The documentation is found by using the pydoc module. The pydoc module is bundled with the Python API as a pydoc script that is usually installed in the same directory as the Python interpreter.

To Find the Documentation

  1. (Optional) The pydoc script should be in your path like the Python interpreter is. If you cannot find the pydoc script, you can create it using your preferred text editor. The pydoc script consists of the following three lines.
    #!/usr/sfw/bin/python
    import pydoc
    pydoc.cli()

    The first line contains the full path to the Python interpreter and should be adjusted if required.

  2. Access the library.
    $ cd library

    where library is the path to the library directory.

    • For Solaris: /opt/SUNWuce/api/python/lib

    • For Linux: /opt/local/uce/api/python/lib

  3. Run one of the following pydoc commands to obtain the desired information.
    $ pydoc PyOsApi/OsApi.py
    $ pydoc PyOsApi/OsApiConstants.py
    $ pydoc PyOsApi/OsApiExceptions.py
    $ pydoc PyOsApi/DataStructures/OsApiDataStructures.py
Example 1 Results of Running the pydoc PyOsApi/OsApi.py Command
$ pydoc PyOsApi/OsApi.py

Help on module OsApi:

NAME
    OsApi

FILE
    /opt/SUNWuce/api/python/lib/PyOsApi/OsApi.py

CLASSES
    OsApi

class OsApi
     |  The OsApi class is the API class.
     |  Its methods provide the direct operations.
     |  It imports methods from the lower-level C API,
     |  included in the package.
     |
     |  Methods defined here:
     |
     |  ActivateChannel(self, channel_name)
     |      The ActivateChannel method activates a supported channel for use in
     |      an API session. It will be available in the next session from
     |      GetAvailableChannels.
     |      _____________________________________________________________________
     |      Input Parameters:
     |      * channel_name - valid name of supported channel.
     |       See GetAvailableChannels method.
     |      _____________________________________________________________________
     |      Output Returns:
     |      * none
     |      _____________________________________________________________________
     |      Exceptions:
     |      * OsApiGetChannelsException - cannot get supported channel list.
     |      * OsApiUnknownException - general exception.
     |      * OsApiChannelException - invalid input

More Information

For more information about Sun Connection, go to the Sun Connection information hub.

To get an inside perspective of Sun Connection, Sun Management Center software, Sun N1 Service Provisioning System, and Sun N1 System Manager, visit the Sun Connection blog. Contributors to this blog include members of the Sun Connection Field Enablement team. The goal of this blog is to share information with customers who either have already implemented or will implement these products in the future. The blog also provides important information about training and other key enablement activities.

Discuss and comment on this resource in the BigAdmin Wiki


Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.


BigAdmin
  
 
 
 
 
Would you recommend this Sun site to a friend or colleague?
Contact About Sun News & Events Employment Site Map Privacy Terms of Use Trademarks Copyright Sun Microsystems, Inc.