feat: add command to list linked services for a given app

This commit is contained in:
Jose Diaz-Gonzalez
2018-07-21 16:32:00 -04:00
parent f30db928fb
commit 57554f6288
3 changed files with 38 additions and 0 deletions

View File

@@ -118,6 +118,22 @@ service_alternative_alias() {
echo "$ALIAS"
}
service_app_links() {
declare desc="Outputs all service links for a given app"
declare APP="$1"
local SERVICE LINKED_APP
pushd "$PLUGIN_DATA_ROOT" > /dev/null
for SERVICE in *; do
[[ -f "$SERVICE/LINKS" ]] || continue
for LINKED_APP in $(<"$SERVICE/LINKS"); do
if [[ "$LINKED_APP" == "$APP" ]] ; then
echo "$SERVICE"
fi
done
done
}
service_backup() {
declare desc="Creates a backup of a service to an existing s3 bucket"
declare SERVICE="$1" BUCKET_NAME="$2" USE_IAM_OPTIONAL_FLAG="$3"