WebSphere Control Program (wscp) overview

The WebSphere Control Program (wscp) is a command-line and scripting interface for administering resources in WebSphere Advanced Application Server. It is based on Tcl (tool command language). Tcl is a portable command language that provides programming facilities, such as variables, procedures, conditionals, list-processing functions, and looping constructs. The wscp interface extends Tcl by providing a set of commands for manipulating WebSphere objects.

This file contains the following topics:


The administrative console and wscp

In WebSphere Advanced Application Server, the administrative server tracks the contents and activities of a domain by maintaining a repository. A repository is the database of information about all resources in a domain. The repository allows administration of a domain from any machine--all information is stored in a central location. The repository contains descriptive information about the applications that are configured to run in the domain. For example, it contains the names of all application servers (enterprise bean servers), containers, servlet engines, servlets, and enterprise beans, and their current state (running, defined, or stopped).

All administration takes place through the manipulation of objects in the repository. Each resource in a domain corresponds to an object in the repository. For example, when you create an application server, a corresponding application server object is created in the repository.

Both the WebSphere administrative console and the wscp interface can be used to administer the resources in a domain. They both modify the repository in response to user commands, and they both reflect any changes to the configuration and status of the domain. Console users access and modify the repository via a graphical user interface; wscp users manipulate objects in the repository by executing commands or scripts. The console and the wscp interface are compatible. The results of actions performed with wscp are reflected in the console interface, and vice versa.

Both the console and wscp can be used to do the following:


Benefits of using wscp

The wscp interface provides a high-level command-line administrative tool with programming capabilities. With wscp, you can do the following:


Limitations of using wscp

Although wscp offers many of the same administration tasks as the WebSphere Advanced Administrative Console, the following differences apply:


Supported object types

In wscp, a resource is represented as an object type. For example, the object type ApplicationServer represents an application server (enterprise bean server) and the object type DataSource represents a database. Each object type has attributes (called properties in the console), which describe the characteristics of the object. For example, an application server object has the attributes Executable, CurrentState, and WorkingDirectory. A data source object has the attributes DatabaseName, JDBCDriver, MinPoolSize, and MaxPoolSize. An object type can be thought of as a template object that defines the characteristics of all objects of that type. Instances of the object type represent specific objects in the domain.

The wscp interface manipulates objects in the repository by performing operations on them. Examples of operations are create, start, show, modify, and stop. The following is a list of object types supported by wscp.

Note:Any object that represents a live entity outside of the repository (for example, application servers and servlets), can be started and stopped with wscp. However, not all objects can be defined and managed by using wscp. In particular, objects related to security are not supported. These include the object types ApplicationSecurity, EnterpriseBeanSecurity, LTPAConfig, MethodGroup, and SecurityConfig. The attributes for several other object types cannot be modified. The message "EditorNotDefinedForThisProperty" is displayed when you attempt to access these attributes, because they require a special editor.

As in the console, wscp automatically provides default attributes and values for an object when the object is created. You need to specify values only for those attributes that are required and lack defaults. If needed, you can override the default value for any attribute when creating an object by specifying a value for that attribute.

In the repository, objects are represented as attribute lists. An attribute list is a collection of attribute-value pairs. The following output shows how wscp displays the attributes of a DataSource object named ds1:

{FullName /DataSource:ds1/} {Name ds1} {ConnTimeout 300} 
{DatabaseName WAS} {IdleTimeout 1800} {JDBCDriver /JDBCDriver:DB2Driver/} 
{MaxPoolSize 30} {MinPoolSize 1} {OrphanTimeout 1800}

See Specifying lists in wscp commands for details on attribute lists.

In general, objects are created by specifying the object type, the operation to be performed, the name of the object instance, and one or more options. For example, to create a DataSource object, you specify the object type (DataSource), the operation (create), the name of the object instance to create, and if attributes are required, the -attribute option. The argument to the -attribute option is a list of attributes and their values. For example, the following wscp command (in interactive mode) creates a DataSource object named ds1. Note that only the required attributes are specified:

wscp> DataSource create /DataSource:ds1/  \
-attribute {{DatabaseName WAS}{JDBCDriver driver1}}

In the following example, the ApplicationServer start command is used to start an application server named myServer:

wscp> ApplicationServer start /Node:dev-pc/ApplicationServer:myServer/

See Command syntax and usage for more example commands, detailed syntax, and an explanation of the convention for object names.

The following example uses the Tcl foreach command to iterate through all enterprise bean servers in a domain and stop them:

wscp> foreach ejbserver [ApplicationServer  list] {ApplicationServer stop $ejbserver}

See Example use of wscp and Tcl and Example wscp commands, procedures, and scripts.



Copyright IBM Corporation 1999, 2000. All Rights Reserved