InfoCenter Home > 6.6.0.2.2.1: WebSphere Control Program (wscp) overviewThe WebSphere Control Program (wscp) is a command-line and scripting interface for administering resources in WebSphere Application Server Advanced Edition. 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 section contains the following topics:
The Administrative Console and wscpThe administrative server manages 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, nodes, server groups, and J2EE resources (such as JDBC providers), 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 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 wscpThe wscp interface provides a high-level command-line administrative tool with programming capabilities. With wscp, you can do the following:
Limitations of using wscpAlthough wscp offers many of the same administration tasks as the WebSphere Advanced Administrative Console, the following differences apply:
Supported object typesIn 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) that describe the characteristics of the object. For example, application server object attributes include Executable, CurrentState, and WorkingDirectory. Data source object attributes include DatabaseName, 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.
As the console does, 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: {Name ds1} {FullName /JDBCDriver:connDrv/DataSource:ds1/} {Description null} {ConfigProperties {{URL jdbc:oracle:thin:@wssol2:1521:oraejs}}} {ConnTimeout 180} {DatabaseName WAS} {DefaultPassword null} {DefaultUser null} {DisableAutoConnectionCleanup False} {IdleTimeout 1800} {JNDIName jdbc/carddb} {MaxPoolSize 10} {MinPoolSize 1} {OrphanTimeout 1800} {StatementCacheSize 100} See 6.6.0.2.2.3.2: 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 that is a resource for the WAS database. The database driver must also be specified: wscp> DataSource create /JDBCDriver:DB2Driver/DataSource:ds1/ -attribute {{DatabaseName WAS}} 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 6.6.0.2.2.2: 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 application servers in a domain and stop them: wscp> foreach ejbserver [ApplicationServer list] {ApplicationServer stop $ejbserver} See 6.6.0.2.2.3.3: Example use of wscp and Tcl and 6.6.0.2.2.4: Example wscp commands, procedures, and scripts. Supported services and commandsIn addition to objects, wscp supports several services and commands that perform various administration tasks, such as configuring WebSphere Application Server, enabling global security, enabling tracing and data collection, manipulating Java Naming and Directory Interface (JNDI) contexts, and displaying help on wscp commands. These services are as follows:
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|