Last active
February 17, 2020 14:02
-
-
Save pheuberger/3ce46bd94ad2a54e6024ff4e6d5551d4 to your computer and use it in GitHub Desktop.
Allows switching between IAM enabled or CF based namespaces for IBM Cloud Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo Do you want to set IAM or CF based namespace? | |
read choice | |
rm ~/.wskprops | |
rm ~/.bluemix/plugins/cloud-functions/config.json | |
lowercaseChoice="$(tr [A-Z] [a-z] <<< "$choice")" | |
if [ $lowercaseChoice == "iam" ] | |
then | |
echo Setting IAM namespace | |
ibmcloud fn property set --namespace <YOUR_IAM_ENABLED_NAMESPACE> | |
elif [ $lowercaseChoice == "cf" ] | |
then | |
echo Setting CF namespace | |
ibmcloud target --cf-api https://api.eu-de.cf.cloud.ibm.com -o <YOUR_ORG> -s <YOUR_CF_BASED_NAMESPACE> | |
fi | |
ibmcloud fn api list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment