The cl_getgroup routine returns information about
the specified resource group in the specified cluster.
Syntax
int cl_getgroup (int clusterid, char *groupname,
struct cl_group *groupbufp);
Parameters
| Item | Description |
| clusterid |
The cluster ID of the desired cluster. |
| groupname |
The name of the resource group. |
| groupbufp |
A pointer to a cl_group structure where the information
is returned. |
Status codes
| Item | Description |
| CLE_OK |
Success. |
| CLE_BADARGS |
Missing or invalid argument(s). |
| CLE_SYSERR |
System error. |
| CLE_NOCLINFO |
No cluster information available. |
| CLE_IVCLUSTERID |
Invalid cluster ID. |
| CLE_IVNODENAME |
Invalid resource group name. |
Example
int clusterid = 1113325332;
int status, j;
char* groupname = "rg01";
struct cl_group group;
status = cl_getgroup(clusterid, groupname, &group);
if (status != CLE_OK){
cl_perror(status, "can't get resource group information");
} else {
printf("resource group %s has %d nodes.\n",
group.clg_name,
group.clg_num_nodes);
for(j=0; j < group.clg_num_nodes; j++){
printf("node w/ id %d is in state %d [%s]\n",
group.clg_node_ids[j],
group.clg_node_states[j],
/* user defined function char* cvrt_rg_state(enum cl_resource_states state)
** to convert state id numbers to text
*/
cvrt_rg_state(group.clg_node_states[j]));
}
}