|
The scha_resource_open(), scha_resource_get() and scha_resource_close() functions are used
together to access information on a resource that is managed by the Resource
Group Manager (RGM) cluster facility.
scha_resource_open() initializes access of the resource
and returns a handle to be used by scha_resource_get().
The rname argument of scha_resource_open() names the resource to be accessed. The rgname
argument is the name of the resource group that the resource is configured
in. The rgname argument may be NULL if the group name is not known. However, the execution of the
function is more efficient if it is provided. The handle
argument is the address of a variable to hold the value returned from the
function call.
scha_resource_get() accesses resource 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
information. No value is returned for the out parameter if the function
fails.
Memory that is allocated to hold information returned by scha_resource_get() remains intact until scha_resource_close() is called on the handle used for the scha_resource_get(). Note that repeated calls to scha_resource_get()
with the same handle and tag cause new memory to be allocated. Space allocated
to return a value in one call will not be overwritten and reused by a subsequent
calls.
scha_resource_close() takes a handle argument returned from a previous call to scha_resource_open(). It invalidates the handle and frees memory allocated to return
values to scha_resource_get() calls that were made with
the handle.
Macros defined in <scha_tags.h>
that may be used as tag arguments to scha_resource_get() follow.
The type of the output argument and any additional arguments are indicated.
Structure and enum types are described in scha_calls(3HA).
Tag Arguments
| |
The macros naming resource properties are listed below. The value of
the property of the resource is output. The SCHA_RESOURCE_STATE, SCHA_STATUS, SCHA_NUM_RG_RESTARTS, and SCHA_NUM_RESOURCE_RESTARTS properties refer to the value on the
node where the command is executed (see r_properties(5)).
-
SCHA_R_DESCRIPTION
- The output argument type is char**.
-
SCHA_TYPE
- The
output argument type is char**.
-
SCHA_RESOURCE_PROJECT_NAME
- The output argument type is char**.
-
SCHA_ON_OFF_SWITCH
- The output argument type is scha_switch_t*.
-
SCHA_MONITORED_SWITCH
- The output argument type is scha_switch_t*.
-
SCHA_RESOURCE_STATE
- The output argument type is scha_rsstate_t*.
-
SCHA_CHEAP_PROBE_INTERVAL
- The output argument type is int*.
-
SCHA_THOROUGH_PROBE_INTERVAL
- The output argument type is int*.
-
SCHA_RETRY_COUNT
- The output argument type is int*.
-
SCHA_RETRY_INTERVAL
- The output argument type is int*.
-
SCHA_FAILOVER_MODE
- The output argument type is scha_failover_mode_t*.
-
SCHA_RESOURCE_DEPENDENCIES
- The output argument type is scha_str_array_t**.
-
SCHA_RESOURCE_DEPENDENCIES_WEAK
- The output argument type is scha_str_array_t**.
-
SCHA_NETWORK_RESOURCES_USED
- The output argument type is scha_str_array_t**.
-
SCHA_SCALABLE
- The output argument type is boolean_t*.
-
SCHA_PORT_LIST
- The output argument type is scha_str_array_t**.
-
SCHA_LOAD_BALANCING_POLICY
- The output argument type is char**.
-
SCHA_LOAD_BALANCING_WEIGHTS
- The output argument type is scha_str_array_t**.
-
SCHA_AFFINITY_TIMEOUT
- The output argument type is int*.
-
SCHA_WEAK_AFFINITY
- The output argument type is boolean_t*.
-
SCHA_UDP_AFFINITY
- The output argument type is boolean_t*.
-
SCHA_STATUS
- The output argument type is scha_status_value_t**.
-
SCHA_START_TIMEOUT
- The output argument type is int*.
-
SCHA_STOP_TIMEOUT
- The output argument type is int*.
-
SCHA_VALIDATE_TIMEOUT
- The output argument type is int*.
-
SCHA_UPDATE_TIMEOUT
- The output argument type is int*.
-
SCHA_INIT_TIMEOUT
- The output argument type is int*.
-
SCHA_FINI_TIMEOUT
- The output argument type is int*.
-
SCHA_BOOT_TIMEOUT
- The output argument type is int*.
-
SCHA_MONITOR_START_TIMEOUT
- The output argument type is int*.
-
SCHA_MONITOR_STOP_TIMEOUT
- The output argument type is int*.
-
SCHA_MONITOR_CHECK_TIMEOUT
- The output argument type is int*.
-
SCHA_PRENET_START_TIMEOUT
- The output argument type is int*.
-
SCHA_POSTNET_STOP_TIMEOUT
- The output argument type is int*.
-
SCHA_NUM_RG_RESTARTS
- The output argument type is int*.
-
SCHA_NUM_RESOURCE_RESTARTS
- The output argument type is int*.
-
SCHA_TYPE_VERSION
- The output argument type is char**.
-
SCHA_STATUS_NODE
- The output argument type is scha_status_value_t**. An additional
argument type is char*. The additional argument names
the node. It returns the status of the resource on that node.
-
SCHA_RESOURCE_STATE_NODE
- The output argument type is scha_rsstate_value_t*.
An additional argument type is char *. The additional
argument names the node. It returns the state of the resource on that node.
-
SCHA_EXTENSION
- The output argument type is scha_extprop_value_t**. An
additional argument type is char*. The additional argument
names an extension property of the resource. It returns a structure containing
the type and value of the property.
-
SCHA_ALL_EXTENSIONS
- The output argument type is scha_str_array_t**.
It returns the names of all extension properties of the resource.
-
SCHA_GROUP
- The
output argument type is char**. It returns the name of
the resource group that the resource is configured in.
The macros naming resource type properties are listed
below. The value of the property of the resource's type is output. For descriptions
of resource type properties, see rt_properties(5).
-
SCHA_RT_DESCRIPTION
- The output argument type is char**.
-
SCHA_RT_BASEDIR
- The output argument type is char**.
-
SCHA_RT_SYSTEM
- The output argument type is boolean_t*.
-
SCHA_SINGLE_INSTANCE
- The output argument type is boolean_t*.
-
SCHA_INIT_NODES
- The output argument type is scha_initnodes_flag_t*.
-
SCHA_INSTALLED_NODES
- The output argument type is scha_str_array_t**.
-
SCHA_FAILOVER
- The output argument type is boolean_t*.
-
SCHA_API_VERSION
- The output argument type is int*.
-
SCHA_RT_VERSION
- The output argument type is char**.
-
SCHA_PKGLIST
- The output argument type is scha_str_array_t**.
-
SCHA_START
- The
output argument type is char**.
-
SCHA_STOP
- The
output argument type is char**.
-
SCHA_VALIDATE
- The output argument type is char**.
-
SCHA_UPDATE
- The output argument type is char**.
-
SCHA_INIT
- The
output argument type is char**.
-
SCHA_FINI
- The
output argument type is char**.
-
SCHA_BOOT
- The
output argument type is char**.
-
SCHA_MONITOR_START
- The output argument type is char**.
-
SCHA_MONITOR_STOP
- The output argument type is char**.
-
SCHA_MONITOR_CHECK
- The output argument type is char**.
-
SCHA_PRENET_START
- The output argument type is char**.
-
SCHA_POSTNET_STOP
- The output argument type is char**.
-
SCHA_IS_LOGICAL_HOSTNAME
- The output argument type is boolean_t*.
-
SCHA_IS_SHARED_ADDRESS
- The output argument type is boolean_t*.
|
|