ConfD User Community

How to hide an action's output leaf name


#1

Hi,
We have implemented an action set for ping.
The output has a leaf called response.
But when triggering ping CLI in confd, the out put always contains “response”.
Can we have a way to remove the “response” from the ping output?

container ping {
tailf:action set {
  tailf:exec "/usr/lib/siara/bin/ping.pl" {
  }
  input {
    leaf destination {
      type inet:ipv4-address;
    }
    leaf count {
      type int32;
      default "3";
    }
  }
  output {
    leaf response {
      type string;
    }
  }
}

}

R1# ping set count 1 destination 192.168.56.33
response PING 192.168.56.33 (192.168.56.33): source 192.168.56.133, 36 data bytes,

response timeout is 1 second

response .

response

response ----192.168.56.33 PING Statistics----

response 1 packets transmitted, 0 packets received, 100.0% packet loss


#2

I don’t think so, not with actions.

If you have only one leaf in the output-statement and collect the complete output from the ping-command into one single string, you can have something like this:

admin@confd> request config host localhost ping
one-leaf PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from confd.vm (127.0.0.1): icmp_seq=1 ttl=64 time=0.016 ms
64 bytes from confd.vm (127.0.0.1): icmp_seq=2 ttl=64 time=0.023 ms
64 bytes from confd.vm (127.0.0.1): icmp_seq=3 ttl=64 time=0.033 ms

— localhost ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.016/0.024/0.033/0.007 ms

[ok][2016-09-22 19:41:50]
admin@confd>

You can’t avoid the name of leaf in the output but you avoid the rest of the structure.


#3

output {
leaf response {
tailf:alt-name “”;
type string;
}
}

This works.