Skip to content

Instantly share code, notes, and snippets.

@pheuberger
Last active February 17, 2020 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pheuberger/3ce46bd94ad2a54e6024ff4e6d5551d4 to your computer and use it in GitHub Desktop.
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
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