diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index ee31104c..26646cee 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -475,7 +475,17 @@ def handle_api_request(configmanager, inputdata, operation, pathcomponents): return (msg.KeyValueData({'status': 'unsubscribed'}),) elif operation in ('update', 'create'): if pathcomponents == ['discovery', 'register']: - return + if 'address' not in inputdata: + raise exc.InvalidArgumentException('Missing address in input') + nd = { + 'addresses': [(inputdata['address'], 443)] + } + sd = ssdp.check_fish(('/DeviceDescription.json', nd)) + sd['hwaddr'] = sd['attributes']['mac-address'] + if not sd: + raise exc.Unsupported('Target address is not a supported device for remote discovery registration') + detected(sd) + return msg.CreatedResource(inputdata['address']) if 'node' not in inputdata: raise exc.InvalidArgumentException('Missing node name in input') mac = _get_mac_from_query(pathcomponents)