Skip to content
Snippets Groups Projects
swmodules.md 20.5 KiB
Newer Older
Vivek Dutta's avatar
Vivek Dutta committed
# 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) |
| [ee_set_state](#ee_set_state) | Method | swmodules (this schema) |
Vivek Dutta's avatar
Vivek Dutta committed
| [environment](#environment)   | Method | swmodules (this schema) |
| [eu_activate](#eu_activate)   | Method | swmodules (this schema) |
Vivek Dutta's avatar
Vivek Dutta committed
| [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     |
| ------------- | ------- | ------------ |
| `eid`         | integer | Optional     |
| `environment` | string  | Optional     |
| `uuid`        | string  | Optional     |
| `url`         | string  | **Required** |
| `username`    | string  | Optional     |
| `password`    | string  | Optional     |

#### eid

`eid`

- is optional
- type: `integer`

##### eid Type

`integer`
Vivek Dutta's avatar
Vivek Dutta committed

#### 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":"mollit deserunt","uuid":"nulla aliquip eu","username":"amet exe","password":"velit voluptate enim ad in","environment":"sed quis","eid":4}
Vivek Dutta's avatar
Vivek Dutta committed
```

### JSONRPC Example

```json
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "call",
  "params": [
    "<SID>",
    "swmodules",
    "du_install",
    {
      "url": "mollit deserunt",
      "uuid": "nulla aliquip eu",
      "username": "amet exe",
      "password": "velit voluptate enim ad in",
      "environment": "sed quis",
      "eid": 4
Vivek Dutta's avatar
Vivek Dutta committed
    }
  ]
}
```

#### output

`output`

- is optional
- type: `object`

##### output Type

`object` with following properties:

| Property | Type    | Required     |
| -------- | ------- | ------------ |
| `status` | boolean | **Required** |
Vivek Dutta's avatar
Vivek Dutta committed

#### status

`status`

- is **required**
- type: `boolean`

##### status Type

`boolean`

### Output Example

```json
Vivek Dutta's avatar
Vivek Dutta committed
```

## du_list

### Get list of deployment units (installed packages)

`du_list`

- type: `Method`

### du_list Type

`object` with following properties:

| Property | Type   | Required |
Vivek Dutta's avatar
Vivek Dutta committed
| -------- | ------ | -------- |
| `input`  | object | Optional |
| `output` |        | Optional |
Vivek Dutta's avatar
Vivek Dutta committed

#### input

`input`

- is optional
- type: `object`

##### input Type

`object` with following properties:

| Property      | Type    | Required |
| ------------- | ------- | -------- |
| `eid`         | integer | Optional |
| `environment` | string  | Optional |

#### eid

`eid`

- is optional
- type: `integer`

##### eid Type

`integer`

#### environment

`environment`

- is optional
- type: `string`

##### environment Type

`string`
Vivek Dutta's avatar
Vivek Dutta committed

### Ubus CLI Example

```
ubus call swmodules du_list {"eid":6,"environment":"quis exercitation nisi ullamco"}
Vivek Dutta's avatar
Vivek Dutta committed
```

### JSONRPC Example

```json
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "call",
  "params": ["<SID>", "swmodules", "du_list", { "eid": 6, "environment": "quis exercitation nisi ullamco" }]
}
Vivek Dutta's avatar
Vivek Dutta committed
```

#### output

`output`

- is optional
Vivek Dutta's avatar
Vivek Dutta committed

##### output Type

Vivek Dutta's avatar
Vivek Dutta committed

```json
{
Vivek Dutta's avatar
Vivek Dutta committed
    {
      "type": "object",
      "properties": {
        "execution_unit": {
          "type": "array",
          "items": [
            {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "environment": {
                  "type": "string"
                },
                "eid": {
                  "type": "integer",
                  "minimum": 1
                },
                "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"]
            }
          ]
Vivek Dutta's avatar
Vivek Dutta committed
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "execution_unit": {
          "type": "array",
          "items": []
        }
      }
Vivek Dutta's avatar
Vivek Dutta committed
    }
  ],
  "out": "{\"oneof\":[{\"execution_unit\":[{\"name\":\"ea\",\"environment\":\"ullamco pariatur tempor\",\"uuid\":\"nostrud minim\",\"duid\":\"dolor in deserunt velit\",\"url\":\"Excepteur consequat\",\"version\":\"ut in nostrud nulla aliqu\",\"config\":\"qui\",\"description\":\"cillum ea incididunt pa\",\"vendor\":\"sed dolor\",\"eid\":6}]},{\"execution_unit\":[]}]}",
  "simpletype": "complex"
Vivek Dutta's avatar
Vivek Dutta committed
}
```

### Output Example

```json
{
Vivek Dutta's avatar
Vivek Dutta committed
    {
      "execution_unit": [
        {
          "name": "ea",
          "environment": "ullamco pariatur tempor",
          "uuid": "nostrud minim",
          "duid": "dolor in deserunt velit",
          "url": "Excepteur consequat",
          "version": "ut in nostrud nulla aliqu",
          "config": "qui",
          "description": "cillum ea incididunt pa",
          "vendor": "sed dolor",
          "eid": 6
        }
      ]
    },
    { "execution_unit": [] }
Vivek Dutta's avatar
Vivek Dutta committed
  ]
}
```

## 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     |
| ------------- | ------- | ------------ |
| `eid`         | integer | Optional     |
| `environment` | string  | Optional     |
| `name`        | string  | **Required** |

#### eid

`eid`

- is optional
- type: `integer`

##### eid Type

`integer`
Vivek Dutta's avatar
Vivek Dutta committed

#### 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":"est eiusmod culpa commodo","environment":"dolor ad","eid":8}
Vivek Dutta's avatar
Vivek Dutta committed
```

### JSONRPC Example

```json
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "call",
  "params": [
    "<SID>",
    "swmodules",
    "du_uninstall",
    { "name": "est eiusmod culpa commodo", "environment": "dolor ad", "eid": 8 }
Vivek Dutta's avatar
Vivek Dutta committed
  ]
}
```

#### 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     |
| ------------- | ------- | ------------ |
| `eid`         | integer | Optional     |
| `environment` | string  | Optional     |
| `password`    | string  | Optional     |
| `url`         | string  | **Required** |
| `username`    | string  | Optional     |
| `uuid`        | string  | **Required** |

#### eid

`eid`

- is optional
- type: `integer`

##### eid Type

`integer`

#### environment

`environment`

- is optional
- type: `string`

##### environment Type

`string`
Vivek Dutta's avatar
Vivek Dutta committed

#### 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":"officia dolore eiusmod","uuid":"dolor sint","eid":4,"environment":"sit amet ad","username":"aliqua non sit dolore sint","password":"Lorem in ut Duis"}
Vivek Dutta's avatar
Vivek Dutta committed
```

### JSONRPC Example

```json
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "call",
  "params": [
    "<SID>",
    "swmodules",
    "du_update",
    {
      "url": "officia dolore eiusmod",
      "uuid": "dolor sint",
      "eid": 4,
      "environment": "sit amet ad",
      "username": "aliqua non sit dolore sint",
      "password": "Lorem in ut Duis"
Vivek Dutta's avatar
Vivek Dutta committed
    }
  ]
}
```

#### output

`output`

- is optional
- type: `object`

##### output Type

`object` with following properties:

| Property | Type    | Required     |
| -------- | ------- | ------------ |
| `status` | boolean | **Required** |
Vivek Dutta's avatar
Vivek Dutta committed

#### status

`status`

- is **required**
- type: `boolean`

##### status Type

`boolean`

### Output Example

```json
Vivek Dutta's avatar
Vivek Dutta committed
```

## ee_set_state

### Change the current state of the Execution Environment

`ee_set_state`

- type: `Method`

### ee_set_state 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     |
| ------------- | ------- | ------------ |
| `eid`         | integer | Optional     |
| `environment` | string  | Optional     |
| `state`       | string  | **Required** |

#### eid

`eid`

- is optional
- type: `integer`

##### eid Type

`integer`

#### environment

`environment`

- is optional
- type: `string`

##### environment Type

`string`

#### state

`state`

- is **required**
- type: reference

##### state Type

`string`

The value of this property **must** be equal to one of the [known values below](#ee_set_state-known-values).

##### state Known Values

| Value  |
| ------ |
| start  |
| stop   |
| pause  |
| resume |

### Ubus CLI Example

```
ubus call swmodules ee_set_state {"state":"stop","eid":3,"environment":"ea anim veniam minim ut"}
```

### JSONRPC Example

```json
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "call",
  "params": [
    "<SID>",
    "swmodules",
    "ee_set_state",
    { "state": "stop", "eid": 3, "environment": "ea anim veniam minim ut" }
  ]
}
```

#### output

`output`

- is optional
- type: `object`

##### output Type

`object` with following properties:

| Property | Type    | Required     |
| -------- | ------- | ------------ |
| `reason` | string  | **Required** |
| `status` | boolean | **Required** |

#### reason

`reason`

- is **required**
- type: `string`

##### reason Type

`string`

#### status

`status`

- is **required**
- type: `boolean`

##### status Type

`boolean`

### Output Example

```json
{ "status": true, "reason": "ipsum irure id" }
```

Vivek Dutta's avatar
Vivek Dutta committed
## 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"
        },
        "pause": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1
        },
Vivek Dutta's avatar
Vivek Dutta committed
        "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",
Vivek Dutta's avatar
Vivek Dutta committed
        "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",
Vivek Dutta's avatar
Vivek Dutta committed
      "type": "deserunt fugiat ea",
      "vendor": "ipsum irure",
      "version": "veniam laboris",
      "allocated_disk_space": 70947665,
      "available_disk_space": 868904,
      "allocated_memory": 40901874,
      "available_memory": 61168718
    }
  ]
}
```

Vivek Dutta's avatar
Vivek Dutta committed

### Start or stop the execution of an EU
Vivek Dutta's avatar
Vivek Dutta committed

Vivek Dutta's avatar
Vivek Dutta committed

- type: `Method`

Vivek Dutta's avatar
Vivek Dutta committed

`object` with following properties:

| Property | Type   | Required     |
| -------- | ------ | ------------ |
| `input`  | object | **Required** |
| `output` | object | Optional     |
Vivek Dutta's avatar
Vivek Dutta committed

#### input

`input`

Vivek Dutta's avatar
Vivek Dutta committed
- type: `object`

##### input Type

`object` with following properties:

| Property       | Type    | Required     |
| -------------- | ------- | ------------ |
| `eid`          | integer | Optional     |
| `environment`  | string  | Optional     |
| `service_name` | string  | **Required** |
| `state`        | boolean | **Required** |

#### eid

`eid`

- is optional
- type: `integer`

##### eid Type

`integer`

#### environment

`environment`

- is optional
- type: `string`

##### environment Type

`string`

#### service_name

`service_name`

- is **required**
- type: `string`

##### service_name Type

`string`

#### state

`state`

- is **required**
- type: `boolean`

##### state Type

`boolean`
Vivek Dutta's avatar
Vivek Dutta committed

### Ubus CLI Example

```
ubus call swmodules eu_activate {"service_name":"culpa","state":true,"eid":1,"environment":"enim dolore occaecat veniam labore"}
Vivek Dutta's avatar
Vivek Dutta committed
```

### JSONRPC Example

```json
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "call",
  "params": [
    "<SID>",
    "swmodules",
    "eu_activate",
    { "service_name": "culpa", "state": true, "eid": 1, "environment": "enim dolore occaecat veniam labore" }
  ]
}
Vivek Dutta's avatar
Vivek Dutta committed
```

#### output

`output`

- is optional
- type: `object`

##### output Type

`object` with following properties:

| Property | Type    | Required |
| -------- | ------- | -------- |
| `status` | boolean | Optional |
Vivek Dutta's avatar
Vivek Dutta committed

Vivek Dutta's avatar
Vivek Dutta committed

Vivek Dutta's avatar
Vivek Dutta committed

- is optional
Vivek Dutta's avatar
Vivek Dutta committed

Vivek Dutta's avatar
Vivek Dutta committed

Vivek Dutta's avatar
Vivek Dutta committed

### Output Example

```json
{ "status": true }
```

## 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` |        | Optional |

#### input

`input`

- is optional
- type: `object`

##### input Type

`object` with following properties:

| Property      | Type    | Required |
| ------------- | ------- | -------- |
| `eid`         | integer | Optional |
| `environment` | string  | Optional |

#### eid

`eid`

- is optional
- type: `integer`

##### eid Type

`integer`

#### environment

`environment`

- is optional
- type: `string`

##### environment Type

`string`

### Ubus CLI Example

```
ubus call swmodules eu_list {"eid":2,"environment":"eiusmod"}
```

### JSONRPC Example
Vivek Dutta's avatar
Vivek Dutta committed

```json
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "call",
  "params": ["<SID>", "swmodules", "eu_list", { "eid": 2, "environment": "eiusmod" }]
}
```

#### output

`output`

- is optional
- type: complex

##### output Type

Unknown type ``.

```json
{
  "oneof": [
Vivek Dutta's avatar
Vivek Dutta committed
    {
      "type": "object",
      "properties": {
        "execution_unit": {
          "type": "array",
          "items": [
            {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "command": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "config": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "environment": {
                  "type": "string"
                },
                "eid": {
                  "type": "integer",
                  "minimum": 1
                },
                "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"
              ]
            }
          ]
Vivek Dutta's avatar
Vivek Dutta committed
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "execution_unit": {
          "type": "array",
          "items": []
        }
      }
Vivek Dutta's avatar
Vivek Dutta committed
    }
  ],
  "out": "{\"oneof\":[{\"execution_unit\":[{\"name\":\"in est aliqua aliquip\",\"command\":\"proident et \",\"config\":\"reprehenderit nisi qui esse\",\"version\":\"deserunt quis do qui laborum\",\"description\":\"ipsum fugiat non\",\"environment\":\"enim\",\"euid\":18216158,\"disk_space\":13070620,\"memory_space\":67344135,\"vendor\":\"consequat\",\"state\":\"enim sed dolore est elit\",\"eid\":7}]},{\"execution_unit\":[]}]}",
  "simpletype": "complex"
Vivek Dutta's avatar
Vivek Dutta committed
}
```

### Output Example

```json
{
Vivek Dutta's avatar
Vivek Dutta committed
    {
      "execution_unit": [
        {
          "name": "in est aliqua aliquip",
          "command": "proident et ",
          "config": "reprehenderit nisi qui esse",
          "version": "deserunt quis do qui laborum",
          "description": "ipsum fugiat non",
          "environment": "enim",
          "euid": 18216158,
          "disk_space": 13070620,
          "memory_space": 67344135,
          "vendor": "consequat",
          "state": "enim sed dolore est elit",
          "eid": 7
        }
      ]
    },
    { "execution_unit": [] }
Vivek Dutta's avatar
Vivek Dutta committed
  ]
}
```