Skip to content

Instantly share code, notes, and snippets.

@nibalizer
Created March 14, 2020 17:19
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 nibalizer/1345227718fac0ee7158fbe41c185ec8 to your computer and use it in GitHub Desktop.
Save nibalizer/1345227718fac0ee7158fbe41c185ec8 to your computer and use it in GitHub Desktop.
Script fragments for manual tagging resources in IBM Cloud
#!/bin/bash
#source ../local.env
# apache2.0 license
#ibmcloud target -g $RESOURCE_GROUP_NAME
#IAM_TOKEN=$(ibmcloud iam oauth-tokens | grep IAM | awk '{print $4}')
#CLUSTER_CRN=$(ibmcloud ks cluster get --cluster $CLUSTER_NAME_PREFIX$i --json | jq -r .crn)
#CLUSTER_CRN=$CRN
curl \
-s \
-X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: bearer '$IAM_TOKEN'' \
-H 'Accept: application/json' \
"https://tags.global-search-tagging.cloud.ibm.com/v3/tags/?providers=ghost&attached_to=${CLUSTER_CRN}"
# --data '{"tag_name": "'$FILTER_TAG'", "resources": [{ "resource_id": "'$CLUSTER_CRN'"}]}' \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment