mirror of
https://github.com/ThomasGsp/HyperProxmox.git
synced 2025-02-14 20:22:13 +00:00
- Change api syntax to insert a new cluster
This commit is contained in:
parent
5934999c9f
commit
2a621a56b6
1 changed files with 6 additions and 2 deletions
|
@ -11,6 +11,7 @@ import random
|
|||
import ast
|
||||
|
||||
|
||||
""" --------- TMP PART --------- """
|
||||
|
||||
allowed = (
|
||||
('jon','pass1'),
|
||||
|
@ -39,10 +40,12 @@ class Login:
|
|||
else:
|
||||
authreq = True
|
||||
if authreq:
|
||||
web.header('WWW-Authenticate','Basic realm="Auth HyperProxmox API"')
|
||||
web.header('WWW-Authenticate', 'Basic realm="Auth HyperProxmox API"')
|
||||
web.ctx.status = '401 Unauthorized'
|
||||
return
|
||||
|
||||
""" ------------------- """
|
||||
|
||||
""" CLASS MONGO CACHE """
|
||||
class General_Search:
|
||||
def GET(self, query, id):
|
||||
|
@ -107,9 +110,10 @@ class Cluster:
|
|||
|
||||
return json.dumps(result)
|
||||
|
||||
def POST(self):
|
||||
def POST(self, cluster):
|
||||
try:
|
||||
data = json.loads(web.data().decode('utf-8'))
|
||||
data["name"] = cluster
|
||||
result = core.insert_clusters_conf(data)
|
||||
except BaseException as e:
|
||||
result = {
|
||||
|
|
Loading…
Reference in a new issue