Use request.values instead of request.args
This commit is contained in:
parent
193567f965
commit
c7269a092e
|
@ -54,8 +54,8 @@ def api_node_secondary():
|
||||||
Take NODE out of primary router mode.
|
Take NODE out of primary router mode.
|
||||||
"""
|
"""
|
||||||
# Get node
|
# Get node
|
||||||
if 'node' in flask.request.args:
|
if 'node' in flask.request.values:
|
||||||
node = flask.request.args['node']
|
node = flask.request.values['node']
|
||||||
else:
|
else:
|
||||||
return "Error: No node provided. Please specify a node.\n", 510
|
return "Error: No node provided. Please specify a node.\n", 510
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@ def api_node_primary():
|
||||||
Set NODE to primary router mode.
|
Set NODE to primary router mode.
|
||||||
"""
|
"""
|
||||||
# Get node
|
# Get node
|
||||||
if 'node' in flask.request.args:
|
if 'node' in flask.request.values:
|
||||||
node = flask.request.args['node']
|
node = flask.request.values['node']
|
||||||
else:
|
else:
|
||||||
return "Error: No node provided. Please specify a node.\n", 510
|
return "Error: No node provided. Please specify a node.\n", 510
|
||||||
|
|
||||||
|
@ -102,8 +102,8 @@ def api_node_flush():
|
||||||
Flush NODE of running VMs.
|
Flush NODE of running VMs.
|
||||||
"""
|
"""
|
||||||
# Get node
|
# Get node
|
||||||
if 'node' in flask.request.args:
|
if 'node' in flask.request.values:
|
||||||
node = flask.request.args['node']
|
node = flask.request.values['node']
|
||||||
else:
|
else:
|
||||||
return "Error: No node provided. Please specify a node.\n", 510
|
return "Error: No node provided. Please specify a node.\n", 510
|
||||||
|
|
||||||
|
@ -127,8 +127,8 @@ def api_node_ready():
|
||||||
Restore NODE to active service.
|
Restore NODE to active service.
|
||||||
"""
|
"""
|
||||||
# Get node
|
# Get node
|
||||||
if 'node' in flask.request.args:
|
if 'node' in flask.request.values:
|
||||||
node = flask.request.args['node']
|
node = flask.request.values['node']
|
||||||
else:
|
else:
|
||||||
return "Error: No node provided. Please specify a node.\n", 510
|
return "Error: No node provided. Please specify a node.\n", 510
|
||||||
|
|
||||||
|
@ -151,8 +151,8 @@ def api_node_list():
|
||||||
Return a list of nodes with limit LIMIT.
|
Return a list of nodes with limit LIMIT.
|
||||||
"""
|
"""
|
||||||
# Get limit
|
# Get limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ def api_vm():
|
||||||
@pvcapi.route('/api/v1/vm/add', methods=['POST'])
|
@pvcapi.route('/api/v1/vm/add', methods=['POST'])
|
||||||
def api_vm_add():
|
def api_vm_add():
|
||||||
"""
|
"""
|
||||||
Add a VM to the PVC cluster.
|
Add a VM named NAME to the PVC cluster.
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -266,20 +266,20 @@ def api_vm_list():
|
||||||
Return a list of VMs with limit LIMIT.
|
Return a list of VMs with limit LIMIT.
|
||||||
"""
|
"""
|
||||||
# Get node limit
|
# Get node limit
|
||||||
if 'node' in flask.request.args:
|
if 'node' in flask.request.values:
|
||||||
node = flask.request.args['node']
|
node = flask.request.values['node']
|
||||||
else:
|
else:
|
||||||
node = None
|
node = None
|
||||||
|
|
||||||
# Get state limit
|
# Get state limit
|
||||||
if 'state' in flask.request.args:
|
if 'state' in flask.request.values:
|
||||||
state = flask.request.args['state']
|
state = flask.request.values['state']
|
||||||
else:
|
else:
|
||||||
state = None
|
state = None
|
||||||
|
|
||||||
# Get name limit
|
# Get name limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
|
@ -330,8 +330,8 @@ def api_net_list():
|
||||||
Return a list of client networks with limit LIMIT.
|
Return a list of client networks with limit LIMIT.
|
||||||
"""
|
"""
|
||||||
# Get name limit
|
# Get name limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
|
@ -358,14 +358,14 @@ def api_net_dhcp_list():
|
||||||
Return a list of DHCP leases in network NETWORK with limit LIMIT.
|
Return a list of DHCP leases in network NETWORK with limit LIMIT.
|
||||||
"""
|
"""
|
||||||
# Get network
|
# Get network
|
||||||
if 'network' in flask.request.args:
|
if 'network' in flask.request.values:
|
||||||
network = flask.request.args['network']
|
network = flask.request.values['network']
|
||||||
else:
|
else:
|
||||||
return "Error: No network provided. Please specify a network.\n", 510
|
return "Error: No network provided. Please specify a network.\n", 510
|
||||||
|
|
||||||
# Get name limit
|
# Get name limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
|
@ -406,14 +406,14 @@ def api_net_dhcp_static_list():
|
||||||
Return a list of static DHCP leases in network NETWORK with limit LIMIT.
|
Return a list of static DHCP leases in network NETWORK with limit LIMIT.
|
||||||
"""
|
"""
|
||||||
# Get network
|
# Get network
|
||||||
if 'network' in flask.request.args:
|
if 'network' in flask.request.values:
|
||||||
network = flask.request.args['network']
|
network = flask.request.values['network']
|
||||||
else:
|
else:
|
||||||
return "Error: No network provided. Please specify a network.\n", 510
|
return "Error: No network provided. Please specify a network.\n", 510
|
||||||
|
|
||||||
# Get name limit
|
# Get name limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
|
@ -454,20 +454,20 @@ def api_net_acl_list():
|
||||||
Return a list of network ACLs in network NETWORK with limit LIMIT.
|
Return a list of network ACLs in network NETWORK with limit LIMIT.
|
||||||
"""
|
"""
|
||||||
# Get network
|
# Get network
|
||||||
if 'network' in flask.request.args:
|
if 'network' in flask.request.values:
|
||||||
network = flask.request.args['network']
|
network = flask.request.values['network']
|
||||||
else:
|
else:
|
||||||
return "Error: No network provided. Please specify a network.\n", 510
|
return "Error: No network provided. Please specify a network.\n", 510
|
||||||
|
|
||||||
# Get name limit
|
# Get name limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
# Get direction limit
|
# Get direction limit
|
||||||
if 'direction' in flask.request.args:
|
if 'direction' in flask.request.values:
|
||||||
direction = flask.request.args['direction']
|
direction = flask.request.values['direction']
|
||||||
if not 'in' in direction or not 'out' in direction:
|
if not 'in' in direction or not 'out' in direction:
|
||||||
return "Error: Direction must be either 'in' or 'out'.\n", 510
|
return "Error: Direction must be either 'in' or 'out'.\n", 510
|
||||||
else:
|
else:
|
||||||
|
@ -563,8 +563,8 @@ def api_ceph_osd_list():
|
||||||
Get the list of OSDs in the Ceph storage cluster.
|
Get the list of OSDs in the Ceph storage cluster.
|
||||||
"""
|
"""
|
||||||
# Get name limit
|
# Get name limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
|
@ -605,8 +605,8 @@ def api_ceph_pool_list():
|
||||||
Get the list of RBD pools in the Ceph storage cluster.
|
Get the list of RBD pools in the Ceph storage cluster.
|
||||||
"""
|
"""
|
||||||
# Get name limit
|
# Get name limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
|
@ -647,14 +647,14 @@ def api_ceph_volume_list():
|
||||||
Get the list of RBD volumes in the Ceph storage cluster.
|
Get the list of RBD volumes in the Ceph storage cluster.
|
||||||
"""
|
"""
|
||||||
# Get name limit
|
# Get name limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
# Get pool limit
|
# Get pool limit
|
||||||
if 'pool' in flask.request.args:
|
if 'pool' in flask.request.values:
|
||||||
pool = flask.request.args['pool']
|
pool = flask.request.values['pool']
|
||||||
else:
|
else:
|
||||||
pool = 'all'
|
pool = 'all'
|
||||||
|
|
||||||
|
@ -695,20 +695,20 @@ def api_ceph_volume_snapshot_list():
|
||||||
Get the list of RBD volume snapshots in the Ceph storage cluster.
|
Get the list of RBD volume snapshots in the Ceph storage cluster.
|
||||||
"""
|
"""
|
||||||
# Get name limit
|
# Get name limit
|
||||||
if 'limit' in flask.request.args:
|
if 'limit' in flask.request.values:
|
||||||
limit = flask.request.args['limit']
|
limit = flask.request.values['limit']
|
||||||
else:
|
else:
|
||||||
limit = None
|
limit = None
|
||||||
|
|
||||||
# Get volume limit
|
# Get volume limit
|
||||||
if 'volume' in flask.request.args:
|
if 'volume' in flask.request.values:
|
||||||
volume = flask.request.args['volume']
|
volume = flask.request.values['volume']
|
||||||
else:
|
else:
|
||||||
volume = 'all'
|
volume = 'all'
|
||||||
|
|
||||||
# Get pool limit
|
# Get pool limit
|
||||||
if 'pool' in flask.request.args:
|
if 'pool' in flask.request.values:
|
||||||
pool = flask.request.args['pool']
|
pool = flask.request.values['pool']
|
||||||
else:
|
else:
|
||||||
pool = 'all'
|
pool = 'all'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue