cloud · IBM Cloud · linux · power · PowerVS · ppc64le

ibmcloud powervs: get the email of a given powervs service owner

POWERVS_NAME=<POWERVS NAME>

# get the created_by information
PVS_CREATOR=$(ibmcloud resource service-instance "$POWERVS_NAME" --output json | jq -r '.[] | "\(.created_by)"')

# get the creator email
PVS_CREATOR=$(ibmcloud resource service-instance "$POWERVS_NAME" --output json | jq -r '.[] | "\(.created_by)"')

PVS_CREATOR_MAIL=$(ibmcloud account users --output json | jq -r '.[] | "\(.ibmUniqueId),\(.email)"' | grep "$PVS_CREATOR" | awk -F ',' '{print $2}')

echo $PVS_CREATOR,$PVS_CREATOR_MAIL
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s