Files
podman/pkg/varlinkapi/remote_client.go
baude ba65301c95 podman-remote create|run
add the ability to create and run containers via the podman-remote
client.

we now create an intermediate layer from the the create/run cli flags.
the intermediate layer can be converted into a createconfig or into a
varlink struct.  Once transported, the varlink struct can be converted
back to an intermediate layer and then to a createconfig.

remote terminals are not supported yet.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-08 09:05:31 -05:00

30 lines
883 B
Go

// +build varlink remoteclient
package varlinkapi
import (
"github.com/containers/libpod/cmd/podman/varlink"
"github.com/containers/libpod/libpod"
)
// ContainerStatsToLibpodContainerStats converts the varlink containerstats to a libpod
// container stats
func ContainerStatsToLibpodContainerStats(stats iopodman.ContainerStats) libpod.ContainerStats {
cstats := libpod.ContainerStats{
ContainerID: stats.Id,
Name: stats.Name,
CPU: stats.Cpu,
CPUNano: uint64(stats.Cpu_nano),
SystemNano: uint64(stats.System_nano),
MemUsage: uint64(stats.Mem_usage),
MemLimit: uint64(stats.Mem_limit),
MemPerc: stats.Mem_perc,
NetInput: uint64(stats.Net_input),
NetOutput: uint64(stats.Net_output),
BlockInput: uint64(stats.Block_input),
BlockOutput: uint64(stats.Block_output),
PIDs: uint64(stats.Pids),
}
return cstats
}