#!/bin/ksh93
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/lib/ksh93/db2/vg/KLIB_DB2_VG_get_pvids.sh 1.5 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2005,2013 
# 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 
# @(#)78	1.5 src/43haes/lib/ksh93/db2/vg/KLIB_DB2_VG_get_pvids.sh, hacmp, 61haes_r714 6/13/13 08:28:36
#
#=head1 NAME
#
# KLIB_DB2_VG_get_pvids - Get the list of PVIDs for a VG on a particular node
#
#=head1 SYNOPSIS
#
# . /usr/es/sbin/cluster/sa/db2/etc/db2.disc
# pvids=$(KLIB_DB2_VG_get_pvids "nodeA" "vg1")
#
#=head1 DESCRIPTION
#
# Get the list of pvids for a VG on a particular node 
# This function assumes the output of lspv_as_hash is sourced
#
#=head1 ARGUMENTS
#
#   1: [scalar] name of the node to get info from
#   2: [scalar] volume group to get pvids
#
#=head1 RETURN
#
# echos list of pvids for vg
#
#=head1 COPYRIGHT
#
#(C) COPYRIGHT International Business Machines Corp. 2005
#All Rights Reserved
#
#=cut
#
function KLIB_DB2_VG_get_pvids
{
	. /usr/es/lib/ksh93/func_include

	typeset -A array
	typeset node=$1
	typeset vg=$2
	typeset pvid

         for pvid in ${AIX_DISKS[PVIDS_"$node"_"$vg"]}; do
           [[ $pvid != *([[:space:]]) ]] && array[$pvid]=$pvid
       done


	echo "${!array[*]}"
}
