Newer
Older
It exposes the SoftwareModules datamodel objectes over ubus. The `swmodd` registers `swmodules` namespaces with ubus, that has the shown below functionalities:
```bash
root@iopsys:~# ubus -v list swmodules
'swmodules' @19113d4c
"ee_list":{}
"reload":{}
"du_list":{"eeid":"Integer","ee_name":"String"}
"eu_list":{"eeid":"Integer","ee_name":"String"}
"du_install":{"eeid":"Integer","ee_name":"String","uuid":"String","url":"String","username":"String","password":"String"}
"du_update":{"eeid":"Integer","ee_name":"String","uuid":"String","url":"String","username":"String","password":"String"}
"du_uninstall":{"eeid":"Integer","ee_name":"String","du_name":"String"}
"eu_set_state":{"eeid":"Integer","ee_name":"String","eu_name":"String","state":"Boolean"}
"ee_set_state":{"eeid":"Integer","ee_name":"String","state":"String"}
root@iopsys:~#
```
For more info on the `swmodules` ubus schema see [link](../api/ubus/swmodules.md) or [raw schema](../../schemas/ubus/swmodules.json)
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
## swmodd ubus examples
The outputs shown below are just an example, it can vary on each system. Long outputs are truncated to beautify the document.
### List down the available execution environments
```bash
root@iopsys:~# ubus call swmodules ee_list
{
"environment": [
{
"ee_name": "OpenWRT_Linux",
"eeid": 1,
"status": "Up",
"pause": 0,
"autoboot": 1,
"type": "Virtual_EE",
"vendor": "iopsys-eca940fff680",
"version": "4.19.235",
"allocated_disk_space": 27632,
"available_disk_space": 26716,
"allocated_memory": 1014988,
"available_memory": 476840,
"parent_ee_ref": 0
}
]
}
root@iopsys:~#
```
### Install new application container as deployment unit
This requires support to pull images from container registry.
```bash
root@iopsys:~# ubus call swmodules du_install '{"url":"docker://httpd:latest"}'
{
"status": true
}
root@iopsys:~#
```
### List available deployment units/installed services
```bash
root@iopsys:~# ubus call swmodules du_list
{
"deployment_unit": [
{
"du_name": "httpd",
"ee_name": "OpenWRT_Linux",
"eeid": 1,
"uuid": "347dd4bf-6b51-4d62-be61-77c8ded98698",
"duid": "w0t0000",
"url": "docker://httpd:latest",
"version": "",
"config": "",
"description": "",
"du_status": "Installed",
"eu_name": "httpd",
"vendor": ""
}
]
}
root@iopsys:~#
```
### List execution units/running services
```bash
root@iopsys:~# ubus call swmodules eu_list
{
"execution_unit": [
{
"eu_name": "httpd",
"command": "",
"state": "Active",
"config": "",
"version": "4.19.235",
"description": "This is a CRUN container",
"ee_name": "OpenWRT_Linux",
"eeid": 1,
"euid": "22728",
"disk_space": 91840,
"memory_space": 1014988,
"vendor": "umoci-default",
"req_state": "Active",
"autostart": true,
"du_name": "httpd"
}
]
}
```