Last active
October 1, 2021 10:06
-
-
Save F5Training/9b967477383c7931bea92197b3d364bd to your computer and use it in GitHub Desktop.
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
# Replace the two X's below with your student number | |
host=192.168.X.31 | |
creds=admin:f5trnX | |
get() { curl --silent --insecure --user $creds --request GET https://$host/mgmt/tm/"$1"; } | |
post() { [ "${1:0:1}" != "/" ] && path="/mgmt/tm/" || path=/; [ -v SHOW_CURL ] && >&2 echo curl --silent --insecure --user $creds --request POST --header 'Content-Type: application/json' --data '$2' https://$host$path$1; curl --silent --insecure --user $creds --request POST --header 'Content-Type: application/json' --data "$2" https://$host$path$1; } | |
put() { curl --silent --insecure --user $creds --request PUT --header 'Content-Type: application/json' --data "$2" https://$host/mgmt/tm/"$1"; } | |
patch() { [ "${1:0:1}" != "/" ] && path="/mgmt/tm/" || path=/; [ -v SHOW_CURL ] && >&2 echo curl --silent --insecure --user $creds --request PATCH --header 'Content-Type: application/json' --data "$2" https://$host$path$1; curl --silent --insecure --user $creds --request PATCH --header 'Content-Type: application/json' --data "$2" https://$host$path$1; } | |
delete() { curl --silent --insecure --user $creds --request DELETE https://$host/mgmt/tm/"$1"; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment