Multiple daemons listening to a command

I have two daemons ‘A’ and ‘B’ from which i want to pull some common data. how can i design yang model for this.

Daemon ‘A’: Data ‘X’
Daemon ‘B’: Data ‘Y’

$ show daemon ‘A’ data // should show data ‘X’
$ show daemon ‘B’ data // should show data ‘Y’
$ show daemon data // should show both data ‘X’ and ‘Y’

See RFC7950 and the ConfD training videos for YANG references.

You can try something like this:

list daemon {
  key name;
  leaf name {
    type string;
  }
  leaf data {
    type string;
  }
}

# show running-config daemon data

daemon A
 data X
!
daemon B
 data Y
!