ieddata
is part of the "Edgeshark" project that consist of several
repositories:
- Edgeshark Hub repository
- G(h)ostwire discovery service
- Packetflix packet streaming service
- Containershark Extcap plugin for Wireshark
- support modules:
- csharg (CLI)
- mobydig
- 🖝 ieddata 🖜
go get github.com/siemens/ieddata@latest
Note: ieddata
supports versions of Go 1 that are noted by the Go release
policy, that is, major
versions N and N-1 (where N is the current major version).
This example queries a Siemens Industrial Edge (virtual) device's...
- ...device name and its owner,
- ...and the list of installed applications.
Error handling has been left out for brevity.
db, _ := ieddata.Open("platformbox.db")
defer db.Close()
di, _ := db.DeviceInfo()
fmt.Printf("device name: %s\nowner name: %s\n", di["deviceName"], di["ownerName"])
apps, _ := db.Apps()
slices.SortFunc(apps, func(a, b ieddata.App) bool { return a.Title < b.Title })
for _, app := range apps {
fmt.Printf("app: %q %s\n", app.Title, app.Id)
}
Nota bene: the IED's
platformbox.db
is opened always in read-only mode. Thus, the underlying database connection on purpose does not allow callers to modify the IED's databases using this module.
make pkgsite
Then navigate to http://localhost:6060/github.com/siemens/ieddata.
Please note that an application using this Go module needs to have capability
CAP_SYS_PTRACE
requested in its composer file, as well as your binary needs to
be executed with CAP_SYS_PTRACE
also effective, not just permitted. If you
run your binary under a non-UID0 user, then you need to assign file capabilities
to your binary (see also
setcap(8)).
Additionally, you need to deploy any container that leverages this Go module
with pid:host
in order to access the file system view (mount namespaces) of
other containers.
This Go module comes with unit tests and some of these unit tests need to be run as root (UID 0). The unit tests additionally require an operational Docker container engine to be up and running (for simulating a fake IED edge core runtime container). To run the tests, simply do:
make test
The unit tests also include checks for file descriptor leaks.
Please see CONTRIBUTING.md.
(c) Siemens AG 2023