mirror of https://github.com/portainer/portainer
feat(api/snapshot): extend docker container snapshot type (#8537)
parent
7dcd6f9b9e
commit
bc6a667a6b
|
@ -220,7 +220,9 @@ func snapshotContainers(snapshot *portainer.DockerSnapshot, cli *client.Client)
|
||||||
snapshot.HealthyContainerCount = healthyContainers
|
snapshot.HealthyContainerCount = healthyContainers
|
||||||
snapshot.UnhealthyContainerCount = unhealthyContainers
|
snapshot.UnhealthyContainerCount = unhealthyContainers
|
||||||
snapshot.StackCount += len(stacks)
|
snapshot.StackCount += len(stacks)
|
||||||
snapshot.SnapshotRaw.Containers = containers
|
for _, container := range containers {
|
||||||
|
snapshot.SnapshotRaw.Containers = append(snapshot.SnapshotRaw.Containers, portainer.DockerContainerSnapshot{Container: container})
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -207,15 +207,21 @@ type (
|
||||||
GpuUseList []string `json:"GpuUseList"`
|
GpuUseList []string `json:"GpuUseList"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DockerSnapshotRaw represents all the information related to a snapshot as returned by the Docker API
|
// DockerContainerSnapshot is an extent of Docker's Container struct
|
||||||
|
// It contains some information of Docker's ContainerJSON struct
|
||||||
|
DockerContainerSnapshot struct {
|
||||||
|
types.Container
|
||||||
|
Env []string `json:"Env"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DockerSnapshotRaw represents all the information related to a snapshot as returned by the Docker API
|
||||||
DockerSnapshotRaw struct {
|
DockerSnapshotRaw struct {
|
||||||
Containers []types.Container `json:"Containers" swaggerignore:"true"`
|
Containers []DockerContainerSnapshot `json:"Containers" swaggerignore:"true"`
|
||||||
Volumes volume.VolumeListOKBody `json:"Volumes" swaggerignore:"true"`
|
Volumes volume.VolumeListOKBody `json:"Volumes" swaggerignore:"true"`
|
||||||
Networks []types.NetworkResource `json:"Networks" swaggerignore:"true"`
|
Networks []types.NetworkResource `json:"Networks" swaggerignore:"true"`
|
||||||
Images []types.ImageSummary `json:"Images" swaggerignore:"true"`
|
Images []types.ImageSummary `json:"Images" swaggerignore:"true"`
|
||||||
Info types.Info `json:"Info" swaggerignore:"true"`
|
Info types.Info `json:"Info" swaggerignore:"true"`
|
||||||
Version types.Version `json:"Version" swaggerignore:"true"`
|
Version types.Version `json:"Version" swaggerignore:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EdgeGroup represents an Edge group
|
// EdgeGroup represents an Edge group
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
import { DockerContainer } from '@/react/docker/containers/types';
|
import { DockerContainer } from '@/react/docker/containers/types';
|
||||||
|
|
||||||
|
export type DockerContainerSnapshot = DockerContainer & {
|
||||||
|
Env?: string[];
|
||||||
|
};
|
||||||
|
|
||||||
export type DockerSnapshotRaw = {
|
export type DockerSnapshotRaw = {
|
||||||
Containers: DockerContainer[];
|
Containers: DockerContainerSnapshot[];
|
||||||
SnapshotTime: string;
|
SnapshotTime: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue