Implement additional functions

1. VM state
2. VM node
3. Lock flush
This commit is contained in:
2019-08-07 14:24:16 -04:00
parent b7546e3711
commit ea2426fa73
3 changed files with 93 additions and 3 deletions

View File

@ -274,7 +274,7 @@ def api_vm_element(vm):
@authenticator
def api_vm_state(vm):
if flask.request.method == 'GET':
return "Test", 200
return pvcapi.vm_state(vm)
if flask.request.method == 'POST':
if not 'state' in flask.request.values:
@ -294,7 +294,7 @@ def api_vm_state(vm):
@authenticator
def api_vm_node(vm):
if flask.request.method == 'GET':
return "Test", 200
return pvcapi.vm_node(vm)
if flask.request.method == 'POST':
if 'action' in flask.request.values:
@ -335,6 +335,15 @@ def api_vm_node(vm):
flask.abort(400)
@api.route('/api/v1/vm/<vm>/locks', methods=['GET', 'POST'])
@authenticator
def api_vm_locks(vm):
if flask.request.method == 'GET':
return "Not implemented", 400
if flask.request.method == 'POST':
return pvcapi.vm_flush_locks(vm)
#
# Network endpoints