Scripting to automate Websphere Datasource configuration

DataSource-Configuration-Automation-Scri Hi Experts,

I am trying to write a script to do the automation for Resources Configuration in WebSphere Application Server (8.0).
I am starting with JDBC Resource configuration. I am asked to have,
1) A Shell script which has high level logic, and it needs to take parameters like "New" or "Update" and according to that, it reads the data from a properties file and then executes a python script.
2) A Properties file - Which has all the information like Cluster name,Node name,scope,Alias name,User ID,Password,Connection pool settings etc..
3) A Python script - which has all the wsadmin functions to create or update JDBC resources.

I have attached a simple flow diagram. Please look at it.

Please help me to create this automation scripts. Any help would be greatly appreciated. Please let me know if you have questions.
premkug123Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Phil DavidsonCommented:
Bash shell scripts can take arguments when passed positionally.  For example,
foobar.sh parameter1

Open in new window


The foobar.sh file can call parameter1 as $1 in the bash script.  

Do you need help with the .properties file? If so, what is your question?

If you can put the Python file in the same directory as the .properties file, it is easy to open a file there. But it isn't that difficult to open the .properties file if the Python file is somewhere else.

Here is how Python opens a file:
x = open(foo.properties)
You can manipulate x later in your Python script.

wsadmin commands lend themselves to bash commands.  You can call bash commands in a Python script.  You have to import os at the beginning of the script.  Then you can issue native Linux commands with certain context.  You may use Jython if you are using JDBC, Java .properties files, and wsadmin.

What format is the attachment?  I wasn't able to view it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
premkug123Author Commented:
Thanks Phil,Thanks AdminRAM for your solution. I could able to complete the script.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.