Sun Cluster 3.1 10/03 Data Services Developer's Guide

Chapter 11 Data Service Development Library Reference

This chapter lists and briefly describes the Data Service Development Library (DSDL) API functions. See the individual 3HA man pages for a complete description of each DSDL function. The DSDL defines a C interface only. There is no scriptable DSDL interface.

The DSDL provides functions in the following categories.

DSDL Functions

The following subsections provide a brief overview to each category of DSDL functions. However, the individual 3HA man pages are the definitive reference for DSDL functions.

General Purpose Functions

The functions in this section provide a broad range of functionality. These functions enable you to

The following functions initialize the calling method.

The following functions retrieve information about resources, resource types, resource groups, and extension properties.

The following function retrieves status information about the SUNW.HAStoragePlus resources used by a resource.

The following functions fail over or restart a resource or resource group.

The following two functions execute a command under a timeout and convert an error code to an error message.

Property Functions

These functions provide convenience APIs for accessing specific properties of the relevant resource, resource group and resource type, including some commonly-used extension properties. The DSDL provides the scds_initialize function to parse the command line arguments. The library then caches the various properties of the relevant resource, resource group and resource type.

A single man page, scds_property_functions(3HA) describes all of these functions. This section contains the following functions

Network Resource-Access Functions

The functions listed in this section retrieve, print, and free network resources used by resources and resource groups. The scds_get_* functions in this section provide a convenient way of retrieving network resources without querying specific properties such as Network_resources_used, and Port_list using the RMAPI functions. The scds_print_name() functions print values from the data structures returned by the scds_get_name() functions. The scds_free_name() functions free the memory allocated by the scds_get_name() functions.

The following functions are concerned with hostnames.

The following functions are concerned with port lists.

The following functions are concerned with network addresses.

Fault Monitoring Using TCP Connections

The functions in this section enable TCP-based monitoring. Typically, a fault monitor uses these functions to establish a simple socket connection to a service, read and write data to the service to ascertain its status, and then disconnect from the service.

This section contains the following functions.

PMF Functions

These functions encapsulate the PMF functionality. The DSDL model for monitoring through PMF creates and uses implicit tag values for pmfadm(1M). The PMF facility also uses implicit values for the Restart_interval, Retry_count and action_script (the -t, -n and -a options to pmfadm). Most importantly, the DSDL ties the process death history, as discovered by PMF, into the application failure history as detected by the fault monitor to compute the restart or failover decision.

This section contains the following functions.

Fault Monitor Functions

The functions in this section provide a predetermined model of fault-monitoring by keeping the failure history and evaluating it in conjunction with the Retry_count and Retry_interval properties.

This section contains the following functions.

Utility Functions

The functions in this section enable you to write messages and debugging messages to the system log. This section contains the following two functions.