2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 01:22:00 +00:00

Fix nodediscover CLI for subscribe/unsubscribe

This commit is contained in:
Jarrod Johnson 2022-11-03 09:38:39 -04:00
parent 7561b68b57
commit 1e78f11c2b
2 changed files with 9 additions and 4 deletions

View File

@ -53,9 +53,14 @@ columnmapping = {
def subscribe_discovery(options, session, subscribe):
keyn = 'subscribe' if subscribe else 'unsubscribe'
payload = {keyn: options.node}
for rsp in session.update('/discovery/subscription', payload):
if 'status' in rsp:
print(rsp['status'])
if subscribe:
for rsp in session.update('/discovery/subscriptions/{0}'.format(options.node), payload):
if 'status' in rsp:
print(rsp['status'])
else:
for rsp in session.delete('/discovery/subscriptions/{0}'.format(options.node)):
if 'status' in rsp:
print(rsp['status'])
def print_disco(options, session, currmac, outhandler, columns):
procinfo = {}

View File

@ -518,7 +518,7 @@ def handle_read_api_request(pathcomponents):
dirlist = [msg.ChildCollection(x + '/') for x in sorted(list(subcats))]
dirlist.append(msg.ChildCollection('rescan'))
dirlist.append(msg.ChildCollection('autosense'))
dirlist.append(msg.ChildCollection('subscription'))
dirlist.append(msg.ChildCollection('subscriptions/'))
return dirlist
if not coll:
return show_info(queryparms['by-mac'])