Ask Your Question
0

what are the implications of ext:context-instance field in yang files?

asked 2014-06-13 11:32:54 -0700

rgowrishankar gravatar image

Hi,

In many of the md-sal yang files related to topology, I see the keyword ext:context-instance. For example in opendaylight-topology.yang: augment "/topo:network-topology/topo:topology" { ext:context-instance "topology-context" }

The ext:context-instance is of argument type and the RFC6020 mentions that it is useful for yin mapping.

Does this have any bearing on the java files generated or the way plugins would use the models? Or is this solely for the future if we decide to support exporting the yang model to xml?

Thanks,

Ramkumar

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-07-01 03:54:06 -0700

Robert Varga gravatar image

updated 2014-07-01 03:54:31 -0700

This is a language extension, defined in the yang-ext.yang module in support of Routed RPCs.

The context-instance defines an instance to which a routed RPC can be attached to. It has to be a list-like item with a key. In the relevant RPC's definition you then use a context-reference which points to the entity tagged with the context-instance.

The MD-SAL runtime then allows you to register a separate provider for each context instance existing in the system and it will examine the key in the RPC's input and invoke the appropriate RPC provider.

This is used, for example in BGPCEP's pcep-topology-provider: there can be multiple instances of the provider, each bound to a single network topology. Aside from populating the topology, the provider instance also services RPCs related to that topology. The model is defined over at https://git.opendaylight.org/gerrit/gitweb?p=bgpcep.git;a=blob plain;f=pcep/topology-api/src/main/yang/network-topology-pcep.yang;hb=HEAD (note the imports and RPC definitions) and the implementation is registered in https://git.opendaylight.org/gerrit/gitweb?p=bgpcep.git;a=blobplain;f=pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPTopologyProvider.java;hb=HEAD (note the create() method).

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2014-06-13 11:32:54 -0700

Seen: 567 times

Last updated: Jul 01 '14