Posts

Showing posts with the label wsadmin

Jython operators and sequences in wsadmin

Image
Welcome back to Jython learning blog again. today I have explored different categories of operators how they can be used in Jython for wsadmin. prerequisites for this is you must have a Jython for WebSphere installed on your VM and you are on wsadmin prompt. Types of operators (inherited from Python): Arithmetic operators Comparison operators Relational operators  These simple experiments would give you a base for building automation scripts in your projects. Jython Operators on wsadmin   How can Jython deals with Arithmetic operators Every language supports the Arthematic operators and in Jython same operators as in C or Python languages. wsadmin>x,y = 10, 20 wsadmin>print x, y 10 20 wsadmin>x+y 30 wsadmin>x+y+30 60 wsadmin>y-x 10 wsadmin>x-y -10 wsadmin>x*y 200 wsadmin>x**2 100 wsadmin>y/x 2 wsadmin>y%x 0 How to use Jython Comparison operators? The comparing operators mostly used in the 'if-else' or 'while' blocks which returns eith...

Getting Node id, Cell ID, Server ID of Mbean in wsadmin

Image
Hey automation expert welcome to another interesting exploration on wsadmin basic commands that could build your Jython script much effectively. Let's jump into it. Basic understanding of wsadmin objects Here I've listed out what we need to consider as wsadmin objects which could help as build blocks for your Jython based automation scripts. Node – an individual system, either physical or virtual Node Manager – the process controlling the individual node and all servers in all cells, it executes the commands of the Deployment Manager Profile – a WebSphere entity similar to a node concept wise Application Server – a Java Virtual Machine (JVM) process Application – a Java enterprise application it could be .ear file with some modules Cluster – a group of Servers, all running the same applications Cell – an administrative domain of one or more servers Deployment Manager (DM) – the administration application for a cell How do all these pieces work togeth...

Jython variables in wsadmin

Image
A warm Welcome to my jython4wsadmin blog!! Variables in programming languages we need to declare on the top of the function or program. When we declare it we need to tell about what type of data we would like to store in the variable. Where as in Scripting languages you don't need to do so. Jython is a scripting language so you don't need to declare the variable. Like any programming language Jython also support variables but these variables looks like scripting variables, they are dynamic. The value that assigned to a variable is going to have an id and label internally it is one of the Python Object type as well. Let me experiment with my simple Jython script to understand more how the variables can be created and used in multi variants. Here the values can be integer, float, long types in numeric data types. Jython Variable inside wsadmin # This program will illustrate the variables of jython. # Integer variable x=5 print 'x=', x, type(x), id(x)...