File tree Expand file tree Collapse file tree 4 files changed +284
-172
lines changed
Expand file tree Collapse file tree 4 files changed +284
-172
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments