mirror of
https://github.com/xcat2/confluent.git
synced 2026-09-29 00:31:09 +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:
@@ -98,7 +98,8 @@ def load_plugins():
|
||||
pluginmap[plugin] = tmpmod
|
||||
|
||||
|
||||
rootcollections = ['noderange/', 'nodes/', 'nodegroups/', 'users/', 'events/']
|
||||
rootcollections = ['discovery/',
|
||||
'noderange/', 'nodes/', 'nodegroups/', 'users/', 'events/']
|
||||
|
||||
|
||||
class PluginRoute(object):
|
||||
@@ -576,6 +577,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.
|
||||
|
||||
@@ -634,5 +639,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()
|
||||
|
||||
Reference in New Issue
Block a user