diff options
author | Jhon Honce <jhonce@redhat.com> | 2022-05-19 10:27:31 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2022-05-19 15:24:18 -0700 |
commit | 5b79cf15a0226dc3dad5053615ee652823376cd3 (patch) | |
tree | 066e0b6e5fde4af49e7113ab48c277a55a60c22a /pkg/domain/entities/pods.go | |
parent | 913caaa9b1de2b63692c9bae15120208194c9eb3 (diff) | |
download | podman-5b79cf15a0226dc3dad5053615ee652823376cd3.tar.gz podman-5b79cf15a0226dc3dad5053615ee652823376cd3.tar.bz2 podman-5b79cf15a0226dc3dad5053615ee652823376cd3.zip |
Swagger refactor/cleanup
* Remove duplicate or unused types and constants
* Move all documetation-only models and responses into swagger package
* Remove all unecessary names, go-swagger will determine names from
struct declarations
* Use Libpod suffix to differentiate between compat and libpod models
and responses. Taken from swagger:operation declarations.
* Models and responses that start with lowercase are for swagger use
only while uppercase are used "as is" in the code and swagger comments
* Used gofumpt on new code
```release-note
```
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/domain/entities/pods.go')
-rw-r--r-- | pkg/domain/entities/pods.go | 61 |
1 files changed, 39 insertions, 22 deletions
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go index a19edcbf0..9cbbe2bf1 100644 --- a/pkg/domain/entities/pods.go +++ b/pkg/domain/entities/pods.go @@ -20,15 +20,15 @@ type PodKillOptions struct { type PodKillReport struct { Errs []error - Id string //nolint + Id string // nolint } type ListPodsReport struct { Cgroup string Containers []*ListPodContainer Created time.Time - Id string //nolint - InfraId string //nolint + Id string // nolint + InfraId string // nolint Name string Namespace string // Network names connected to infra container @@ -38,7 +38,7 @@ type ListPodsReport struct { } type ListPodContainer struct { - Id string //nolint + Id string // nolint Names string Status string } @@ -50,7 +50,7 @@ type PodPauseOptions struct { type PodPauseReport struct { Errs []error - Id string //nolint + Id string // nolint } type PodunpauseOptions struct { @@ -60,7 +60,7 @@ type PodunpauseOptions struct { type PodUnpauseReport struct { Errs []error - Id string //nolint + Id string // nolint } type PodStopOptions struct { @@ -72,7 +72,7 @@ type PodStopOptions struct { type PodStopReport struct { Errs []error - Id string //nolint + Id string // nolint } type PodRestartOptions struct { @@ -82,7 +82,7 @@ type PodRestartOptions struct { type PodRestartReport struct { Errs []error - Id string //nolint + Id string // nolint } type PodStartOptions struct { @@ -92,7 +92,7 @@ type PodStartOptions struct { type PodStartReport struct { Errs []error - Id string //nolint + Id string // nolint } type PodRmOptions struct { @@ -105,7 +105,7 @@ type PodRmOptions struct { type PodRmReport struct { Err error - Id string //nolint + Id string // nolint } // PddSpec is an abstracted version of PodSpecGen designed to eventually accept options @@ -287,7 +287,7 @@ func NewInfraContainerCreateOptions() ContainerCreateOptions { } type PodCreateReport struct { - Id string //nolint + Id string // nolint } func (p *PodCreateOptions) CPULimits() *specs.LinuxCPU { @@ -389,7 +389,7 @@ type PodPruneOptions struct { type PodPruneReport struct { Err error - Id string //nolint + Id string // nolint } type PodTopOptions struct { @@ -437,16 +437,33 @@ type PodStatsOptions struct { // PodStatsReport includes pod-resource statistics data. type PodStatsReport struct { - CPU string - MemUsage string + // Percentage of CPU utilized by pod + // example: 75.5% + CPU string + // Humanized Memory usage and maximum + // example: 12mb / 24mb + MemUsage string + // Memory usage and maximum in bytes + // example: 1,000,000 / 4,000,000 MemUsageBytes string - Mem string - NetIO string - BlockIO string - PIDS string - Pod string - CID string - Name string + // Percentage of Memory utilized by pod + // example: 50.5% + Mem string + // Network usage inbound + outbound + NetIO string + // Humanized disk usage read + write + BlockIO string + // Container PID + PIDS string + // Pod ID + // example: 62310217a19e + Pod string + // Container ID + // example: e43534f89a7d + CID string + // Pod Name + // example: elastic_pascal + Name string } // ValidatePodStatsOptions validates the specified slice and options. Allows @@ -475,7 +492,7 @@ func ValidatePodStatsOptions(args []string, options *PodStatsOptions) error { } } -// Converts PodLogOptions to ContainerLogOptions +// PodLogsOptionsToContainerLogsOptions converts PodLogOptions to ContainerLogOptions func PodLogsOptionsToContainerLogsOptions(options PodLogsOptions) ContainerLogsOptions { // PodLogsOptions are similar but contains few extra fields like ctrName // So cast other values as is so we can re-use the code |