Sun Cluster 2.2 API Developer's Guide

Appendix B API Man Pages

This appendix contains a quick reference to the syntax for the commands and functions associated with the Sun Cluster APIs.

The syntax for some of the Sun Cluster Data Services API commands or functions is provided in the following sections.

hactl(1M)--Controls operations on high availability data services.


/opt/SUNWcluster/bin/hactl [-n] -t|-g -s service_name 

-l|-p hostname [-L severity] [-k cluster_key]
hactl [-n] -r -s service_name [-k cluster_key]
hactl -f fieldname

haget(1M --Queries the current state of cluster configuration.


haget [-S] [-a APIversion] -f fieldname [-h hostname] [-s dataservicename]

halockrun(1M)--Runs a child program while holding a file lock.


halockrun [-vsn] [-e exitcode] lockfilename prog [args]

hareg(1M)--Controls registration and activation of high availability data services.


hareg -r service_name -m method=path[, method=path] ... [-b basedir]
	[-t method=timeout[, method=timeout] ...] 	

	[-d depends_on_service[, ...]] [-h logical_host [, ...]] 

	[-v service_version] [-a APIversion] [-p pkg[, ...]]

hareg -s -r Sun_service_name [-h logical_host [, ...] 

hareg -u service_name

hareg -q service_name [-M method | -T method | -D | -V | -A
	| -P | -B]

hareg -y|-n service_name[, ...]

hareg [-Y | -N]

hatimerun(1M)--Runs a child program under a time-out.


hatimerun [-va] [-k signalname] [-e exitcode] 

	-t timeOutSecs prog args

pmfadm(1M)--Processes monitor facility administration.


pmfadm -c nametag [-n retries] [-t period] [-a action]

	command [args_to_command ...]
pmfadm -m nametag [-n retries] [-t period]
pmfadm -s nametag [-w timeout] [signal]
pmfadm -k nametag [-w timeout] [signal]
pmfadm -l nametag [-h host]
pmfadm -q nametag [-h host]

ha_get_calls(3HA)--Gets high availability environment. Includes ha_get_calls, ha_getconfig, ha_getcurstate, ha_getmastered, ha_getnotmastered, ha_getonoff, ha_getlogfacility.


cc [flag...] -I/opt/SUNWcluster/include file... 
	-L /opt/SUNWcluster/lib [threads lib] -lhads -lintl -ldl
	-lnsl -lccd -lclustm -lcdb -lcluster [library...] 

ha_error_t ha_getconfig(ha_handle_t handle, ha_config_t
	**config);

ha_error_t ha_getcurstate(ha_handle_t handle, ha_lhost_dyn_t
	**lhosts[]);

ha_error_t ha_getmastered(ha_handle_t handle, ha_lhost_dyn_t
	**lhosts[]);

ha_error_t ha_getnotmastered(ha_handle_t handle, ha_lhost_dyn_t
	**lhosts[]);

ha_error_t ha_getonoff(ha_handle_t handle, char *service_name,
	boolean_t *ison);

ha_error_t ha_getlogfacility(ha_handle_t handle, int *facility);

ha_open(3HA) / ha_close(3HA)--High availability environment open/close.


cc [flag...] -I/opt/SUNWcluster/include file... 
	-L /opt/SUNWcluster/lib [threads lib] -lhads -lintl -ldl 
	[library...] 

ha_error_t ha_open(ha_handle_t *handlep); 

ha_error_t ha_close(ha_handle_t handle);

hads(3HA)--Library routines for high availability data services.


cc [flag...] -I/opt/SUNWcluster/include file... 
	-L /opt/SUNWcluster/lib [threads lib] -lhads -lccd -lcdb -lcluster -lclustm
	[library...] 

#include <hads.h>