Tailf:link to a different module

Let’s say I have:

a-module.yang:

module a-module {
    container a-cont {
        leaf a-leaf {
            type uint32;
        }
    }
}

and
b-module.yang:

module b-module {
    container b-cont {
        leaf b-leaf {
            tailf:link "/a-module/a-cont/a-leaf";
            type uint32;
        }
    }
}

Is there a way to create a link between two different .yang modules?

Thanks

Hi Yogev,

Just as you refer to tailf-common.yang with tailf:link using import and prefix, you refer to your a-module in your use case:

a-module.yang:

module a-module {
    namespace "http://tail-f.com/ns/example/linked-to";
    prefix a;
    container a-cont {
        leaf a-leaf {
            type uint32;
        }
    }
}

b-module.yang:

module b-module {
    namespace "http://tail-f.com/ns/example/linked-from";
    prefix b;
    import tailf-common { prefix tailf; }
    import a-module { prefix a; }
    container b-cont {
        leaf b-leaf {
            tailf:link "/a:a-cont/a-leaf";
            type uint32;
        }
    }
}
1 Like

I tried that, but mistakenly confused between the module name and the prefix,
Thanks