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