Skip to content

siemens/ieddata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Siemens Industrial Edge Edgeshark

IED App Engine Data Access

PkgGoDev GitHub build and test goroutines file descriptors Go Report Card Coverage

iedata provides querying information about a Siemens Industrial Edge (virtual) device from an app inside the IE(v)D.

Note

This package is "CGO-free" as it leverages the modernc.org/sqlite sqlite3 driver module. When using the ieddata module, please make sure that your main module's go.mod (indirectly) requires the modernc/libc module in the same version as required by modernc.org/sqlite's go.mod.

ieddata is part of the "Edgeshark" project that consist of several repositories:

Usage

The following 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) int { return strings.Compare(a.Title, b.Title) })
for _, app := range apps {
   fmt.Printf("app: %q %s\n", app.Title, app.Id)
}

Nota bene: we first copy the IED's platformbox.db in a temporary location and the open only the copy.

DevContainer

Caution

Do not use VSCode's "Dev Containers: Clone Repository in Container Volume" command, as it is utterly broken by design, ignoring .devcontainer/devcontainer.json.

  1. git clone https://github.com/siemens/ieddata
  2. in VSCode: Ctrl+Shift+P, "Dev Containers: Open Workspace in Container..."
  3. select ieddata.code-workspace and off you go...

Supported Go Versions

morbyd supports versions of Go that are noted by the Go release policy, that is, major versions N and N-1 (where N is the current major version).

Deployment

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.

Contributing

Please see CONTRIBUTING.md.

License and Copyright

(c) Siemens AG 2023

SPDX-License-Identifier: MIT

About

[Edgeshark] Retrieve IED information.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •