Advertisement
fkeles

cleanup.sh

Oct 10th, 2023
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.37 KB | Source Code | 0 0
  1. for i in $(oci search resource structured-search --query-text "QUERY instance resources where lifeCycleState = 'RUNNING' && displayName =~ 'test' && compartmentId = '$COMPARTMENT_ID' " --query 'data.items[*].identifier' --raw-output|sed 's/\"//g;s/,//g'|egrep -v -e "\[" -e "\]")
  2. do
  3.     time oci compute instance terminate --instance-id "$i" --force
  4.     ##echo "$i"
  5. done
  6.  
  7.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement