The client examples use the client APIs to create, delete, and list classes, instances, and namespaces. The five types of client programs are:
Enumeration - Enumerates classes and instances. It does deep and shallow enumeration on a class that is passed from the command line.
Logging - Writes and reads log records
Miscellaneous - Deletes classes and instances.
Namespace - Creates and deletes namespaces.
System Information - Displays Solaris process information for the system and network you select.
The following table describes the example client program files and lists the commands and arguments to run each example.
Table 8-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 specify the user name and password of the administrative account for the CIM Object Manager Repository. |
java CreateNameSpace host parentNS childNS username password |
DeleteNameSpace |
Deletes the specified namespace on the specified host. You must specify the user name and password of the administrative account for the CIM Object Manager Repository. |
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 specify the user name and password of the administrative account for the CIM Object Manager Repository.. |
java CreateLog host username password |
ReadLog |
Reads a log record on the specified host. You must specify the user name and password of the administrative account for the CIM Object Manager Repository.. |
java ReadLog host username password |
DeleteClass |
Deletes the specified class in the default namespace /root/cimv2 on the specified host. You must specify the user name and password of the administrative account for the CIM Object Manager Repository. |
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 specify the user name and password of the administrative account for the CIM Object Manager Repository. |
java DeleteInstances host className username password |
SystemInfo |
Displays Solaris processor and system information for the specified host in a window. |
java SystemInfo host |
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:
Host name
Parent namespace
Child namespace
User name
Password
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 admin with password secret.
java CreateNameSpace . "" admin secret