Saturday 13 July 2013

WSADMIN Scripting Objects Part 1

  • The wsadmin program is a scripting engine for performing administrative tasks on an application server or its configuration through Command mode.
  • we can perform all most all tasks what were preformed through Admin console.
  • You can use the wsadmin tool to configure and administer application servers, application deployment, and server runtime operations 
  • The wsadmin tool runs scripts. You can use the wsadmin tool to manage the product as well as the configuration, application deployment, and server runtime operations. 
  • The wsadmin tool only supports the Jython and Jacl scripting languages.
  • Default is Jacl.


Wsadmin CMD in different Operating systems:

• AIX —wsadmin.sh 
• Linux —wsadmin.sh 
• z/OS —wsadmin.sh 
• Windows —wsadmin.bat


Where is wsadmin located :-
  
In case of standalone application server, wsadmin is located at WAS_HOME /bin directory.


In ND application server,  wsadmin.sh is located both at WAS_HOME/bin  and also at WAS_PROFILE_HOME/bin

WAS_HOME is location where base binaries are installed .
WAS_PROFILE_HOME is location where profile is created.

Launching of wsadmin :-

Here I will be explaining and showing launching of wsadmin in ND environment on Unix Operating System.Basically in ND environment, best practice is to launch wsadmin from Deployment profile.We can launch wsadmin from /bin or from Node profile also, but it is almost always launched from Deployment profile only.

 The way we launch wsadmin also depends upon whether Websphere have security turned on or not.
  1. If Global security is not turned on, it is launched just by executing ./wsadmin.sh command as shown below in screenshot.
  



 2. If Global security is turned on, then we will have to pass user name and password to connect to wsadmin program and options we need to pass is described below and shown below in screenshot.
               ./wsadmin.sh -user -password 



3. If Global security is turned on and we don't want to pass user and password every time we execute wsadmin.So, for that , we need to update 3 properties in soap.client.props located at /properties, below are the properties which we need to update.

1. Update "com.ibm.SOAP.securityEnabled" to  value as true.
2. Update "com.ibm.SOAP.loginUserid" with websphere admin user.
3. Update "com.ibm.SOAP.loginPassword" with websphere admin password.

You don't have to bounce Deployment manager to have this take affect,you can do this on the fly , whether you want to enable this functionality or disable this functionality after enabling. 

Below screenshot shows the location of soap.client.props



Below it shows the properties with updated values



Below screenshot shows, after updating this we don't have to pass user name and password with we are executing wsadmin , with global security on in websphere.





There are five objects for the WSADMIN scripting tool. 
   They are AdminApp,AdminConfig,AdminControl,AdminTask and Help.
   All the commands related to the objects are listed below.

                         Help Object: eg:    print Help.AdminApp()
                                                        (the above example is written in jython, the default scripting language for WAS is jacl)
                                                The following commands are supported in this object:
                 AdminApp/AdminConfig/AdminControl/AdminTask/all/attributes/classname/ 
                 constructors/description/help/message/notifications/operations


     

AdminApp
AdminConfig
AdminControl
AdminTask
 deleteUserAndGroupEntries
edit
editInteractive
export
exportDDL
exportFile
getDeployStatus
help
install
installInteractive
isAppReady
list
listModules
options
publishWSDL
searchJNDIReferences
taskInfo
uninstall
update
updateAccessIDs
updateInteractive
view







attributes
checkin
convertToCluster
create
createClusterMember
createDocument
createUsingTemplate
defaults
deleteDocument
existsDocument
extract
getCrossDocumentValidationEnabled
getid
getObjectName
getObjectType
getSaveMode
getValidationLevel
getValidationSeverityResult
hasChanges
help
installResourceAdapter
list
listTemplates
modify
parents
queryChanges
remove
required
reset
resetAttributes
save
setCrossDocumentValidationEnabled
setSaveMode
setValidationLevel
show
showall
showAttribute
types
uninstallResourceAdapter
unsetAttributes
validate


completeObjectName
getAttribute
getAttribute_jmx
getAttributes
getAttributes_jmx
getCell
getConfigId
getDefaultDomain
getDomainName
getHost
getMBeanCount
getMBeanInfo_jmx
getNode
getObjectInstance
getPort
getPropertiesForDataSource (Deprecated)
getType
help
invoke
invoke_jmx
isRegistered
isRegistered_jmx
makeObjectName
queryMBeans
queryNames
queryNames_jmx
reconnect
setAttribute
setAttribute_jmx
setAttributes
setAttributes_jmx
testConnection
trace

createTCPEndPoint
getTCPEndPoint
help
listTCPEndPoints
listTCPThreadPools
updateAppOnCluster




No comments:

Post a Comment