diff options
author | baude <bbaude@redhat.com> | 2018-03-26 09:39:14 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-23 14:29:45 +0000 |
commit | 8493dba23c73617d9529b7ca13b400d50ac6f455 (patch) | |
tree | c0de0c67334b9fa7166e01cae95dc560c1e2455a /pkg | |
parent | cf1d884ffa45b342f38a78189bbd86186ce6cbfe (diff) | |
download | podman-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')
-rw-r--r-- | pkg/varlinkapi/config.go | 14 | ||||
-rw-r--r-- | pkg/varlinkapi/containers.go | 111 | ||||
-rw-r--r-- | pkg/varlinkapi/images.go | 75 | ||||
-rw-r--r-- | pkg/varlinkapi/system.go | 30 |
4 files changed, 230 insertions, 0 deletions
diff --git a/pkg/varlinkapi/config.go b/pkg/varlinkapi/config.go new file mode 100644 index 000000000..167270f09 --- /dev/null +++ b/pkg/varlinkapi/config.go @@ -0,0 +1,14 @@ +package varlinkapi + +import "github.com/projectatomic/libpod/cmd/podman/ioprojectatomicpodman" + +// LibpodAPI is the basic varlink struct for libpod +type LibpodAPI struct { + ioprojectatomicpodman.VarlinkInterface +} + +var ( + lp = LibpodAPI{} + // VarlinkLibpod instantiation + VarlinkLibpod = ioprojectatomicpodman.VarlinkNew(&lp) +) diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go new file mode 100644 index 000000000..e58cab497 --- /dev/null +++ b/pkg/varlinkapi/containers.go @@ -0,0 +1,111 @@ +package varlinkapi + +import ( + "github.com/projectatomic/libpod/cmd/podman/ioprojectatomicpodman" +) + +// ListContainers ... +func (i *LibpodAPI) ListContainers(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("ListContainers") +} + +// CreateContainer ... +func (i *LibpodAPI) CreateContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("CreateContainer") +} + +// InspectContainer ... +func (i *LibpodAPI) InspectContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("InspectContainer") +} + +// ListContainerProcesses ... +func (i *LibpodAPI) ListContainerProcesses(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("ListContainerProcesses") +} + +// GetContainerLogs ... +func (i *LibpodAPI) GetContainerLogs(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("GetContainerLogs") +} + +// ListContainerChanges ... +func (i *LibpodAPI) ListContainerChanges(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("ListContianerChanges") +} + +// ExportContainer ... +func (i *LibpodAPI) ExportContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("ExportContainer") +} + +// GetContainerStats ... +func (i *LibpodAPI) GetContainerStats(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("GetContainerStates") +} + +// ResizeContainerTty ... +func (i *LibpodAPI) ResizeContainerTty(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("ResizeContainerTty") +} + +// StartContainer ... +func (i *LibpodAPI) StartContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("StartContainer") +} + +// StopContainer ... +func (i *LibpodAPI) StopContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("StopContainer") +} + +// RestartContainer ... +func (i *LibpodAPI) RestartContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("RestartContainer") +} + +// KillContainer ... +func (i *LibpodAPI) KillContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("KillContainer") +} + +// UpdateContainer ... +func (i *LibpodAPI) UpdateContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("UpdateContainer") +} + +// RenameContainer ... +func (i *LibpodAPI) RenameContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("RenameContainer") +} + +// PauseContainer ... +func (i *LibpodAPI) PauseContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("PauseContainer") +} + +// UnpauseContainer ... +func (i *LibpodAPI) UnpauseContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("UnpauseContainer") +} + +// AttachToContainer ... +// TODO: DO we also want a different one for websocket? +func (i *LibpodAPI) AttachToContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("AttachToContainer") +} + +// WaitContainer ... +func (i *LibpodAPI) WaitContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("WaitContainer") +} + +// RemoveContainer ... +func (i *LibpodAPI) RemoveContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("RemoveContainer") +} + +// DeleteStoppedContainers ... +func (i *LibpodAPI) DeleteStoppedContainers(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("DeleteContainer") +} diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go new file mode 100644 index 000000000..1de54e43b --- /dev/null +++ b/pkg/varlinkapi/images.go @@ -0,0 +1,75 @@ +package varlinkapi + +import ( + "github.com/projectatomic/libpod/cmd/podman/ioprojectatomicpodman" +) + +// ListImages ... +func (i *LibpodAPI) ListImages(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("ListImages") +} + +// BuildImage ... +func (i *LibpodAPI) BuildImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("BuildImage") +} + +// CreateImage ... +func (i *LibpodAPI) CreateImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("CreateImage") +} + +// InspectImage ... +func (i *LibpodAPI) InspectImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("InspectImage") +} + +// HistoryImage ... +func (i *LibpodAPI) HistoryImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("HistoryImage") +} + +// PushImage ... +func (i *LibpodAPI) PushImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("PushImage") +} + +// TagImage ... +func (i *LibpodAPI) TagImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("TagImage") +} + +// RemoveImage ... +func (i *LibpodAPI) RemoveImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("RemoveImage") +} + +// SearchImage ... +func (i *LibpodAPI) SearchImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("SearchImage") +} + +// DeleteUnusedImages ... +func (i *LibpodAPI) DeleteUnusedImages(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("DeleteUnusedImages") +} + +// CreateFromContainer ... +func (i *LibpodAPI) CreateFromContainer(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("CreateFromContainer") +} + +// ImportImage ... +func (i *LibpodAPI) ImportImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("ImportImage") +} + +// ExportImage ... +func (i *LibpodAPI) ExportImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("ExportImage") +} + +// PullImage ... +func (i *LibpodAPI) PullImage(call ioprojectatomicpodman.VarlinkCall) error { + return call.ReplyMethodNotImplemented("PullImage") +} 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", + }) +} |