summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi/system.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-03-26 09:39:14 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-23 14:29:45 +0000
commit8493dba23c73617d9529b7ca13b400d50ac6f455 (patch)
treec0de0c67334b9fa7166e01cae95dc560c1e2455a /pkg/varlinkapi/system.go
parentcf1d884ffa45b342f38a78189bbd86186ce6cbfe (diff)
downloadpodman-8493dba23c73617d9529b7ca13b400d50ac6f455.tar.gz
podman-8493dba23c73617d9529b7ca13b400d50ac6f455.tar.bz2
podman-8493dba23c73617d9529b7ca13b400d50ac6f455.zip
Initial varlink implementation
Signed-off-by: baude <bbaude@redhat.com> Closes: #627 Approved by: mheon
Diffstat (limited to 'pkg/varlinkapi/system.go')
-rw-r--r--pkg/varlinkapi/system.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkg/varlinkapi/system.go b/pkg/varlinkapi/system.go
new file mode 100644
index 000000000..c343f1245
--- /dev/null
+++ b/pkg/varlinkapi/system.go
@@ -0,0 +1,30 @@
+package varlinkapi
+
+import (
+ "github.com/projectatomic/libpod/cmd/podman/ioprojectatomicpodman"
+ "github.com/projectatomic/libpod/libpod"
+)
+
+// GetVersion ...
+func (i *LibpodAPI) GetVersion(call ioprojectatomicpodman.VarlinkCall) error {
+ versionInfo, err := libpod.GetVersion()
+ if err != nil {
+ return err
+ }
+
+ return call.ReplyGetVersion(ioprojectatomicpodman.Version{
+ Version: versionInfo.Version,
+ Go_version: versionInfo.GoVersion,
+ Git_commit: versionInfo.GitCommit,
+ Built: versionInfo.Built,
+ Os_arch: versionInfo.OsArch,
+ })
+}
+
+// Ping returns a simple string "OK" response for clients to make sure
+// the service is working.
+func (i *LibpodAPI) Ping(call ioprojectatomicpodman.VarlinkCall) error {
+ return call.ReplyPing(ioprojectatomicpodman.StringResponse{
+ Message: "OK",
+ })
+}