github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/libpod/define/info.go (about)

     1  package define
     2  
     3  import "github.com/containers/storage/pkg/idtools"
     4  
     5  // Info is the overall struct that describes the host system
     6  // running libpod/podman
     7  type Info struct {
     8  	Host       *HostInfo              `json:"host"`
     9  	Store      *StoreInfo             `json:"store"`
    10  	Registries map[string]interface{} `json:"registries"`
    11  }
    12  
    13  //HostInfo describes the libpod host
    14  type HostInfo struct {
    15  	Arch           string                 `json:"arch"`
    16  	BuildahVersion string                 `json:"buildahVersion"`
    17  	CGroupsVersion string                 `json:"cgroupVersion"`
    18  	Conmon         *ConmonInfo            `json:"conmon"`
    19  	CPUs           int                    `json:"cpus"`
    20  	Distribution   DistributionInfo       `json:"distribution"`
    21  	EventLogger    string                 `json:"eventLogger"`
    22  	Hostname       string                 `json:"hostname"`
    23  	IDMappings     IDMappings             `json:"idMappings,omitempty"`
    24  	Kernel         string                 `json:"kernel"`
    25  	MemFree        int64                  `json:"memFree"`
    26  	MemTotal       int64                  `json:"memTotal"`
    27  	OCIRuntime     *OCIRuntimeInfo        `json:"ociRuntime"`
    28  	OS             string                 `json:"os"`
    29  	Rootless       bool                   `json:"rootless"`
    30  	RuntimeInfo    map[string]interface{} `json:"runtimeInfo,omitempty"`
    31  	Slirp4NetNS    SlirpInfo              `json:"slirp4netns,omitempty"`
    32  	SwapFree       int64                  `json:"swapFree"`
    33  	SwapTotal      int64                  `json:"swapTotal"`
    34  	Uptime         string                 `json:"uptime"`
    35  }
    36  
    37  // SlirpInfo describes the slirp exectuable that
    38  // is being being used.
    39  type SlirpInfo struct {
    40  	Executable string `json:"executable"`
    41  	Package    string `json:"package"`
    42  	Version    string `json:"version"`
    43  }
    44  
    45  // IDMappings describe the GID and UID mappings
    46  type IDMappings struct {
    47  	GIDMap []idtools.IDMap `json:"gidmap"`
    48  	UIDMap []idtools.IDMap `json:"uidmap"`
    49  }
    50  
    51  // DistributionInfo describes the host distribution
    52  // for libpod
    53  type DistributionInfo struct {
    54  	Distribution string `json:"distribution"`
    55  	Version      string `json:"version"`
    56  }
    57  
    58  // ConmonInfo describes the conmon executable being used
    59  type ConmonInfo struct {
    60  	Package string `json:"package"`
    61  	Path    string `json:"path"`
    62  	Version string `json:"version"`
    63  }
    64  
    65  // OCIRuntimeInfo describes the runtime (crun or runc) being
    66  // used with podman
    67  type OCIRuntimeInfo struct {
    68  	Name    string `json:"name"`
    69  	Package string `json:"package"`
    70  	Path    string `json:"path"`
    71  	Version string `json:"version"`
    72  }
    73  
    74  // StoreInfo describes the container storage and its
    75  // attributes
    76  type StoreInfo struct {
    77  	ConfigFile      string                 `json:"configFile"`
    78  	ContainerStore  ContainerStore         `json:"containerStore"`
    79  	GraphDriverName string                 `json:"graphDriverName"`
    80  	GraphOptions    map[string]interface{} `json:"graphOptions"`
    81  	GraphRoot       string                 `json:"graphRoot"`
    82  	GraphStatus     map[string]string      `json:"graphStatus"`
    83  	ImageStore      ImageStore             `json:"imageStore"`
    84  	RunRoot         string                 `json:"runRoot"`
    85  	VolumePath      string                 `json:"volumePath"`
    86  }
    87  
    88  // ImageStore describes the image store.  Right now only the number
    89  // of images present
    90  type ImageStore struct {
    91  	Number int `json:"number"`
    92  }
    93  
    94  // ContainerStore describes the quantity of containers in the
    95  // store by status
    96  type ContainerStore struct {
    97  	Number  int `json:"number"`
    98  	Paused  int `json:"paused"`
    99  	Running int `json:"running"`
   100  	Stopped int `json:"stopped"`
   101  }