Sun WBEM SDK Developer's Guide

Using Client Examples

The client examples use the client APIs to create, delete, and list classes, instances, and namespaces. The five types of client programs are:

Client Example Files

The following table describes the example client program files and lists the commands and arguments to run each example.

Table 7–1 Client Example Files

Example File Name 

Description 

Command to Run 

CreateNameSpace

Connects to the CIM Object Manager as the specified user and creates a namespace on the specified host. You must type the root user name and password. 

java CreateNameSpace host parentNS childNS username password

DeleteNameSpace

Deletes the specified namespace on the specified host. You must type the root user name and password. 

java DeleteNameSpace host parentNS childNS username password

ClientEnum

Enumerates classes and instances in the specified class in the default namespace root\cimv2 on the specified host.

java ClientEnum host className

CreateLog

Creates a log record on the specified host. You must type the root user name and password. 

java CreateLog host username password

ReadLog

Reads a log record on the specified host. You must type the root user name and password. 

java ReadLog host username password

DeleteClass

Deletes the specified class in the default namespace root\cimv2 on the specified host. You must type the root user name and password.

java DeleteClass host className username password

DeleteInstances

Deletes instances of the specified class in the default namespace root\cimv2 on the specified host. You must type the root user name and password.

java DeleteInstances host className username password

CreateQualifierType

Creates the specified qualifier type in the specified namespace on the specified host. You must type the root user name and password. 

java CreateQualifierType host parentNS username password qualifierTypeName

SystemInfo

Displays Solaris processor and system information for the specified host in a window. 

java SystemInfo host

Running the Client Examples

To run a client example program, type the command:


% java program_name

Most of the example programs take required arguments that have default values. For example, the CreateNameSpace example program takes five arguments:

Use the following syntax to specify default values for command line arguments.

Argument 

Default Value 

Syntax 

Host name

local host

.

Parent namespace

root\cimv2

" "

Child namespace

Null

" "

User name

GUEST

" "

Password

GUEST

" "

The following example runs the CreateNameSpace example, which connects to the default root\cimv2 namespace on the local host as user root with password secret.


% java CreateNameSpace . "" root secret