Main | Encrypt the credentials when running WLST in interactive or script mode »

Extend WLST with your own commands

Do you want to add your own commands to the already rich set of WLST commands?

In WebLogic 10.0 and higher, you can add your own commands by building your own *.py file and adding them to WL_HOME/common/wlst/lib folder. Any *.py file added to this folder will be automatically compiled and imported by WLST when started on that machine. So the custom commands built as definitions inside these modules can be used by calling them on the respective module names.

If you have a TestLib.py stored under WL_HOME/common/wlst/lib folder:


TestLib.py
----------
def testCmd():
print 'This is a test command'


And if there is a definition called testCmd() defined in it then you can call it as follows:

wls:/offline>TestLib.testCmd()

What you waiting for? Go and add you command to WLST now.

TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mte1521/mt-tb.cgi/6059

Comments (1)

How about some one who is new to WSLT or some one new to concept of def testCmd(): ?

Hope to see more on how to get start on WSLT ..

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on August 28, 2008 7:19 PM.

The next post in this blog is Encrypt the credentials when running WLST in interactive or script mode.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle