fix Maven Archetype doc
[docs.git] / docs / developer-guide / distribution-version.rst
1 .. _dist-version:
2
3 Distribution Version reporting
4 ==============================
5
6 Overview
7 --------
8
9 This section provides an overview of **odl-distribution-version** feature.
10
11 A remote user of OpenDaylight usually has access to RESTCONF and NETCONF
12 northbound interfaces, but does not have access to the system
13 OpenDaylight is running on. OpenDaylight has released multiple versions
14 including Service Releases, and there are incompatible changes between them.
15 In order to know which YANG modules to use, which bugs to expect
16 and which workarounds to apply, such user would need to know the exact version
17 of at least one OpenDaylight component.
18
19 There are indirect ways to deduce such version, but the direct way is enabled
20 by odl-distribution-version feature. Administrator can specify version strings,
21 which would be available to users via NETCONF, or via RESTCONF
22 if OpenDaylight is configured to initiate NETCONF connection
23 to its config subsystem northbound interface.
24
25 By default, users have write access to config subsystem,
26 so they can add, modify or delete any version strings present there.
27 Admins can only influence whether the feature is installed, and initial values.
28
29 Config subsystem is local only, not cluster aware,
30 so each member reports versions independently. This is suitable for heterogeneous clusters.
31 On homogeneous clusters, make sure you set and check every member.
32
33 Key APIs and Interfaces
34 -----------------------
35
36 Current implementation relies heavily on ``config-parent`` parent POM file from Controller project.
37
38 YANG model for config subsystem
39 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40
41 Throughout this chapter, *model* denotes YANG module, and *module* denotes item
42 in config subsystem module list.
43
44 Version functionality relies on config subsystem and its ``config`` YANG model.
45 The YANG model ``odl-distribution-version`` adds an identity ``odl-version``
46 and augments ``/config:modules/module/configuration`` adding new case for ``odl-version`` type.
47 This case contains single leaf ``version``, which would hold the version string.
48
49 Config subsystem can hold multiple modules, the version string should contain
50 version of OpenDaylight component corresponding to the module name.
51 As this is pure metadata with no consequence on OpenDaylight behavior,
52 there is no prescribed scheme for chosing config module names.
53 But see the default configuration file for examples.
54
55 Java API
56 ~~~~~~~~
57
58 Each config module needs to come with java classes which override ``customValidation()``
59 and ``createInstance()``. Version related modules have no impact on OpenDaylight internal behavior,
60 so the methods return void and dummy closeable respectively, without any side effect.
61
62 Default config file
63 ~~~~~~~~~~~~~~~~~~~
64
65 Initial version values are set via config file ``odl-version.xml`` which is created in
66 ``$KARAF_HOME/etc/opendaylight/karaf/`` upon installation of ``odl-distribution-version`` feature.
67 If admin wants to use different content, the file with desired content has to be created
68 there before feature installation happens.
69
70 By default, the config file defines two config modules, named ``odl-distribution-version``
71 and ``odl-odlparent-version``.
72
73 Currently the default version values are set to Maven property strings
74 (as opposed to valid values), as the needed new functionality did not make it
75 into Controller project in Boron. See Bug number 6003.
76
77 Karaf Feature
78 ~~~~~~~~~~~~~
79
80 The ``odl-distribution-version`` feature is currently the only feature defined
81 in feature repository of artifactId ``features-distribution``,
82 which is available (transitively) in OpenDaylight Karaf distribution.
83
84 RESTCONF usage
85 ~~~~~~~~~~~~~~
86
87 Opendaylight config subsystem NETCONF northbound is not made available just by installing
88 ``odl-distribution-version``, but most other feature installations would enable it.
89 RESTCONF interfaces are enabled by installing ``odl-restconf`` feature,
90 but that do not allow access to config subsystem by itself.
91
92 On single node deployments, installation of ``odl-netconf-connector-ssh`` is recommended,
93 which would configure ``controller-config`` device and its MD-SAL mount point.
94 See documentation for clustering on how to create similar devices for member modes,
95 as ``controller-config`` name is not unique in that context.
96
97 Assuming single node deployment and user located on the same system,
98 here is an example ``curl`` command accessing ``odl-odlparent-version`` config module:
99
100 .. code:: bash
101
102     curl 127.0.0.1:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-distribution-version:odl-version/odl-odlparent-version
103