edgehog-device-manager / edgehog-device-runtime

Edgehog Device Runtime is a portable middleware written in Rust, that enables remote device management on Linux-based systems.
Apache License 2.0
11 stars 10 forks source link

[Docker] Create container request #280

Open joshuachp opened 11 months ago

joshuachp commented 11 months ago

Create the structure to receive the CreateContainerRequest and publish the AvailableContainers property.

Interfaces

### Create Container Request ```json { "interface_name": "io.edgehog.devicemanager.apps.CreateContainerRequest", "version_major": 0, "version_minor": 1, "type": "datastream", "ownership": "server", "aggregation": "object", "mappings": [ { "endpoint": "/container/id", "type": "string" }, { "endpoint": "/container/hostname", "type": "string" }, { "endpoint": "/container/imageId", "type": "string" }, { "endpoint": "/container/restartPolicy", "type": "string" }, { "endpoint": "/container/env", "type": "stringarray", "doc": "Array of KEY=value environment variables" }, { "endpoint": "/container/binds", "type": "stringarray", "doc": "Array of binds" }, { "endpoint": "/container/networks", "type": "stringarray" }, { "endpoint": "/container/portBindings", "type": "stringarray", "doc": "Array of ip:[host_port:]container_port[/protocol] | [hostPort:]containerPort[/protocol]. protocol is tcp by default" }, { "endpoint": "/container/privileged", "type": "boolean" } ] } ``` ### Available Containers ```json { "interface_name": "io.edgehog.devicemanager.apps.AvailableContainers", "version_major": 0, "version_minor": 1, "type": "properties", "ownership": "device", "mappings": [ { "endpoint": "/%{container_id}/hostname", "type": "string" }, { "endpoint": "/%{container_id}/imageId", "type": "string" }, { "endpoint": "/%{container_id}/restartPolicy", "type": "string" }, { "endpoint": "/%{container_id}/env", "type": "stringarray", "doc": "Array of KEY=value environment variables" }, { "endpoint": "/%{container_id}/binds", "type": "stringarray", "doc": "Array of binds" }, { "endpoint": "/%{container_id}/networks", "type": "stringarray" }, { "endpoint": "/%{container_id}/portBindings", "type": "stringarray", "doc": "Array of ip:[host_port:]container_port[/protocol] | [hostPort:]containerPort[/protocol]. protocol is tcp by default" }, { "endpoint": "/%{container_id}/privileged", "type": "boolean" }, { "endpoint": "/%{container_id}/status", "type": "string" } ] } ```

Container structure

Implements the following commands and functionalities for the container: