420e9933eee2c855739af66867db8f1532bd8c9c
[docs.git] / docs / developer-guide / eman-developer-guide.rst
1 .. _eman-dev-guide:
2
3 eman Developer Guide
4 ====================
5
6 Overview
7 --------
8
9 The OpenDaylight Energy Management (eman) plugin implements an abstract
10 Information Model that describes energy measurement and control features
11 that may be supported by a variety of device types. The eman plugin may
12 support a number of southbound interfaces to accommodate a set of
13 protocols, including but not limited to SNMP, NETCONF, IPDR. The plugin
14 presents a northbound REST API. This framework enables any number of
15 applications to interoperate with any number of devices in order to
16 measure and optimize energy usage. The Information Model will be
17 inherited from the `SCTE 216 standard – Adaptive Power Systems Interface
18 Specification (APSIS)
19 <http://www.scte.org/SCTEDocs/Standards/ANSI_SCTE%20216%202015.pdf>`_,
20 which in turn inherits definitions within the `IETF eman document set
21 <https://datatracker.ietf.org/wg/eman/documents/>`_.
22
23 This documentation is directed to developers who may use the eman features
24 to build other OpenDaylight features or applications.
25
26 eman is composed of 3 Karaf features:
27     * ``eman`` incudes the YANG model and its implementation
28     * ``eman-api`` adds support for REST
29
30 Developers will typically interface with ``eman-api``.
31
32
33 eman Architecture
34 -----------------
35
36 ``eman`` defines a YANG model that represents the IETF energy management
37 Information Model, and includes RPCs. The implementation of the model
38 currently supports an SNMP 'binding' via interfacing with the
39 OpenDaylight SNMP module. In the future, other Southbound protocols may
40 be supported.
41
42 Developers my use the ``eman-api`` feature to read and write energy
43 related data and commands to devices that support the IETF eman MIBS.
44
45 Key APIs and Interfaces
46 -----------------------
47
48 The eman API currently supports a subset of the IETF eman Information Model,
49 including the EnergyObjectPowerMeasurement table. Users of the API may
50 get individual attributes or the entire table. When querying the table, the
51 results are written into the MD-SAL, for subsequent access. For example,
52 a developer may periodically poll a device for its powerMeasurements,
53 and fetch a collection of measurements to discover a history of measurements.
54
55
56 Operational API
57 ---------------
58
59 Via MD-SAL, the following endpoint provides access to previously
60 captured power measurements.
61
62 .. note::
63   "eo" indicates "energy object" as per the IETF Information Model
64
65 operational::
66
67   eman:eoDevices/eoDevice{id}/eoPowerMeasurement{id}
68
69     id indicates an index into a collection
70
71 EoDevices may contain a collection of individual eoDevice objects, which
72 in turn may contain a collection of eoPowerMeasurement objects
73
74 Operations API
75 --------------
76
77 A set of RPCs enable interactions with devices.
78
79 get-eoAttribute enables query on an individual attribute of a energy object::
80
81   get-eoAttribute
82
83     deviceIP indicates IP address of target device
84     attribute indicates name of requested attribute
85
86 .. note:: Future releases will provide a enumeration of allowed names.
87
88 The supported name are:
89
90 * eoPower
91 * eoPowerNameplate
92 * eoPowerUnitMultiplier
93 * eoPowerAccuracy
94 * eoPowerMeasurementCaliber
95 * eoPowerCurrentType
96 * eoPowerMeasurementLocal
97 * eoPowerAdminState
98 * eoPowerOperState
99 * eoPowerStateEnterReason
100
101 set-eoAttribute enables sending a command to an energy object::
102
103   set-eoAttribute
104
105     deviceIP. IP address of target device
106     attribute. string indicating name of attribute. Currently, no attributes
107
108 get-eoDevicePowerMeasures reads an eoPowerMEasurements table from a device
109 and stores the result in MD-SAL, making it available vie the operational API::
110
111   get-eoDevicePowerMeasures
112
113     deviceIP. IP address of target device
114
115 API Reference Documentation
116 ---------------------------
117
118 See eman project page for additional information:
119 https://wiki.opendaylight.org/view/eman:Main