# Tailf:cli-completion-actionpoint usage in Java/YANG

**URL:** https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-usage-in-java-yang/2173
**Category:** YANG
**Created:** [December 2, 2018, 7:29am UTC](https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-usage-in-java-yang/2173 "2018-12-02T07:29:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Zahid](https://avatars.discourse-cdn.com/v4/letter/z/e79b87/32.png) [@Zahid](https://dmap-community.ductus.global/u/Zahid)
#### Post date: [December 2, 2018, 7:29am UTC](https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-usage-in-java-yang/2173/1 "2018-12-02T07:29:00Z")

</div>

NSO version: 4.7.1

I have written a sample java action-demo to explore how **tailf:cli-completion-actionpoint** ( Tail-f YANG CLI extensions) works.

However when i invoke the completion-actionpoint (from CLI) I always get below errors in log files

**ncs.log**

no registration found for callpoint if-complete-action/completion of type=external

**devel.log**

1-Dec-2018::21:03:28.952 zahid-VirtualBox ncs[29209]: devel-c no registration found for callpoint if-complete-action/completion of type=external  
 1-Dec-2018::21:03:28.952 zahid-VirtualBox ncs[29209]: ncs Return error {cs\_error,undefined,misc,external,undefined,undefined,  
\<\<“no registration found for callpoint if-complete-action/completion of type=external”\>\>,  
undefined,undefined,false}

**Here is the yang definition**

module action-demo {  
…namespace “[http://com/example/actiondemo](http://com/example/actiondemo)”;  
…prefix action-demo;

…import ietf-inet-types { prefix inet; }  
…import tailf-common { prefix tailf; }  
…import tailf-ncs { prefix ncs; }

…description “A small demo module to illustrate how to implement user defined actions”;

…container action-demo {  
…tailf:action myvpn-action {  
…tailf:actionpoint actionpoint-myvpn;  
…input {  
…container endpoint {  
…tailf:cli-compact-syntax;  
…leaf device {  
…type leafref {  
…path “/ncs:devices/ncs:device/ncs:name”;  
…}  
…tailf:info “Endpoint Device”;  
…mandatory true;  
…}

…leaf interface {  
…tailf:info “Endpoint Port”;  
…type string;  
…tailf:cli-completion-actionpoint if-complete-action;  
…mandatory true;  
…}  
…}  
…}  
…}  
…}  
}

**Here is the Java code snippet**

public class ActionDemo {  
private static Logger LOGGER = Logger.getLogger(ActionDemo.class);

// some code here  
// …

@ActionCallback(callPoint = “if-complete-action”, callType = ActionCBType.COMPLETION)  
Completion completion(DpActionTrans actx, char cliStyle, String token, char completionChar, ConfObject[] kp, String cmdPath, String cmdParamId,  
ConfQname simpleType, String extra) throws DpCallbackException {  
try {  
LOGGER.info(String.format(“completion() callback, actionpoint : %s”, actx.getActionPoint()));

CompletionReply reply = Completion.newReply();  
reply.addCompletion(“fe-0/0”, null);  
reply.addCompletion(“fe-0/1”, null);  
reply.addCompletion(“ge-0/0”, null);  
reply.addCompletion(“ge-0/1”, null);  
reply.setCompletionInfo(“interfaces”);  
reply.setCompletionDesc(“all device interfaces”);  
return reply;

} catch (Exception e) {  
throw new DpCallbackException(“completion failed”, e);  
}  
}  
}

**package-meta-data.xml**

action-demo 1.0 Java-based action-demo 2.0 action-demo com.example.actiondemo.ActionDemo

Any help will be greatly appreciated.

Thanks

Zahid

---

<div class="post-metadata">

### Author: ![Zahid](https://avatars.discourse-cdn.com/v4/letter/z/e79b87/32.png) [@Zahid](https://dmap-community.ductus.global/u/Zahid)
#### Post date: [December 2, 2018, 11:33am UTC](https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-usage-in-java-yang/2173/2 "2018-12-02T11:33:27Z")

</div>

Problem has been resolved.  
completion() callback was not overridden due to the fact that it was package private.  
I made it public completion().

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [December 2, 2018, 12:13pm UTC](https://dmap-community.ductus.global/t/tailf-cli-completion-actionpoint-usage-in-java-yang/2173/3 "2018-12-02T12:13:45Z")

</div>

Great. For future NSO questions you likely want to post them at the NSO developer hub:  
[https://community.cisco.com/t5/nso-developer-hub/ct-p/5672j-dev-nso](https://community.cisco.com/t5/nso-developer-hub/ct-p/5672j-dev-nso)
