2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-28 16:20:54 +00:00

Begin adding hooks to work discovery

Discovery will be more explicitly organized.  This should
make it easier for folks to understand and have common paths
for embracing new schemes as appropriate.  At this point
PXE, SLP, SSDP, and mDNS are likely discovery schemes, and
'location' providers would be Ethernet switches and server
blade enclosure managers.
This commit is contained in:
Jarrod Johnson
2016-08-24 15:48:49 -04:00
parent ddbc155d6b
commit 711061347c
+9 -1
View File
@@ -100,7 +100,8 @@ def load_plugins():
sys.path.pop(1)
rootcollections = ['noderange/', 'nodes/', 'nodegroups/', 'users/', 'events/']
rootcollections = ['discovery/',
'noderange/', 'nodes/', 'nodegroups/', 'users/', 'events/']
class PluginRoute(object):
@@ -587,6 +588,10 @@ def handle_node_request(configmanager, inputdata, operation,
# return stripnode(passvalues[0], nodes[0])
def handle_discovery(pathcomponents, operation, configmanager, inputdata):
if pathcomponents[0] == 'detected':
pass
def handle_path(path, operation, configmanager, inputdata=None, autostrip=True):
"""Given a full path request, return an object.
@@ -645,5 +650,8 @@ def handle_path(path, operation, configmanager, inputdata=None, autostrip=True):
raise exc.NotFoundException()
if operation == 'update':
return alerts.decode_alert(inputdata, configmanager)
elif pathcomponents[0] == 'discovery':
return handle_discovery(pathcomponents[1:], operation, configmanager,
inputdata)
else:
raise exc.NotFoundException()