Getting Started With the Sun Connection Satellite Python APIJuergen Fleischer, September 21, 2007 This article describes how to use the Python API scripts within Sun Connection's satellite deployment architecture to automate complex tasks which would otherwise require lots of time using the GUI. PrerequisitesTo use the Sun Connection Python API, the following software must be installed on your Sun Connection system:
Installing the Sun Connection Python API Software and Downloading the Python API ScriptsThis section provides the procedures for installing the Sun Connection Python API software and creating the API scripts on your Sun Connection system. To Install the Sun Connection Python API Software
To Download the Python API ScriptsThe Python API software must be configured with the name and port
of the Sun Connection server. The required information is contained in the
Configuring the Python API SoftwareThe API software must be configured with the name and port of
the Sun Connection server. The required information is contained in the To Configure the Python API Software
Encrypting and Using the Dedicated User Account Name and PasswordThe dedicated user account and password should be encrypted and stored on
the server instead of being included as plain text in the scripts.
The API script To Encrypt, Store, and Use the Dedicated User Account and PasswordBefore You BeginThe path to the Python interpreter directory and to the API scripts
directory that you created must be added to the dedicated account
Using the Python API ScriptsExample Python API scripts are located in To get started, a simple but useful example for an API script
is the For example, assume you have created the file 118918-17 121563-02 121118-06 Once you have created the list of text patches, you can generate
the profile using the # create_profile.py
Please enter the file with the patch list: SAP_recommended.txt
Name of the channel (e.g. SOLARIS8_SPARC, SOLARIS10_X86): SOLARIS10_SPARC
Name of the profile to be created: SAP-Baseline
Username: api
Password:
Creating an API instance ...
Trying to login ...
Successfully logged in ...
Adding patch 118918-17 for channel SOLARIS10_SPARC
Adding patch 121563-02 for channel SOLARIS10_SPARC
Adding patch 121118-06 for channel SOLARIS10_SPARC
new profile SAP-Baseline successfully created
The Python API DocumentationThe Python API class and data structure documentation is found by using
the To Find the Documentation
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 InformationFor 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. Comments (latest comments first)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 SubscriptionsBigAdmin Areas
BigAdmin Sun Center
BigAdmin Topics | ||||