|
The scha_cluster_open(3HA), scha_cluster_get(3HA), and scha_cluster_close(3HA) functions
are used together to get to information about a cluster.
scha_cluster_open(3HA)
initializes cluster access and returns an access handle to be used by scha_cluster_get(3HA). The handle argument is the address of a variable to hold the value
returned from the function call.
scha_cluster_get(3HA) accesses
cluster information as indicated by the tag argument.
The handle is a value returned from a prior call
to scha_cluster_open(3HA). The tag should be a string value defined by a macro in the <scha_tags.h> header file. The arguments that
follow the tag depend on the value of tag.
An additional argument following the tag might be needed to indicate
a cluster node from which the information is to be retrieved. The last argument
in the argument list is to be of a type suitable to hold the information indicated
by tag. This is the out argument
for the cluster information. No value is returned for the out parameter if
the function fails. Memory that is allocated to hold information returned
by scha_cluster_get(3HA) remains intact
until scha_cluster_close(3HA)
is called on the handle used for the scha_cluster_get(3HA).
scha_cluster_close(3HA)
takes a handle argument returned from a previous call to
scha_cluster_get(3HA). It invalidates
the handle and frees memory allocated to return values to scha_cluster_get(3HA) 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.
The macros defined in <scha_tags.h>
that may be used as tag values follow. The type
of the output argument and any additional arguments are indicated. Structure
and enum types are described in scha_calls(3HA).
-
SCHA_NODENAME_LOCAL
- The output argument type is char**.
It returns the name of cluster node where the function executed.
-
SCHA_NODENAME_NODEID
- The output argument type is char**. An additional
argument is of type uint_t. The additional argument is
a numeric cluster node identifier.
It returns the name of the node indicated by the numeric identifier.
-
SCHA_ALL_NODENAMES
- The output argument type is scha_str_array_t**.
It returns the names of all nodes in the cluster.
-
SCHA_ALL_NODEIDS
- The output argument type is scha_uint_array_t**.
It returns numeric node identifiers of all the nodes in the cluster.
-
SCHA_NODEID_LOCAL
- The output argument type is uint_t*.
It returns the numeric node identifier for the node where the command
is executed.
-
SCHA_NODEID_NODENAME
- The output argument type is uint_t*. An additional
argument is of type char *. The macro requires an additional
argument that is a name of a cluster node.
It returns the numeric node identifier of the node indicated by the
name.
-
SCHA_PRIVATELINK_HOSTNAME_LOCAL
- The output argument type is char**.
It returns the hostname by which the node that the command is run on
as addressed on the cluster interconnect.
-
SCHA_PRIVATELINK_HOSTNAME_NODE
- The output argument type is char**. An
additional argument is of type char *. The macro requires
an additional unflagged argument that is the name of a cluster node.
It returns the hostname by which the named node is addressed on the
cluster interconnect.
-
SCHA_ALL_PRIVATELINK_HOSTNAMES
- The output argument type is scha_str_array_t**.
It returns the hostnames for all cluster nodes by which the nodes are
addressed on the cluster interconnect.
-
SCHA_NODESTATE_LOCAL
- The output argument type is scha_node_state_t*.
It returns SCHA_NODE_UP or SCHA_NODE_DOWN, depending on the state of the node where the command is executed.
-
SCHA_NODESTATE_NODE
- The output argument type is scha_node_state_t*. An
additional argument is type char*. The macro requires
an additional unflagged argument that is the name of a cluster node.
It returns SCHA_NODE_UP or SCHA_NODE_DOWN, depending on the state of the named node.
-
SCHA_SYSLOG_FACILITY
- The output argument type is int*.
It returns the number of the syslog(3c) facility that the RGM uses for log messages.
The value that is returned is 24, which corresponds to
the LOG_DAEMON facility value.
-
SCHA_ALL_RESOURCEGROUPS
- The output argument type is scha_str_array_t**.
It returns the names of all the resource groups that are being managed
on the cluster.
-
SCHA_ALL_RESOURCETYPES
- The output argument is type scha_str_array_t**.
It returns the names of all the resource types that are registered on
the cluster.
-
SCHA_CLUSTERNAME
- The output argument is type char**.
It returns the name of the cluster.
|