我是sdn和Floodlight的新手,我想为我的控制器指定一个算法,例如python代码中的STP或robin,是否可以使用Curl来实现?
我有以下代码,但无法在Floodlight中使用:
echo "Create load balancer pool with Random load balancing policy "
curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X POST http://192.168.56.105:8080/one/nb/v2/lb/default/create/pool -
d '{"name":"PoolRA","lbmethod":"random"}'
if [[ $? == 0 ]] ; then
echo " load balancer pool Created "
fi
curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X POST http://192.168.56.105:8080/one/nb/v2/lb/default/create/vip -
d '{"name":"VIP-RA","ip":"10.0.0.20","protocol":"TCP","port":"5550","poolname":"PoolRA"}'
echo " Create load balancer VIP "
curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X PUT http://192.168.56.105:8080/one/nb/v2/lb/default/update/vip -d
'{"name":"VIP-RA","poolname":"PoolRA"}'
if [[ $? == 0 ]] ; then
echo " load balancer VIP Created "
fi
echo "Creating Pool Members"
for members in 1 2 3 4 5 6 7 8
do
curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X POST
http://192.168.56.105:8080/one/nb/v2/lb/default/create/poolmember -d '{"name":"PM'$members'","ip":"10.0.0.'$members'","poolname":"PoolRA"}'