This week I was working on basic modules of the REST api. Values are logically grouped in different modules. Each module collects its values, and the code from last week takes care of user management and parsing the values to JSON. I have also documented the REST api interface with descriptions of all values that are currently available.
Modules that I have developed:
- memory - info about memory and swap usage
- cpu - info about cpu usage, load average, uptime and temperature
- network - info about available network interfaces, their IP, MAC addresses and number of bytes/packets send and received on each interface
- storage - info about mounted devices, used space on device and throughput read and write info
I spent quiet some time developing code for gathering network device information, so I wrote a short guide with code for anyone interested: Get IP, IPv6 and MAC addresses using ioctl and procfs on Linux in C.
Code is on github.
Work by days:
- Implemented memory module.
- Added buffer function for modules
- Removed buffer function and restructured parsing code.
- Created CPU module
- Created network module
- Added duda_request_t as argument to module’s get_value function.
- Added iface filter to network module
- Listing of modules when accessing /api/
- 29.5.2014 - Added listing of ip, mac and ipv6 addresses to network module
- Created storage module
- Documentation for the REST api