mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
adds link state option for instance networks. Enable/disable link while instance running
This commit is contained in:
parent
01f2290dd9
commit
ecf31b0b5b
3 changed files with 50 additions and 10 deletions
|
|
@ -873,6 +873,15 @@ def instance(request, compute_id, vname):
|
|||
addlogmsg(request.user.username, instance.name, msg)
|
||||
return HttpResponseRedirect(request.get_full_path() + '#network')
|
||||
|
||||
if 'set_link_state' in request.POST:
|
||||
mac_address = request.POST.get('mac', '')
|
||||
state = request.POST.get('set_link_state')
|
||||
state = 'down' if state == 'up' else 'up'
|
||||
conn.set_link_state(mac_address, state)
|
||||
msg = _("Set Link State: {}".format(state))
|
||||
addlogmsg(request.user.username, instance.name, msg)
|
||||
return HttpResponseRedirect(request.get_full_path() + '#network')
|
||||
|
||||
if 'set_qos' in request.POST:
|
||||
qos_dir = request.POST.get('qos_direction', '')
|
||||
average = request.POST.get('qos_average') or 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue