diff --git a/docs/api/swmodules.md b/docs/api/swmodules.md new file mode 100644 index 0000000000000000000000000000000000000000..292d2691d73beb1117372d0f1f90b506f98d3134 --- /dev/null +++ b/docs/api/swmodules.md @@ -0,0 +1,930 @@ +# swmodules Schema + +``` +https://dev.iopsys.eu/iopsys/swmodd/schemas/ubus/swmodules.json +``` + +| Custom Properties | Additional Properties | +| ----------------- | --------------------- | +| Forbidden | Forbidden | + +# swmodules + +| List of Methods | +| ----------------------------- | +| [du_install](#du_install) | Method | swmodules (this schema) | +| [du_list](#du_list) | Method | swmodules (this schema) | +| [du_uninstall](#du_uninstall) | Method | swmodules (this schema) | +| [du_update](#du_update) | Method | swmodules (this schema) | +| [environment](#environment) | Method | swmodules (this schema) | +| [eu_list](#eu_list) | Method | swmodules (this schema) | + +## du_install + +### Install new deployment units/packages into Execution environment + +`du_install` + +- type: `Method` + +### du_install Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ------ | ------------ | +| `input` | object | **Required** | +| `output` | object | Optional | + +#### input + +`input` + +- is **required** +- type: `object` + +##### input Type + +`object` with following properties: + +| Property | Type | Required | +| ------------- | ------ | ------------ | +| `environment` | string | Optional | +| `password` | string | Optional | +| `url` | string | **Required** | +| `username` | string | Optional | +| `uuid` | string | Optional | + +#### environment + +`environment` + +- is optional +- type: `string` + +##### environment Type + +`string` + +#### password + +`password` + +- is optional +- type: `string` + +##### password Type + +`string` + +#### url + +`url` + +- is **required** +- type: `string` + +##### url Type + +`string` + +#### username + +`username` + +- is optional +- type: `string` + +##### username Type + +`string` + +#### uuid + +`uuid` + +- is optional +- type: `string` + +##### uuid Type + +`string` + +### Ubus CLI Example + +``` +ubus call swmodules du_install {"url":"nostrud aliqua","uuid":"nulla ipsum dolor enim","username":"in aliqua cillum","password":"ea in eiusmod ut","environment":"cillum non et anim aliqua"} +``` + +### JSONRPC Example + +```json +{ + "jsonrpc": "2.0", + "id": 0, + "method": "call", + "params": [ + "<SID>", + "swmodules", + "du_install", + { + "url": "nostrud aliqua", + "uuid": "nulla ipsum dolor enim", + "username": "in aliqua cillum", + "password": "ea in eiusmod ut", + "environment": "cillum non et anim aliqua" + } + ] +} +``` + +#### output + +`output` + +- is optional +- type: `object` + +##### output Type + +`object` with following properties: + +| Property | Type | Required | +| --------- | ------- | ------------ | +| `name` | string | Optional | +| `status` | boolean | **Required** | +| `version` | string | Optional | + +#### name + +`name` + +- is optional +- type: `string` + +##### name Type + +`string` + +#### status + +`status` + +- is **required** +- type: `boolean` + +##### status Type + +`boolean` + +#### version + +`version` + +- is optional +- type: `string` + +##### version Type + +`string` + +### Output Example + +```json +{ "status": true, "name": "et Duis ipsum fugiat", "version": "ullamco consequat" } +``` + +## du_list + +### Get list of deployment units (installed packages) + +`du_list` + +- type: `Method` + +### du_list Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ------ | -------- | +| `input` | object | Optional | +| `output` | object | Optional | + +#### input + +`input` + +- is optional +- type: `object` + +##### input Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ---- | -------- | +| None | None | None | + +### Ubus CLI Example + +``` +ubus call swmodules du_list {} +``` + +### JSONRPC Example + +```json +{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["<SID>", "swmodules", "du_list", {}] } +``` + +#### output + +`output` + +- is optional +- type: `object` + +##### output Type + +`object` with following properties: + +| Property | Type | Required | +| ---------------- | ----- | -------- | +| `execution_unit` | array | Optional | + +#### execution_unit + +`execution_unit` + +- is optional +- type: `array` + +##### execution_unit Type + +Array type: `array` + +All items must be of the type: Unknown type ``. + +```json +{ + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "duid": { + "type": "string" + }, + "url": { + "type": "string" + }, + "version": { + "type": "string" + }, + "config": { + "type": "string" + }, + "description": { + "type": "string" + }, + "vendor": { + "type": "string" + } + }, + "required": ["name", "environment", "uuid", "duid", "url", "version", "config", "description", "vendor"] + } + ], + "simpletype": "`array`" +} +``` + +### Output Example + +```json +{ + "execution_unit": [ + { + "name": "sint dolore", + "environment": "Ut Excepteur nisi", + "uuid": "ea in", + "duid": "ea Ut ad aliqua do", + "url": "enim minim voluptate nisi nulla", + "version": "ut fugiat proident", + "config": "in", + "description": "ullamco anim", + "vendor": "do" + } + ] +} +``` + +## du_uninstall + +### Uninstall installed deployment units/packages + +`du_uninstall` + +- type: `Method` + +### du_uninstall Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ------ | ------------ | +| `input` | object | **Required** | +| `output` | object | Optional | + +#### input + +`input` + +- is **required** +- type: `object` + +##### input Type + +`object` with following properties: + +| Property | Type | Required | +| ------------- | ------ | ------------ | +| `environment` | string | Optional | +| `name` | string | **Required** | + +#### environment + +`environment` + +- is optional +- type: `string` + +##### environment Type + +`string` + +#### name + +`name` + +- is **required** +- type: `string` + +##### name Type + +`string` + +### Ubus CLI Example + +``` +ubus call swmodules du_uninstall {"name":"incididunt ex minim","environment":"sit dolor tempor in aliqua"} +``` + +### JSONRPC Example + +```json +{ + "jsonrpc": "2.0", + "id": 0, + "method": "call", + "params": [ + "<SID>", + "swmodules", + "du_uninstall", + { "name": "incididunt ex minim", "environment": "sit dolor tempor in aliqua" } + ] +} +``` + +#### output + +`output` + +- is optional +- type: `object` + +##### output Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ------- | -------- | +| `status` | boolean | Optional | + +#### status + +`status` + +- is optional +- type: `boolean` + +##### status Type + +`boolean` + +### Output Example + +```json +{ "status": true } +``` + +## du_update + +### Update already installed deployment units + +`du_update` + +- type: `Method` + +### du_update Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ------ | ------------ | +| `input` | object | **Required** | +| `output` | object | Optional | + +#### input + +`input` + +- is **required** +- type: `object` + +##### input Type + +`object` with following properties: + +| Property | Type | Required | +| ---------- | ------ | ------------ | +| `password` | string | Optional | +| `url` | string | **Required** | +| `username` | string | Optional | +| `uuid` | string | **Required** | + +#### password + +`password` + +- is optional +- type: `string` + +##### password Type + +`string` + +#### url + +`url` + +- is **required** +- type: `string` + +##### url Type + +`string` + +#### username + +`username` + +- is optional +- type: `string` + +##### username Type + +`string` + +#### uuid + +`uuid` + +- is **required** +- type: `string` + +##### uuid Type + +`string` + +### Ubus CLI Example + +``` +ubus call swmodules du_update {"url":"mollit pariatur ullamco commodo","uuid":"dolore magna deserunt","username":"Duis eiusmod","password":"consequat"} +``` + +### JSONRPC Example + +```json +{ + "jsonrpc": "2.0", + "id": 0, + "method": "call", + "params": [ + "<SID>", + "swmodules", + "du_update", + { + "url": "mollit pariatur ullamco commodo", + "uuid": "dolore magna deserunt", + "username": "Duis eiusmod", + "password": "consequat" + } + ] +} +``` + +#### output + +`output` + +- is optional +- type: `object` + +##### output Type + +`object` with following properties: + +| Property | Type | Required | +| ------------- | ------- | ------------ | +| `environment` | string | Optional | +| `name` | string | Optional | +| `status` | boolean | **Required** | +| `uuid` | string | Optional | +| `version` | string | Optional | + +#### environment + +`environment` + +- is optional +- type: `string` + +##### environment Type + +`string` + +#### name + +`name` + +- is optional +- type: `string` + +##### name Type + +`string` + +#### status + +`status` + +- is **required** +- type: `boolean` + +##### status Type + +`boolean` + +#### uuid + +`uuid` + +- is optional +- type: `string` + +##### uuid Type + +`string` + +#### version + +`version` + +- is optional +- type: `string` + +##### version Type + +`string` + +### Output Example + +```json +{ + "status": true, + "name": "incididunt irure Duis", + "version": "nulla exercit", + "uuid": "quis magna irure", + "environment": "sint enim deserunt quis" +} +``` + +## environment + +### Get list of available environments for software modules + +`environment` + +- type: `Method` + +### environment Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ------ | ------------ | +| `input` | object | Optional | +| `output` | object | **Required** | + +#### input + +`input` + +- is optional +- type: `object` + +##### input Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ---- | -------- | +| None | None | None | + +### Ubus CLI Example + +``` +ubus call swmodules environment {} +``` + +### JSONRPC Example + +```json +{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["<SID>", "swmodules", "environment", {}] } +``` + +#### output + +`output` + +- is **required** +- type: `object` + +##### output Type + +`object` with following properties: + +| Property | Type | Required | +| ------------- | ----- | -------- | +| `environment` | array | Optional | + +#### environment + +`environment` + +- is optional +- type: `array` + +##### environment Type + +Array type: `array` + +All items must be of the type: Unknown type ``. + +```json +{ + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "version": { + "type": "string" + }, + "allocated_disk_space": { + "type": "integer", + "minimum": 0 + }, + "available_disk_space": { + "type": "integer", + "minimum": 0 + }, + "allocated_memory": { + "type": "integer", + "minimum": 0 + }, + "available_memory": { + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "name", + "status", + "type", + "vendor", + "version", + "allocated_disk_space", + "available_disk_space", + "allocated_memory", + "available_memory" + ] + } + ], + "simpletype": "`array`" +} +``` + +### Output Example + +```json +{ + "environment": [ + { + "name": "sunt velit eiusmod", + "status": "ut dolor ut", + "type": "deserunt fugiat ea", + "vendor": "ipsum irure", + "version": "veniam laboris", + "allocated_disk_space": 70947665, + "available_disk_space": 868904, + "allocated_memory": 40901874, + "available_memory": 61168718 + } + ] +} +``` + +## eu_list + +### Get list of execution units (running packages) + +`eu_list` + +- type: `Method` + +### eu_list Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ------ | -------- | +| `input` | object | Optional | +| `output` | object | Optional | + +#### input + +`input` + +- is optional +- type: `object` + +##### input Type + +`object` with following properties: + +| Property | Type | Required | +| -------- | ---- | -------- | +| None | None | None | + +### Ubus CLI Example + +``` +ubus call swmodules eu_list {} +``` + +### JSONRPC Example + +```json +{ "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["<SID>", "swmodules", "eu_list", {}] } +``` + +#### output + +`output` + +- is optional +- type: `object` + +##### output Type + +`object` with following properties: + +| Property | Type | Required | +| ---------------- | ----- | -------- | +| `execution_unit` | array | Optional | + +#### execution_unit + +`execution_unit` + +- is optional +- type: `array` + +##### execution_unit Type + +Array type: `array` + +All items must be of the type: Unknown type ``. + +```json +{ + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "command": { + "type": "string" + }, + "config": { + "type": "string" + }, + "version": { + "type": "string" + }, + "description": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "euid": { + "type": "integer", + "minimum": 0 + }, + "disk_space": { + "type": "integer", + "minimum": 0 + }, + "memory_space": { + "type": "integer", + "minimum": 0 + }, + "vendor": { + "type": "string" + } + }, + "required": [ + "name", + "command", + "config", + "version", + "description", + "environment", + "euid", + "disk_space", + "memory_space", + "vendor" + ] + } + ], + "simpletype": "`array`" +} +``` + +### Output Example + +```json +{ + "execution_unit": [ + { + "name": "Ut", + "command": "labore dolor fugiat veniam incididunt", + "config": "adipisicing tempor", + "version": "officia ", + "description": "incididunt sed dolore", + "environment": "mollit laboris ea commodo consectetu", + "euid": 75690020, + "disk_space": 80559588, + "memory_space": 11981129, + "vendor": "dolor" + } + ] +} +``` diff --git a/schemas/ubus/swmodules.json b/schemas/ubus/swmodules.json new file mode 100644 index 0000000000000000000000000000000000000000..48a24ccf6d036b6cfd69bd247695322143016d4e --- /dev/null +++ b/schemas/ubus/swmodules.json @@ -0,0 +1,382 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://dev.iopsys.eu/iopsys/swmodd/schemas/ubus/swmodules.json", + "type": "object", + "title": "swmodules", + "object": "swmodules", + "additionalProperties": false, + "properties": { + "environment": { + "title": "Get list of available environments for software modules", + "type": "object", + "properties": { + "input": { + "type": "object", + "properties": {} + }, + "output": { + "type": "object", + "properties": { + "environment": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "version": { + "type": "string" + }, + "allocated_disk_space": { + "type": "integer", + "minimum": 0 + }, + "available_disk_space": { + "type": "integer", + "minimum": 0 + }, + "allocated_memory": { + "type": "integer", + "minimum": 0 + }, + "available_memory": { + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "name", + "status", + "type", + "vendor", + "version", + "allocated_disk_space", + "available_disk_space", + "allocated_memory", + "available_memory" + ] + } + ] + } + } + } + }, + "required": [ + "output" + ] + }, + "eu_list": { + "title": "Get list of execution units (running packages)", + "type": "object", + "properties": { + "input": { + "type": "object", + "properties": {} + }, + "output": { + "type": "object", + "properties": { + "execution_unit": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "command": { + "type": "string" + }, + "config": { + "type": "string" + }, + "version": { + "type": "string" + }, + "description": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "euid": { + "type": "integer", + "minimum": 0 + }, + "disk_space": { + "type": "integer", + "minimum": 0 + }, + "memory_space": { + "type": "integer", + "minimum": 0 + }, + "vendor": { + "type": "string" + } + }, + "required": [ + "name", + "command", + "config", + "version", + "description", + "environment", + "euid", + "disk_space", + "memory_space", + "vendor" + ] + } + ] + } + } + } + } + }, + "du_list": { + "title": "Get list of deployment units (installed packages)", + "type": "object", + "properties": { + "input": { + "type": "object", + "properties": {} + }, + "output": { + "type": "object", + "properties": { + "execution_unit": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "duid": { + "type": "string" + }, + "url": { + "type": "string" + }, + "version": { + "type": "string" + }, + "config": { + "type": "string" + }, + "description": { + "type": "string" + }, + "vendor": { + "type": "string" + } + }, + "required": [ + "name", + "environment", + "uuid", + "duid", + "url", + "version", + "config", + "description", + "vendor" + ] + } + ] + } + } + } + } + }, + "du_install": { + "title": "Install new deployment units/packages into Execution environment", + "type": "object", + "required": [ + "input" + ], + "properties": { + "input": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "environment": { + "type": "string" + } + }, + "required": [ + "url" + ] + }, + "output": { + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "required": [ + "status" + ], + "if": { + "not": { + "properties": { + "status": { + "enum": [ + false + ] + } + } + } + }, + "then": { + "required": [ + "name", + "version" + ] + } + } + } + }, + "du_update": { + "title": "Update already installed deployment units", + "type": "object", + "required": [ + "input" + ], + "properties": { + "input": { + "type": "object", + "properties": { + "uuid": { + "type": "string" + }, + "url": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "url", + "uuid" + ] + }, + "output": { + "type": "object", + "properties": { + "status": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "environment": { + "type": "string" + } + }, + "required": [ + "status" + ], + "if": { + "not": { + "properties": { + "status": { + "enum": [ + false + ] + } + } + } + }, + "then": { + "required": [ + "name", + "version", + "uuid", + "environment" + ] + } + } + } + }, + "du_uninstall": { + "title": "Uninstall installed deployment units/packages", + "type": "object", + "required": [ + "input" + ], + "properties": { + "input": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "environment": { + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "output": { + "type": "object", + "properties": { + "status": { + "type": "boolean" + } + } + } + } + } + } +}