JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Cluster Reference Manual
search filter icon
search icon

Document Information

Preface

Introduction

OSC33 1

OSC33 1cl

OSC33 1ha

OSC33 1m

OSC33 3ha

scds_calls(3HA)

scds_close(3HA)

scds_error_string(3HA)

scds_error_string_i18n(3HA)

scds_failover_rg(3HA)

scds_fm_action(3HA)

scds_fm_net_connect(3HA)

scds_fm_net_disconnect(3HA)

scds_fm_print_probes(3HA)

scds_fm_sleep(3HA)

scds_fm_tcp_connect(3HA)

scds_fm_tcp_disconnect(3HA)

scds_fm_tcp_read(3HA)

scds_fm_tcp_write(3HA)

scds_free_ext_property(3HA)

scds_free_netaddr_list(3HA)

scds_free_net_list(3HA)

scds_free_port_list(3HA)

scds_get_current_method_name(3HA)

scds_get_ext_property(3HA)

scds_get_netaddr_list(3HA)

scds_get_port_list(3HA)

scds_get_resource_group_name(3HA)

scds_get_resource_name(3HA)

scds_get_resource_type_name(3HA)

scds_get_rg_hostnames(3HA)

scds_get_rg_hostnames_zone(3HA)

scds_get_rs_hostnames(3HA)

scds_get_zone_name(3HA)

scds_hasp_check(3HA)

scds_initialize(3HA)

scds_pmf_get_status(3HA)

scds_pmf_restart_fm(3HA)

scds_pmf_signal(3HA)

scds_pmf_start(3HA)

scds_pmf_start_env(3HA)

scds_pmf_stop(3HA)

scds_pmf_stop_monitoring(3HA)

scds_print_netaddr_list(3HA)

scds_print_net_list(3HA)

scds_print_port_list(3HA)

scds_property_functions(3HA)

scds_restart_resource(3HA)

scds_restart_rg(3HA)

scds_simple_net_probe(3HA)

scds_simple_probe(3HA)

scds_svc_wait(3HA)

scds_syslog(3HA)

scds_syslog_debug(3HA)

scds_timerun(3HA)

scha_calls(3HA)

scha_cluster_close(3HA)

scha_cluster_get(3HA)

scha_cluster_getlogfacility(3HA)

scha_cluster_getnodename(3HA)

scha_cluster_getzone(3HA)

scha_cluster_open(3HA)

scha_control(3HA)

scha_control_zone(3HA)

scha_resource_close(3HA)

scha_resource_get(3HA)

scha_resourcegroup_close(3HA)

scha_resourcegroup_get(3HA)

scha_resourcegroup_open(3HA)

scha_resource_open(3HA)

scha_resource_setstatus(3HA)

scha_resource_setstatus_zone(3HA)

scha_resourcetype_close(3HA)

scha_resourcetype_get(3HA)

scha_resourcetype_open(3HA)

scha_strerror(3HA)

scha_strerror_i18n(3HA)

OSC33 4

OSC33 5

OSC33 5cl

OSC33 7

OSC33 7p

Index

scha_resourcegroup_open

, scha_resourcegroup_close

, scha_resourcegroup_get

- resource information access functions

Synopsis

cc [flags…] -I /usr/cluster/include file -L /usr/cluster/lib -l scha
#include <scha.h>

scha_err_t scha_resourcegroup_open(const char *rgname, scha_resourcegroup_t *handle);
scha_err_t scha_resourcegroup_close(scha_resourcegroup_t handle);
scha_err_t scha_resourcegroup_get(scha_resourcegroup_t handle, const char *tag...);

Description

The scha_resourcegroup_open(), scha_resourcegroup_get(), and scha_resourcegroup_close() functions are used together to access information about a resource group that is managed by the Resource Group Manager (RGM) cluster facility.

scha_resourcegroup_open() initializes access of the resource group and returns a handle to be used by scha_resourcegroup_get().

The rgname argument names the resource group to be accessed.

The handle argument is the address of a variable to hold the value that is returned by the function.

scha_resourcegroup_get() accesses resource group information as indicated by the tag argument. The tag should be a string value that is 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 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 parameter is the output argument for the resource group information that is to be retrieved. No value is returned for the output argument if the function fails. Memory that is allocated to hold information that is returned by scha_resourcegroup_get() remains intact until scha_resourcegroup_close() is called on the handle that is used for scha_resourcegroup_get().

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

Macros That You Can Use for tag Arguments

You can use the following macros that are defined in scha_tags.h as tag arguments to the scha_resourcegroup_get() function. These macros name resource group properties. The value of the property of the resource group is generated. The RG_STATE property refers to the value on the node or zone where the function is called.

The type of the output argument and any additional arguments are indicated. Structure and enum types are described in the scha_calls(3HA) man page.

SCHA_ALL_LOAD_FACTORS

The output argument type is scha_str_array_t**.

SCHA_ALL_LOAD_FACTOR_NAMES

The output argument type is scha_str_array_t**.

SCHA_DESIRED_PRIMARIES

The output argument type is int*.

SCHA_FAILBACK

The output argument type is boolean_t*.

SCHA_LOAD_FACTOR

The output argument type is int*.

SCHA_GLOBAL_RESOURCES_USED

The output argument type is scha_str_array_t**.

SCHA_IMPL_NET_DEPEND

The output argument type is boolean_t*.

SCHA_MAXIMUM_PRIMARIES

The output argument type is int*.

SCHA_NODELIST

The output argument type is scha_str_array_t**.

SCHA_PATHPREFIX

The output argument type is char**.

SCHA_PINGPONG_INTERVAL

The output argument type is int*.

SCHA_PREEMPTION_MODE

The output argument type is scha_rg_preemption_mode_t*.

SCHA_PRIORITY

The output argument type is int*.

SCHA_RESOURCE_LIST

The output argument type is scha_str_array_t**.

SCHA_RG_AFFINITIES

The output argument type is char**.

SCHA_RG_AUTO_START

The output argument type is boolean_t*.

SCHA_RG_DEPENDENCIES

The output argument type is scha_str_array_t**.

SCHA_RG_DESCRIPTION

The output argument type is char**.

SCHA_RG_IS_FROZEN

The output argument type is boolean_t*.

SCHA_RG_MODE

The output argument type is scha_rgmode_t*.

SCHA_RG_PROJECT_NAME

The output argument type is char**.

SCHA_RG_SLM_CPU

The output argument type is char**.

SCHA_RG_SLM_CPU_MIN

The output argument type is char**.

SCHA_RG_SLM_PSET_TYPE

The output argument type is char**.

SCHA_RG_SLM_TYPE

The output argument type is char**.

SCHA_RG_STATE

The output argument type is scha_rgstate_t*.

SCHA_RG_STATE_NODE

The output argument type is scha_rgstate_t*. An additional argument type is char*. The additional argument names a cluster node and returns the state of the resource group on that node.

SCHA_RG_SUSP_AUTO_RECOVERY

The output argument type is boolean_t*.

SCHA_RG_SYSTEM

The output argument type is boolean_t*.

Return Values

These functions return the following:

0

The function succeeded.

nonzero

The function failed.

Errors

SCHA_ERR_NOERR

The function succeeded.

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

Examples

Example 1 Using the scha_resourcegroup_get() Function

The following example uses scha_resourcegroup_get() to get the list of resources in the resource group example_RG.

main() {
   #include <scha.h>

   scha_err_t err;
   scha_str_array_t *resource_list;
   scha_resourcegroup_t handle;
   int ix;

   char * rgname = "example_RG";    

   err = scha_resourcegroup_open(rgname, &handle);

   err = scha_resourcegroup_get(handle, SCHA_RESOURCE_LIST, \
         &resource_list);

   if (err == SCHA_ERR_NOERR) {
    for (ix = 0; ix < resource_list->array_cnt; ix++) {
        printf("Group: %s contains resource %s\
", rgname,
                resource_list->str_array[ix]);
        }
    }

/* resource_list memory freed */
 err = scha_resourcegroup_close(handle);    
}

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 TYPE
ATTRIBUTE VALUE
Availability
SUNWscdev
Interface Stability
Evolving

See Also

clnode(1CL), scha_resourcegroup_get(1HA) , scha_calls(3HA), attributes(5)