From fb6092373e06af10f12499eb765dade3945e4084 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Wed, 7 Oct 2020 17:49:45 +0100 Subject: [PATCH] split gcp_info_cloud_sql.sh from gcp_info_storage.sh --- gcp_info_cloud_sql.sh | 58 +++++++++++++++++++++++++++++++++++++++++++ gcp_info_storage.sh | 18 +------------- 2 files changed, 59 insertions(+), 17 deletions(-) create mode 100755 gcp_info_cloud_sql.sh diff --git a/gcp_info_cloud_sql.sh b/gcp_info_cloud_sql.sh new file mode 100755 index 00000000..36886888 --- /dev/null +++ b/gcp_info_cloud_sql.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +# vim:ts=4:sts=4:sw=4:et +# +# Author: Hari Sekhon +# Date: 2020-08-13 19:38:39 +0100 (Thu, 13 Aug 2020) +# +# https://github.com/harisekhon/bash-tools +# +# License: see accompanying Hari Sekhon LICENSE file +# +# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish +# +# https://www.linkedin.com/in/harisekhon +# + +set -euo pipefail +[ -n "${DEBUG:-}" ] && set -x +srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# shellcheck disable=SC1090 +. "$srcdir/lib/utils.sh" + +# shellcheck disable=SC1090 +. "$srcdir/lib/gcp.sh" + +# shellcheck disable=SC2034,SC2154 +usage_description=" +Lists GCP Cloud SQL instances and the status of backups for each SQL instance in the current GCP Project + +$gcp_info_formatting_help +" + +# used by usage() in lib/utils.sh +# shellcheck disable=SC2034 +usage_args="" + +help_usage "$@" + + +# shellcheck disable=SC1090 +type is_service_enabled &>/dev/null || . "$srcdir/gcp_service_apis.sh" >/dev/null + + +# Cloud SQL instances +cat </dev/null || . "$srcdir/gcp_service_apis.sh" >/dev/null - -# Cloud SQL instances -cat <