API Reference
__main__
IoT Health CLI Entry.
bin
cli
IoT Health CLI.
cameras()
Command for the cameras info.
Source code in iothealth/bin/cli.py
64 65 66 67 |
|
capacity()
Command for the device capacity.
Source code in iothealth/bin/cli.py
52 53 54 55 |
|
cli()
CLI entry point.
Source code in iothealth/bin/cli.py
10 11 12 13 |
|
main()
Entry point for the CLI.
Source code in iothealth/bin/cli.py
81 82 83 |
|
memory()
Command for the memory info.
Source code in iothealth/bin/cli.py
46 47 48 49 |
|
os_info()
Command for OS info.
Source code in iothealth/bin/cli.py
34 35 36 37 |
|
platform()
Command for platform info.
Source code in iothealth/bin/cli.py
22 23 24 25 |
|
processor_arch()
Command for the CPU info.
Source code in iothealth/bin/cli.py
28 29 30 31 |
|
processors()
Command for processors info.
Source code in iothealth/bin/cli.py
40 41 42 43 |
|
summary()
Command for the health summary.
Source code in iothealth/bin/cli.py
16 17 18 19 |
|
temperature()
Command for the device temperature.
Source code in iothealth/bin/cli.py
58 59 60 61 |
|
device_health
IoT Health.
DeviceHealth
Bases: BaseHealth
Generic class for a device health info.
Source code in iothealth/device_health.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
cameras()
classmethod
Provide the cameras info.
Source code in iothealth/device_health.py
72 73 74 75 |
|
capacity()
classmethod
Provide the device disk usage info.
Source code in iothealth/device_health.py
60 61 62 63 |
|
device_platform()
classmethod
Provide the device platform info.
Source code in iothealth/device_health.py
30 31 32 33 |
|
memory()
classmethod
Provide the device memory info.
Source code in iothealth/device_health.py
54 55 56 57 |
|
operating_system()
classmethod
Provide the device OS info.
Source code in iothealth/device_health.py
42 43 44 45 |
|
processor_architecture()
classmethod
Provide the device CPU info.
Source code in iothealth/device_health.py
36 37 38 39 |
|
processors()
classmethod
Provice the device processors info.
Source code in iothealth/device_health.py
48 49 50 51 |
|
summary()
classmethod
Provide the health information for the current device.
Returns
dict
All the available health information as a key-value dictionary.
Source code in iothealth/device_health.py
18 19 20 21 22 23 24 25 26 27 |
|
temperature()
classmethod
Provide the device temperature.
Source code in iothealth/device_health.py
66 67 68 69 |
|
linux
General Linux health info on x86 platform.
Linux
Bases: BaseHealth
Health information for general Linux devices.
Source code in iothealth/linux.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
|
cameras()
classmethod
Provide cameras information.
Source code in iothealth/linux.py
175 176 177 178 |
|
capacity()
classmethod
Get the current disk capacity usage in bytes.
Returns
dict
Usages returned as a dictionary
with keys total
, available
,
and used
.
Source code in iothealth/linux.py
134 135 136 137 138 139 140 141 142 143 144 145 |
|
device_platform()
classmethod
Get the system information.
Returns
str
An empty string is returned if the platform is unknown.
Otherwise, return the device platform info.
Source code in iothealth/linux.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
memory()
classmethod
Get virtual memory usage in bytes.
Returns
dict
Usages returned as a dictionary
with keys total
, available
,
and used
.
Source code in iothealth/linux.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
operating_system()
classmethod
Get the OS info.
Returns
str
An empty string is returned if the OS is unknown.
Otherwise, return the processor type, e.g., Linux
.
Source code in iothealth/linux.py
49 50 51 52 53 54 55 56 57 58 59 |
|
processor_architecture()
classmethod
Get the processor architecture.
Returns
str
An empty string is returned if the processor architecture is
unknown. Otherwise, return the processor type, e.g., x86_64
.
Source code in iothealth/linux.py
36 37 38 39 40 41 42 43 44 45 46 |
|
processors()
classmethod
Get the detail processor information as JSON format.
Returns
dict
The detail information is as the following format:
.. code-block:: JSON
{
"physical_cores": 4,
"total_cores": 4,
"max_frequency": 1400.00,
"min_frequency": 600.00,
"current_frequency": 1400.00,
"usage_per_core": [
{
"core": 0,
"usage": 0.2
},
{
"core": 1,
"usage": 0.0
},
{
"core": 2,
"usage": 0.0
},
{
"core": 3,
"usage": 0.0
}
],
"total_usage": 0.1
}
Source code in iothealth/linux.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
temperature()
classmethod
Provide the device temperature.
Source code in iothealth/linux.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
raspberry_pi
Raspberry Pi health information.
RaspberryPi
Bases: Linux
Check Raspberry Pi health and status.
Source code in iothealth/raspberry_pi.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
cameras()
classmethod
Provide the cameras info.
Source code in iothealth/raspberry_pi.py
71 72 73 74 |
|
device_platform()
classmethod
Get the IoT device platform.
Returns
str
An empty string is returned if the platform is unknown.
Otherwise, return the device platform info, e.g.,
Raspberry Pi 3 Model B Plus Rev 1.3
.
Source code in iothealth/raspberry_pi.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
temperature()
classmethod
Get the device's temperature.
Returns
float The device temperature, e.g., 54.8. The temperature unit is Celsius.
Raises
RuntimeError
Raised if the temperature info is not available.
Source code in iothealth/raspberry_pi.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|