Sun Microsystems, Inc.
   www.sun.com docs.sun.com | | |  
   
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
    
 
Sun Cluster HA and Data Servicesscha_resourcetype_open(3HA)


NAME

 scha_resourcetype_open, scha_resourcetype_close, scha_resourcetype_get - resource type information access functions.

SYNOPSIS

 
cc [flags...] -I /usr/cluster/include file -L /usr/cluster/lib -l scha
#include <scha.h>
scha_err_t scha_resourcetype_open(const char *rtname, scha_resourcetype_t *handle);
 scha_err_t scha_resourcetype_close(scha_resourcetype_t handle);
 scha_err_t scha_resourcetype_get(scha_resourcetype_t handle, const char *tag...);

DESCRIPTION

 

The scha_resourcetype_open(), scha_resourcetype_get(), and scha_resourcetype_close() functions are used together to access information on a resource type that is used by the Resource Group Manager (RGM) cluster facility.

scha_resourcetype_open() initializes access of the resource type and returns a handle to be used by scha_resourcetype_get().

The rtname argument of scha_resourcetype_open() names the resource type to be accessed.

The handle argument is the address of a variable to hold the value returned from the function call.

scha_resourcetype_get() accesses resource type information as indicated by the tag argument. The tag argument should be a string value defined by a macro in the <scha_tags.h> header file. Arguments following the tag depend on the value of tag.

An additional argument following the tag may be needed to indicate a cluster node from which the information is to be retrieved, or other information specific to the tag. The last argument in the argument list is to be of a type suitable type to hold the information indicated by tag. This is the "out" argument for the resource type information. No value is returned for the out parameter if the function fails. Memory that is allocated to hold information returned by scha_resourcetype_get() remains intact until scha_resourcetype_close() is called on the handle used for scha_resourcetype_get().

scha_resourcetype_close() takes a handle argument returned from a previous call to scha_resourcetype_open(). It invalidates the handle and frees memory allocated to return values to scha_resourcetype_get() calls that were made with the handle. Note that, memory, if needed to return a value, is allocated for each "get" call. Space allocated to return a value in one call will not be overwritten and reused by subsequent calls.

Macros defined in <scha_tags.h> that may be used as tag arguments to scha_resourcetype_get() follow. The type of the output argument and any additional arguments are indicated. Structure and enum types are described in scha_calls(3HA).

Optag Arguments

 

Macros naming resource type properties are listed below. The value of the named property of the resource's type is output.

SCHA_API_VERSION
The output argument is of type int*.
SCHA_BOOT
The output argument is of type char **.
SCHA_FAILOVER
The output argument is of type boolean_t *
SCHA_FINI
The output argument is of type char **.
SCHA_INIT
The output argument is of type char **.
SCHA_INIT_NODES
The output argument is of type scha_initnodes_flag_t *.
SCHA_INSTALLED_NODES
The output argument is of type scha_str_array_t **
SCHA_IS_LOGICAL_HOSTNAME
The output argument is of type boolean_t *
SCHA_IS_SHARED_ADDRESS
The output argument is of type boolean_t *.
SCHA_MONITOR_CHECK
The output argument is of type char **.
SCHA_MONITOR_START
The output argument is of type char **.
SCHA_MONITOR_STOP
The output argument is of type char **.
SCHA_PKGLIST
The output argument is of type scha_str_array_t **.
SCHA_POSTNET_STOP
The output argument is of type char **.
SCHA_PRENET_START
The output argument is of type char **.
SCHA_RESOURCE_LIST
The output argument is of type scha_str_array_t**
SCHA_RT_BASEDIR
The output argument is of type char **.
SCHA_RT_DESCRIPTION
The output argument is of type char **.
SCHA_RT_SYSTEM
The output argument is of type boolean_t *
SCHA_RT_VERSION
The output argument is of type char **.
SCHA_SINGLE_INSTANCE
The output argument is of type boolean_t *
SCHA_START
The output argument is of type char **.
SCHA_STOP
The output argument is of type char **.
SCHA_UPDATE
The output argument is of type char **.
SCHA_VALIDATE
The output argument is of type char **.

RETURN VALUES

 

The scha_cluster_open() function returns the following:

0
The function succeeded.
non-zero
The function failed.

ERRORS

 
SCHA_ERR_NOERR
Function succeeded.

See scha_calls(3HA) for a description of other error codes.


FILES

 
/usr/cluster/include/scha.h
include file
/usr/cluster/lib/libscha.so
library

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWscdev
Interface StabilityEvolving

SEE ALSO

 

scha_resource_get(1HA), scha_calls(3HA), scha_strerror(3HA), attributes(5)



Sun Cluster 3.1Go To TopLast Changed 26 Feb 2003

 
      
      
Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.