resp, content = self.http.request(self.url_prefix + "link/%s/enable" % link_name, "PUT")
if (resp.status != 201):
print "Waypoint could not be enabled for link %s" % link_name
- print resp.status
return
print "Waypoint enabled for link %s" % link_name
+
+ # Disable waypoint
+ def disable_waypoint(self, link_name):
+ resp, content = self.http.request(self.url_prefix + "link/%s/disable" % link_name, "PUT")
+ if (resp.status != 201):
+ print "Waypoint could not be disabled for link %s" % link_name
+ return
+ print "Waypoint disabled for link %s" % link_name
ac.add_waypoint(link_name, self.waypoint_address)
ac.enable_waypoint(link_name)
did_waypoint = True
+ raw_input("[Press Enter to disable waypoint redirection] ")
+ ac.disable_waypoint(link_name)
time.sleep(1)
def main():
# Add a subnet if it doesn't already exist.
def add_subnet(self, subnet_name, subnet):
if (self.exists(subnet)):
- print "subnet", subnet, "already exists"
+ print "Subnet", subnet, "already exists"
return
subnet_config = dict(name=subnet_name, subnet=subnet)
json_data = json.dumps(subnet_config)
resp, content = self.http.request(self.url_prefix + "subnet/" + subnet_name, "POST", json_data, {'Content-Type': 'application/json'})
if (resp.status == 201):
- print "subnet", subnet, "added"
+ print "Subnet", subnet, "added"
else:
- print "subnet", subnet, "could not be added"
+ print "Subnet", subnet, "could not be added"