Last active
September 13, 2022 10:26
-
-
Save miyadav/5e44af24af9752d945dd1e4f65cb0363 to your computer and use it in GitHub Desktop.
for creating bulk categories
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
#!/bin/bash | |
count=$1 | |
for i in $(seq $count); do | |
govc tags.create -c "testtagscachecategory"$i "tagscache"$i | |
done |
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
#!/bin/bash | |
count=$1 | |
for i in $(seq $count); do | |
govc tags.category.create -d "testcache"$i "testtagscachecategory"$i | |
done |
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
#!/bin/bash | |
count=$1 | |
for i in $(seq $count); do | |
govc tags.category.rm "testtagscachecategory"$i | |
done |
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
#!/bin/bash | |
count=$1 | |
for i in $(seq $count); do | |
govc tags.rm -f -c "testtagscachecategory"$i "tagscache"$i | |
done |
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
export GOVC_URL=https://xxx.xxxx-xx-xxx-xxx.vmwarevmc.com | |
export GOVC_USERNAME=xxxx@xxxx.xyz | |
export GOVC_PASSWORD=xxxxxxxx | |
export URL=https://xxxxxx.com | |
Export above variables and then pass the count to the above shell scripts to create categories | |
Refer for more - https://github.com/vmware/govmomi/blob/master/govc/USAGE.md | |
to Download cli use - https://github.com/vmware/govmomi/blob/master/govc/README.md#binaries |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment