Eris Linux A.P.I. 0.1
API to access Eris Linux system from a custom container
Loading...
Searching...
No Matches
CONTAINERS

Functions to get informations about containers. More...

Functions

int eris_get_number_of_slots (void)
 Return the maximal number of containers allowed.
int eris_get_container_name (int slot, char *buffer, size_t size)
 Read the name of the container in a given slot.
int eris_get_container_presence (int slot)
 Check if a container is present in a given slot.
int eris_get_container_status (int container, char *buffer, size_t size)
 Get the status of the container in a given slot.
int eris_get_container_version (int container, char *buffer, size_t size)
 Read the version number of the container in a given slot.
int eris_get_container_update_policy (void)
 Read the container update policy.
int eris_set_container_update_policy (int policy)
 Write the container update policy.

Detailed Description

Functions to get informations about containers.

Function Documentation

◆ eris_get_container_name()

int eris_get_container_name ( int slot,
char * buffer,
size_t size )

Read the name of the container in a given slot.

Parameters
slotThe number of the slot hosting the container.
bufferThe buffer to fill with the name.
sizeThe size of the buffer.
Returns
0 on success, -1 on error and errno is set appropriately.

This function fills the buffer with the name of the container currently hosted in the indicated slot. If the slot doesn't host any container, the buffer will be empty.

The name of the container is remotely set by the device manager and can not be modified on the target device.

◆ eris_get_container_presence()

int eris_get_container_presence ( int slot)

Check if a container is present in a given slot.

Parameters
slotThe number of the slot to check.
Returns
1 if a container is present in the slot, 0 if the slot is empty, -1 on error and errno is set appropriately.

◆ eris_get_container_status()

int eris_get_container_status ( int container,
char * buffer,
size_t size )

Get the status of the container in a given slot.

Parameters
slotThe number of the slot hosting the container.
bufferThe buffer to fill with the status.
sizeThe size of the buffer.
Returns
0 on success, -1 on error and errno is set appropriately.

This function fills the buffer with the status of the container currently hosted in the indicated slot. If the slot doesn't host any container, the buffer will be empty.

The status is one of the following strings: running or stopped.

◆ eris_get_container_update_policy()

int eris_get_container_update_policy ( void )

Read the container update policy.

Return values
0Update container content only after system reboot.
1Immediate restart of container after content update.
-1An error has occured during the request, errno is set appropriately.

When an update is available for the content of a container, the new content can be installed immediately and the container can be restarted as soon as possible. Alternatively, we can keep the current container running until the system is rebooted.

◆ eris_get_container_version()

int eris_get_container_version ( int container,
char * buffer,
size_t size )

Read the version number of the container in a given slot.

Parameters
slotThe number of the slot hosting the container.
bufferThe buffer to fill with the version number.
sizeThe size of the buffer.
Returns
0 on success, -1 on error and errno is set appropriately.

This function fills the buffer with the version number of the container currently hosted in the indicated slot. If the slot doesn't host any container, the buffer will be empty.

The version of the container is remotely set by the device manager and can not be modified from the target.

◆ eris_get_number_of_slots()

int eris_get_number_of_slots ( void )

Return the maximal number of containers allowed.

Returns
The number of container slots in the system.

A slot, numbered from 0 to number-of-slots - 1, can receive a container.

◆ eris_set_container_update_policy()

int eris_set_container_update_policy ( int policy)

Write the container update policy.

Parameters
policy1 (immediate update and restart), 0 (update at system reboot).
Returns
0 on success or -1 on error and errno is set appropriately.

When an update is available for the content of a container, the new content can be installed immediately and the container can be restarted as soon as possible. Alternatively, we can keep the current container running until the system is rebooted.