Difference between Possible completions and Possible match completions

Hi Team,

On doing tab for the below command getting : Possible completions and Possible match completions,so please help me out in order to complete the command whether I should give possible completion first or

Possible match completions
NE# show abc 
Possible completions:
  1a
  2a 
  |             Output modifiers
  <cr>          
Possible match completions:
leaf1
leaf2
leaf3 


Any idea ??

Thanks.

The difference is that

Possible completions - refer to the values
Possible match completions - refer to the data model structure.

E.g.:

Let’s have data model

container route-status {
        config false;
        tailf:callpoint routestat;
        list route {
            key id;
            leaf id {
                type string;
            }
            leaf leaf1 {
                type int32;
            }
            leaf leaf2 {
                type int32;
            }
            leaf leaf3 {
                type int32;
            }
            leaf leaf4 {
                type int32;
            }
        }
    }

CLI:

# show route-status route 
Possible completions:
  16rt4  22rt10  36rt6  50rt9  78rt3  84rt1  87rt2  87rt7  93rt8  94rt5  |  <cr>
Possible match completions:
  leaf1  leaf2  leaf3  leaf4

The list contains key values (leaf id):
16rt4 22rt10 36rt6 50rt9 78rt3 84rt1 87rt2 87rt7 93rt8 94rt5

If you choose Possible completions, it will display all elements of the given list entry.

If you choose Possible match completions, it will display the values of selected element in all list entries.

E.g.:

# show route-status route 16rt4
ID     LEAF1  LEAF2  LEAF3  LEAF4  
-----------------------------------
16rt4  8      12     16     20     

# show route-status route leaf1
ID      LEAF1  
---------------
16rt4   8      
22rt10  20     
36rt6   12     
50rt9   18     
78rt3   6      
84rt1   2      
87rt2   4      
87rt7   14     
93rt8   16     
94rt5   10    

Thanks for replying…
My doubt is : Is it possible to give Possible match completion before possible completion or we should give
possible completion first then only we can give possible match completion.

In CLI :

NE# show ab
Possible completions:
1a
2a
| Output modifiers

Possible match completions:
leaf1
leaf2

Is it possible to give possible match completion that is “leaf1” without giving possible completion
“NE# show abc leaf1”
is the above command is correct or need to give possible completion first that is

NE# show abc fan 1a leaf1

Please let me know if my question is not clear…

Thanks.

It should be possible to enter both variants, with different results

show commission equipment fan 1FANSHELF/1 AvailabilityState would display one value of leaf AvailabilityState for list element with key value 1FANSHELF/1.

show commission equipment fan AvailabilityState would display all values of leaf AvailabilityState found in the list fan (across all list elements)

Thanks mnovak for quick response …

Hi Team,

Facing issue while using possible match completion without possible completion :

Let consider data model :

container route-status {
        config false;
        tailf:callpoint routestat;
        list route {
            key id;
            leaf id {
                type string;
            }
            leaf leaf1 {
                type int32;
            }
            leaf leaf2 {
                type int32;
            }
            leaf leaf3 {
                type int32;
            }
            leaf leaf4 {
                type int32;
            }
        }
    }

Possible completions:
16rt4 22rt10 36rt6 50rt9 78rt3 84rt1 87rt2 87rt7 93rt8 94rt5 |
Possible match completions:
leaf1 leaf2 leaf3 leaf4

=> if I am using possible match completion directly without possible completion getting error

NE #show route-status route leaf1
it is expecting possible completion value that is 16rt4,22rt10…

Could be the reason :
I am passing possible completion value to CLI SPEC,then using yang for possible match completion.

=> In Case I am using possible match completion directly it is throwing error

Plese help me out to fix this problem is there any flag that I need to enable to use both the scenarios possible completion
and possible match completion

or it is not possible to use possible completion and possible match completion if passing possible completion values to CLI SPEC

Hello,

can you paste exact error message you are getting?

when you get error, can you check devel.log, confd.log and 'audit.log` if there is more detailed indication
of the error.

It is not fully clear to me what you mean by “I am passing possible completion value to CLI SPEC”. Is it some functionality you have written? (e.g. CLI completion point?) Or is something else?

Hi,

I am gettig the below error message on using possible match completion directly without possible completion :

NE(config)# show route-status route leaf1
%%Given AID [{-1244654366-\ufffd214}] is not valid for [{route}]
NE(config)#

I am passing possible completion value to CLI SPEC : I am using cli spec to show all the leaf of yang.so as to achieve I am passing AID from yang(above error) to cli spec and then cli spec will display all its leaf.

so if without AID(possible completion) I am directly using possible match completion it is throwing error that is
NE(config)# show route-status route leaf1
%%Given AID [{-1244654366-\ufffd214}] is not valid for [{route}]
NE(config)#

as the expected value is AID.

please let me know is there a way to achieve this without passing AID(possible completion) I can directly pass possible match completion.

Thanks.

Hello,

unfortunately the problem is still not fully clear to me? Are there any error messages in the log files?
Please can you describe I am passing possible completion value to CLI SPEC. how do you pass it?
Through clispec completion point? (It is not visible in your example).

is it your code that prints %%Given AID [{-1244654366-\ufffd214}] is not valid for [{route}]?
What is the {-1244654366-\ufffd214}? Is it id of route element?

Hi,

Please find the error log messages below :

D  {[00:03:12] RetrieveMOResponseMessage.cpp:65}errorData = 146683770-\ufffd214\U000249b3*\ufffd\ufffd\ufffd[5S\ufffd:route
Mar 30 16:26:41 Infinera-Linux user.info transaction-app: 11597:NoName         D  {[00:03:12] DTHErrorDetails.cpp:24}inside parameterized DTHErrorDetails constructor
Mar 30 16:26:41 Infinera-Linux user.info transaction-app: 11597:NoName         D  {[00:03:12] DTHErrorDetails.cpp:36}vector size = 2
Mar 30 16:26:41 Infinera-Linux user.info transaction-app: 11597:NoName         D  {[00:03:12] DTHErrorDetails.cpp:46}Error Description = Given AID [{146683770-\ufffd214\U000249b3*\ufffd\ufffd\ufffd[
5S\ufffd
Mar 30 16:26:41 Infinera-Linux user.info transaction-app: 11597:NoName         D  {[00:03:12] DTHErrorDetails.cpp:46}Error Description = Given AID [{146683770-\ufffd214\U000249b3*\ufffd\ufffd\ufffd[
5S\ufffd}] is not valid for [{route
Mar 30 16:26:41 Infinera-Linux user.info transaction-app: 11597:NoName         D  {[00:03:12] DTHErrorDetails.cpp:52}Error Description = Given AID [{146683770-\ufffd214\U000249b3*\ufffd\ufffd\ufffd[
5S\ufffd}] is not valid for [{route}]
Mar 30 16:26:41 Infinera-Linux user.info transaction-app: 11597:NoName         D  {[00:03:12] DTHErrorDetails.cpp:64}inside DTHErrorDetails::errorDescription
Mar 30 16:26:41 Infinera-Linux user.info transaction-app: 11597:NoName         D  {[00:03:12] Executor.cpp:1362}received the error response message from DTH. Description: G
iven AID [{146683770-\ufffd214\U000249b3*\ufffd\ufffd\ufffd[5S\ufffd}] is not valid for [{route}]
Mar 30 16:26:41 Infinera-Linux user.info transaction-app: 11597:NoName         D  {[00:03:12] DTHErrorDetails.cpp:64}inside DTHErrorDetails::errorDescription

In cli Spec :

clispec xmlns="http://tail-f.com/ns/clispec/1.0" style="i"

     cmd name="route" mount="show route-status"
                  callback
           capi
              <cmdpoint>callpoint</cmdpoint>
          /capi
           /callback
      <params mode="choice" min="1" max="1">
                  <param>
                   <type><simpleType namespace="" name="string"><info>     </info></simpleType>
                    </type>
     </param>
     </params>

    </cmd>
</operationalMode>
</clispec>

from yang control comes to clispec “cmd name” that is route and it is consider as argv[0] and AID is agrv[1] and then it call callpoint that will display leaf of yang.

when control flow from yang to cli spec we need AID (in logs expecting AID) so without giving we are getting error.

So, according to above scenario we need to pass AID,it is not possible to skip AID(AID is possible completion,not able to pass directly possible match completion need AID )

Please let know if anything is not clear.

Thanks

Hello, now it is more clear. You are using clispec command with one prameter with C (capi) callback.
The problem that you observe is that you always have to pass parameter value after route command.

I suggest you declare your param as optional

<params>
      <param>
            <type>
                   <simpleType namespace="" name="string">                   
                    </simpleType>
            </type>
           <optional/>
     </param>
</params>

or you may also try to set min to 0

<params mode="choice" min="0" max="1">
       <param>
                   <type><simpleType namespace="" name="string"><info>     </info></simpleType>
                    </type>
     </param>
     </params>

but since you have only one param, I think choice is not so appropriate to use