summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi/system.go
blob: 976dfc682926f25953c57e6456d90f2514d239a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package varlinkapi

import (
	ioprojectatomicpodman "github.com/projectatomic/libpod/cmd/podman/varlink"
	"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",
	})
}