#!/bin/ksh93 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # 61haes_r714 src/43haes/lib/ksh93/sa/KLIB_SA_update_metadata.sh 1.5 # # Licensed Materials - Property of IBM # # Restricted Materials of IBM # # COPYRIGHT International Business Machines Corp. 2005,2011 # 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 # @(#)24 1.5 src/43haes/lib/ksh93/sa/KLIB_SA_update_metadata.sh, hacmp, 61haes_r714 11/28/11 15:21:22 # #=head1 NAME # # KLIB_SA_update_metadata - Updata metadata to the smart assistant metadata ODM # #=head1 SYNOPSIS # # typeset application_id="SA_DB2Instance" # typeset sa_name="FILESYSTEM" # typeset sa_value="/db2home1/" # KLIB_SA_update_metadata $application_id $sa_name $sa_value || { # echo "Unable to update DB2 filesystem: $sa_value to the HACMP metadata for instance: $application_id" # } # #=head1 DESCRIPTION # # Update metadata to the smart assistant metadata ODM, this function WILL # remove old SA metadata from the ODM with the same application_id and name. # #=head1 ARGUMENTS # # 1: [scalar] application_id, the unique key to identify the smart assistant amongst its peer type # 2: [scalar] sa_name, the smart assistant name, as part of the name / value pair # 3: [scalar] value, the value to store as defined by the unique key (sa_type, sa_key, sa_name) # #=head1 RETURN # # 0 - success # 1 - failed # #=head1 COPYRIGHT # #(C) COPYRIGHT International Business Machines Corp. 2005 #All Rights Reserved # #=cut # function KLIB_SA_update_metadata { . /usr/es/lib/ksh93/func_include application_id=$1 shift name=$1 shift uvalue="$*" KLIB_SA_delete_metadata $application_id $name RC=$? if (( $RC != 0 )); then return $RC fi KLIB_SA_add_metadata $application_id $name "$uvalue" return $? }