summaryrefslogtreecommitdiff
path: root/pkg/domain/entities
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-04-07 16:54:32 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-04-09 11:55:10 +0200
commit7a3bfbf0767675472451d7328cada39b5797cdf8 (patch)
treecc9f24c405c4bfbf636a0ada96fa22f11bba87c0 /pkg/domain/entities
parent46227e0b030ac4180d8f3179f2b33c5d6d8fd200 (diff)
downloadpodman-7a3bfbf0767675472451d7328cada39b5797cdf8.tar.gz
podman-7a3bfbf0767675472451d7328cada39b5797cdf8.tar.bz2
podman-7a3bfbf0767675472451d7328cada39b5797cdf8.zip
podmanV2: implement logs
Implement the `podman {container} logs` for the v2 client. The remote client does not yet support it. There's some more work needed for the rest api; some options are missing (e.g., printing names) while others are broken (e.g., the until http parameter). The remote parts will be tackled in a future change. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/domain/entities')
-rw-r--r--pkg/domain/entities/containers.go20
-rw-r--r--pkg/domain/entities/engine_container.go1
2 files changed, 21 insertions, 0 deletions
diff --git a/pkg/domain/entities/containers.go b/pkg/domain/entities/containers.go
index 5d302058b..98f9f9471 100644
--- a/pkg/domain/entities/containers.go
+++ b/pkg/domain/entities/containers.go
@@ -172,6 +172,26 @@ type AttachOptions struct {
Stderr *os.File
}
+// ContainerLogsOptions describes the options to extract container logs.
+type ContainerLogsOptions struct {
+ // Show extra details provided to the logs.
+ Details bool
+ // Follow the log output.
+ Follow bool
+ // Display logs for the latest container only. Ignored on the remote client.
+ Latest bool
+ // Show container names in the output.
+ Names bool
+ // Show logs since this timestamp.
+ Since time.Time
+ // Number of lines to display at the end of the output.
+ Tail int64
+ // Show timestamps in the logs.
+ Timestamps bool
+ // Write the logs to Writer.
+ Writer io.Writer
+}
+
// ExecOptions describes the cli values to exec into
// a container
type ExecOptions struct {
diff --git a/pkg/domain/entities/engine_container.go b/pkg/domain/entities/engine_container.go
index 24b7a9acc..fec288eb8 100644
--- a/pkg/domain/entities/engine_container.go
+++ b/pkg/domain/entities/engine_container.go
@@ -20,6 +20,7 @@ type ContainerEngine interface {
ContainerKill(ctx context.Context, namesOrIds []string, options KillOptions) ([]*KillReport, error)
ContainerList(ctx context.Context, options ContainerListOptions) ([]ListContainer, error)
ContainerPause(ctx context.Context, namesOrIds []string, options PauseUnPauseOptions) ([]*PauseUnpauseReport, error)
+ ContainerLogs(ctx context.Context, containers []string, options ContainerLogsOptions) error
ContainerRestart(ctx context.Context, namesOrIds []string, options RestartOptions) ([]*RestartReport, error)
ContainerRestore(ctx context.Context, namesOrIds []string, options RestoreOptions) ([]*RestoreReport, error)
ContainerRm(ctx context.Context, namesOrIds []string, options RmOptions) ([]*RmReport, error)