Skip to content

Commit 1c331ee

Browse files
Merge pull request #229 from IBM/fleet-beta-monitoring-enablement
Adjusted init fleet script to enable monitoring
2 parents 8f71f95 + 3f04809 commit 1c331ee

File tree

4 files changed

+284
-172
lines changed

4 files changed

+284
-172
lines changed

beta/serverless-fleets/common.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,30 @@ function target_resource_group {
6464
if [[ "$current_resource_group_guid" != "$new_resource_group_guid" ]]; then
6565
ibmcloud target -g $1 --quiet
6666
fi
67+
echo "Done"
68+
}
69+
70+
function does_instance_exist {
71+
(( $(ibmcloud resource search "service_name:\"$1\" AND name:\"$2\"" --output JSON|jq -r '.items|length') > 0 ))
72+
}
73+
74+
function does_serviceid_exist {
75+
(( $(ibmcloud resource search "type:serviceid AND name:\"$1\"" --output JSON|jq -r '.items|length') > 0 ))
76+
}
77+
78+
function has_bucket_name_with_prefix {
79+
buckets=$(ibmcloud cos buckets -output json)
80+
COS_BUCKET_NAME=""
81+
if [[ "$(echo "${buckets}" | jq -r '.Buckets')" != "null" ]]; then
82+
for bucket in $(echo "${buckets}" | jq -r '.Buckets|.[] | @base64'); do
83+
_jq() {
84+
echo ${bucket} | base64 --decode | jq -r ${1}
85+
}
86+
bucket_name=$(_jq '.Name')
87+
if [[ "$bucket_name" =~ ^$1-* ]]; then
88+
COS_BUCKET_NAME=$bucket_name
89+
fi
90+
done
91+
fi
92+
echo $COS_BUCKET_NAME
6793
}

0 commit comments

Comments
 (0)