CL_cluster::CL_getprimary routine

Returns the node name of the user-designated primary Cluster Manager for the specified cluster.

Syntax

CL_nodename CL_cluster::CL_getprimary (CL_status s)

Required input object data

Item Description
CL_cluster::clc_clusterid The cluster ID for which the primary ID is desired.

Return value

Item Description
CL_nodename The node name of the primary Cluster Manager.

Status value

Item Description
CL_status status Status passed by reference. Output parameter for the return codes.
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX® global variable errno for additional information.
CLE_NOPRIMARY No primary information is available. This status usually indicates that the user has not designated a primary cluster manager.
CLE_IVCLUSTER The cluster is not available.

Example

CL_cluster cluster;
CL_status status;
CL_nodename name;

cluster.clc_clusterid = 1;
name = cluster.CL_getprimary(status);
if (status < 0) {
    cl_errmsg(status);
} else {
    printf( "cluster %d's primary node is %s\n",
cluster.clc_clusterid, cluster.clc_primary.name);
}