netmaker/test/groupscreate.sh

27 lines
546 B
Bash
Raw Normal View History

2021-03-26 00:17:52 +08:00
#!/bin/bash
NAME="doofusnet"
ADDRESSRANGE="10.69.0.0/16"
generate_post_json ()
{
cat <<EOF
{
"netid": "$NAME",
2021-03-26 00:17:52 +08:00
"addressrange": "$ADDRESSRANGE"
}
EOF
}
POST_JSON=$(generate_post_json)
curl --max-time 5.0 -d "$POST_JSON" -H 'Content-Type: application/json' -H "authorization: Bearer secretkey" localhost:8081/api/networks
2021-03-26 00:17:52 +08:00
NAME="skynet"
ADDRESSRANGE="100.70.0.0/14"
POST_JSON=$(generate_post_json)
curl --max-time 5.0 -d "$POST_JSON" -H 'Content-Type: application/json' -H "authorization: Bearer secretkey" localhost:8081/api/networks