Network Service¶
The Network Service is a gRPC & Go based network configuration service. The network settings of the Edge Devices are configured through this service.
Table of Contents¶
- Network.proto
- Interface
- Interface.Dns
- Interface.L2
- Interface.L2.AuxiliaryAddressesEntry
- Interface.StaticConf
- NetworkInterfaceRequest
- NetworkInterfaceRequestWithLabel
- NetworkSettings
Network.proto¶
Interface¶
Interface type holds settings for a Network Interface.
Field | Type | Label | Description |
---|---|---|---|
GatewayInterface | bool | if true, route metric will be set to 1. Otherwise route metric is -1. Similarly, when the interface is requested,return value will be true if route metric is 1. | |
MacAddress | string | "20:87:56:b5:ed:e0" | |
DHCP | string | values can be 'enabled' or 'disabled'. for compatiblity reasons it is not boolean. | |
Static | Interface.StaticConf | Static field is StaticConf type instance. | |
DNSConfig | Interface.Dns | DNSConfig is dns type instance. | |
L2Conf | Interface.L2 | ||
InterfaceName | string | Network interface name e.g: "enp2s0" | |
Label | string | Label for the interface e.g: "X1" |
Interface.Dns¶
Type that contains Primary and Secondary DNS.
Field | Type | Label | Description |
---|---|---|---|
PrimaryDNS | string | e.g: "1.1.1.2" | |
SecondaryDNS | string | e.g: "1.1.1.1" |
Interface.L2¶
Field | Type | Label | Description |
---|---|---|---|
StartingAddressIPv4 | string | e.g: 192.168.0.2 | |
NetMask | string | e.g: 255.255.255.0 | |
Range | string | e.g: 16 | |
Gateway | string | e.g: 192.168.2.1 | |
AuxiliaryAddresses | Interface.L2.AuxiliaryAddressesEntry | repeated | Preserved addresses for other devices. These addresses won't be assigned to containers. e.g my_plc, 192.168.0.5 |
Interface.L2.AuxiliaryAddressesEntry¶
Field | Type | Label | Description |
---|---|---|---|
key | string | ||
value | string |
Interface.StaticConf¶
StaticConf type holds IP Netmask and Gateway information
Field | Type | Label | Description |
---|---|---|---|
IPv4 | string | e.g: 192.168.0.2 | |
NetMask | string | e.g: 255.255.255.0 | |
Gateway | string | e.g: 192.168.0.1 |
NetworkInterfaceRequest¶
Contains MAC address, used for retrieving specified Network Interface settings.
Field | Type | Label | Description |
---|---|---|---|
mac | string |
NetworkInterfaceRequestWithLabel¶
Returns an Network Interface with
Field | Type | Label | Description |
---|---|---|---|
label | string |
NetworkSettings¶
Contains multiple network interface settings. It can be used to apply or get the settings.
Field | Type | Label | Description |
---|---|---|---|
Interfaces | Interface | repeated | Network settings contains an array of Interfaces.Applying new settings or receiving current settings is supported for multiple ethernet typed network interfaces supported. |
LabelMap | NetworkSettings.LabelMapEntry | repeated | LabelMap contains port label and corresponding interface-name. e.g key : x1 value: enp2s0 |
NetworkSettings.LabelMapEntry¶
Field | Type | Label | Description |
---|---|---|---|
key | string | ||
value | string |
NetworkService¶
Network service ,uses a UNIX Domain Socket "/var/run/devicemodel/network.sock" for GRPC communication. protoc generates both client and server instance for this Service. GRPC Status codes : https://developers.google.com/maps-booking/reference/grpc-api/status_codes .
Method Name | Request Type | Response Type | Description |
---|---|---|---|
GetAllInterfaces | .google.protobuf.Empty | NetworkSettings | Returns the settings of all ethernet typed network interfaces |
GetInterfaceWithMac | NetworkInterfaceRequest | Interface | Returns the current setting for the interface, with given MAC address. |
GetInterfaceWithLabel | NetworkInterfaceRequestWithLabel | Interface | Returns the current setting for the interface, with given Label. |
ApplySettings | NetworkSettings | .google.protobuf.Empty | Applies given configurations to Network Interfaces. |
Device Info¶
Request Parameter: https://<IP
>/device/edge/api/v2/info
Capabilities
host.networkservice
The Network Service capability enables an app to manage all network-related operations through a REST-based API. This includes applying settings, retrieving all network interfaces, and fetching specific interface details using labels or MAC addresses. The API is authenticated to ensure secure communication between the app and the host system.
By default, this capability is enabled. If it is disabled, no network-related information can be retrieved.
host.systemservice
The System Service capability enables an app to manage all system service-related operations through a REST-based API. This includes applying custom settings, retrieving firmware information, fetching resource statistics, and accessing system logs. The API is authenticated to ensure secure communication between the app and the host system.
By default, all capabilities are set to true
. If the GetFirmwareInfo
capability is set to false
, the corresponding information cannot be retrieved.
API spec can be found here:
Response Parameters with layer-2 enabled
Parameter Name | Data Type | Description |
---|---|---|
deviceId | String | Unique identifier for the device |
deviceName | String | Name of the device |
firmwareVersion | String | Firmware version of the device |
interfaceName | String | Name of the network interface |
ipAddress | String | IP address assigned to the network interface |
subnetMask | String | Subnet mask of the network interface |
gateway | String | Gateway address for the network interface |
macAddress | String | MAC address of the network interface |
l2IPv4 | String | Layer 2 IPv4 address (if applicable) |
l2SubnetMask | String | Layer 2 subnet mask (if applicable) |
l2Gateway | String | Layer 2 gateway address (if applicable) |
Sample response
{
"deviceId": "973ad4260564446bacc93f2918bc6f11",
"deviceName": "INFO",
"networks": [
{
"interfaceName": "ens160",
"ipAddress": "192.168.182.137",
"subnetMask": "255.255.255.0",
"gateway": "192.168.182.2",
"macAddress": "00:0C:29:16:DD:5C"
},
{
"interfaceName": "ens32",
"ipAddress": "192.168.182.139",
"subnetMask": "255.255.255.0",
"gateway": "192.168.182.2",
"macAddress": "00:0C:29:16:DD:70"
},
{
"interfaceName": "ens33",
"ipAddress": "192.168.182.138",
"subnetMask": "255.255.255.0",
"gateway": "192.168.182.2",
"macAddress": "00:0C:29:16:DD:66"
}
],
"firmwareVersion": "ievd-dbg-1.24.0-4-gp"
}
NOTICE
The Layer 2 network information is available only when it is enabled.
Response Parameters without layer-2
Parameter Name | Data Type | Description |
---|---|---|
deviceId | String | Unique identifier for the device |
deviceName | String | Name of the device |
firmwareVersion | String | Firmware version of the device |
interfaceName | String | Name of the network interface |
ipAddress | String | IP address assigned to the network interface |
subnetMask | String | Subnet mask of the network interface |
gateway | String | Gateway address for the network interface |
macAddress | String | MAC address of the network interface |
Sample response
{
"deviceId": "973ad4260564446bacc93f2918bc6f11",
"deviceName": "INFO",
"networks": [
{
"interfaceName": "ens160",
"ipAddress": "192.168.182.137",
"subnetMask": "255.255.255.0",
"gateway": "192.168.182.2",
"macAddress": "00:0C:29:16:DD:5C"
},
{
"interfaceName": "ens32",
"ipAddress": "192.168.182.139",
"subnetMask": "255.255.255.0",
"gateway": "192.168.182.2",
"macAddress": "00:0C:29:16:DD:70"
},
{
"interfaceName": "ens33",
"ipAddress": "192.168.182.138",
"subnetMask": "255.255.255.0",
"gateway": "192.168.182.2",
"macAddress": "00:0C:29:16:DD:66"
}
],
"firmwareVersion": "ievd-dbg-1.24.0-4-gp"
}