#!/bin/ksh93
#  ALTRAN_PROLOG_BEGIN_TAG                                                    
#  This is an automatically generated prolog.                                  
#                                                                              
#  Copyright (C) Altran ACT S.A.S. 2017,2018,2019,2021.  All rights reserved.  
#                                                                              
#  ALTRAN_PROLOG_END_TAG                                                      
#                                                                              
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/usr/sbin/cluster/events/resource_offline.sh 1.1.1.8 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2004,2014 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)  9f023c6 43haes/usr/sbin/cluster/events/resource_offline.sh, 726, 2147A_aha726, Feb 19 2021 01:54 PM
#########################################################################
#
#   COMPONENT_NAME: CLMGR
#
#   FUNCTIONS:
#
#       stop_cluster
#       stop_site
#       stop_node
#       stop_rg
#
#########################################################################


#
# Name:  stop_cluster
#
function stop_cluster {
    LINENO=2 . $HALIBROOT/log_entry "$0()" "$CL" max

    typeset name=$1

    CL=$LINENO KLIB_HACMP_offline_cluster "${_ENV_ARGS[WHEN]}" \
                               "${_ENV_ARGS[MANAGE]}" \
                               "${_ENV_ARGS[BROADCAST]}" \
                               "${_ENV_ARGS[TIMEOUT]}" \
                               "${_ENV_ARGS[STOP_CAA]}"
    log_return_msg "$?" "$0()" "$LINENO"
    return $?
} # End of "stop_cluster()"


#
# Name:  stop_site
#
function stop_site {
    LINENO=2 . $HALIBROOT/log_entry "$0()" "$CL" max

    typeset name=$1

    CL=$LINENO KLIB_HACMP_offline_site "$name" \
                            "${_ENV_ARGS[WHEN]}" \
                            "${_ENV_ARGS[MANAGE]}" \
                            "${_ENV_ARGS[BROADCAST]}" \
                            "${_ENV_ARGS[TIMEOUT]}" \
                            "${_ENV_ARGS[STOP_CAA]}"
    log_return_msg "$?" "$0()" "$LINENO"
    return $?
} # End of "stop_site()"


#
# Name:  stop_node
#
function stop_node {
    LINENO=2 . $HALIBROOT/log_entry "$0()" "$CL" max

    typeset name=$1

    CL=$LINENO KLIB_HACMP_offline_node "$name" \
                            "${_ENV_ARGS[WHEN]}" \
                            "${_ENV_ARGS[MANAGE]}" \
                            "${_ENV_ARGS[BROADCAST]}" \
                            "${_ENV_ARGS[TIMEOUT]}" \
                            "${_ENV_ARGS[STOP_CAA]}"
    log_return_msg "$?" "$0()" "$LINENO"
    return $?
} # End of "stop_node()"


#
# Name:  stop_rg
#
function stop_rg {
    LINENO=2 . $HALIBROOT/log_entry "$0()" "$CL" max

    typeset name=$1

    # NOTE: the "MODE" attribute only accepts a value of "clean",
    #       and is undocumented. No business case has currently
    #       been made for keeping it at all, and it might get
    #       removed!
    CL=$LINENO resource_offline_dispatcher "$name" \
                                "${_ENV_ARGS[NODES]}" \
                                "${_ENV_ARGS[MODE]}" \
                                "${_ENV_ARGS[PRIMARY]}" \
                                "${_ENV_ARGS[SECONDARY]}"
    log_return_msg "$?" "$0()" "$LINENO"
    return $?
} # End of "stop_rg()"



#########################################################################
#########################################################################
##
## MAIN
##
#########################################################################
#########################################################################

LINENO=2 . $HALIBROOT/log_entry resource_offline "$CL" max
: version=@(#)  9f023c6 43haes/usr/sbin/cluster/events/resource_offline.sh, 726, 2147A_aha726, Feb 19 2021 01:54 PM
: INPUTS == $*

#===================================================
# Source the file with common definitions, the run
# the action/class-appropriate class processor.
#===================================================
CL=$LINENO . $HAEVENTS/resource_common "$@"
CL=$LINENO runClassProcessor "$RESOURCE_CLASS" _VAR_SUBSTITUTIONS _ENV_ARGS
log_return_msg "$?" resource_offline "$LINENO"
exit $?
