github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/libpod/define/pod_inspect.go (about)

     1  package define
     2  
     3  import (
     4  	"net"
     5  	"time"
     6  )
     7  
     8  // InspectPodData contains detailed information on a pod's configuration and
     9  // state. It is used as the output of Inspect on pods.
    10  type InspectPodData struct {
    11  	// ID is the ID of the pod.
    12  	ID string `json:"Id"`
    13  	// Name is the name of the pod.
    14  	Name string
    15  	// Namespace is the Libpod namespace the pod is placed in.
    16  	Namespace string `json:"Namespace,omitempty"`
    17  	// Created is the time when the pod was created.
    18  	Created time.Time
    19  	// CreateCommand is the full command plus arguments of the process the
    20  	// container has been created with.
    21  	CreateCommand []string `json:"CreateCommand,omitempty"`
    22  	// ExitPolicy of the pod.
    23  	ExitPolicy string `json:"ExitPolicy,omitempty"`
    24  	// State represents the current state of the pod.
    25  	State string `json:"State"`
    26  	// Hostname is the hostname that the pod will set.
    27  	Hostname string
    28  	// Labels is a set of key-value labels that have been applied to the
    29  	// pod.
    30  	Labels map[string]string `json:"Labels,omitempty"`
    31  	// CreateCgroup is whether this pod will create its own Cgroup to group
    32  	// containers under.
    33  	CreateCgroup bool
    34  	// CgroupParent is the parent of the pod's Cgroup.
    35  	CgroupParent string `json:"CgroupParent,omitempty"`
    36  	// CgroupPath is the path to the pod's Cgroup.
    37  	CgroupPath string `json:"CgroupPath,omitempty"`
    38  	// CreateInfra is whether this pod will create an infra container to
    39  	// share namespaces.
    40  	CreateInfra bool
    41  	// InfraContainerID is the ID of the pod's infra container, if one is
    42  	// present.
    43  	InfraContainerID string `json:"InfraContainerID,omitempty"`
    44  	// InfraConfig is the configuration of the infra container of the pod.
    45  	// Will only be set if CreateInfra is true.
    46  	InfraConfig *InspectPodInfraConfig `json:"InfraConfig,omitempty"`
    47  	// SharedNamespaces contains a list of namespaces that will be shared by
    48  	// containers within the pod. Can only be set if CreateInfra is true.
    49  	SharedNamespaces []string `json:"SharedNamespaces,omitempty"`
    50  	// NumContainers is the number of containers in the pod, including the
    51  	// infra container.
    52  	NumContainers uint
    53  	// Containers gives a brief summary of all containers in the pod and
    54  	// their current status.
    55  	Containers []InspectPodContainerInfo `json:"Containers,omitempty"`
    56  	// CPUPeriod contains the CPU period of the pod
    57  	CPUPeriod uint64 `json:"cpu_period,omitempty"`
    58  	// CPUQuota contains the CPU quota of the pod
    59  	CPUQuota int64 `json:"cpu_quota,omitempty"`
    60  	// CPUSetCPUs contains linux specific CPU data for the pod
    61  	CPUSetCPUs string `json:"cpuset_cpus,omitempty"`
    62  	// Mounts contains volume related information for the pod
    63  	Mounts []InspectMount `json:"mounts,omitempty"`
    64  	// Devices contains the specified host devices
    65  	Devices []InspectDevice `json:"devices,omitempty"`
    66  	// BlkioDeviceReadBps contains the Read/Access limit for the pod's devices
    67  	BlkioDeviceReadBps []InspectBlkioThrottleDevice `json:"device_read_bps,omitempty"`
    68  	// VolumesFrom contains the containers that the pod inherits mounts from
    69  	VolumesFrom []string `json:"volumes_from,omitempty"`
    70  	// SecurityOpt contains the specified security labels and related SELinux information
    71  	SecurityOpts []string `json:"security_opt,omitempty"`
    72  }
    73  
    74  // InspectPodInfraConfig contains the configuration of the pod's infra
    75  // container.
    76  type InspectPodInfraConfig struct {
    77  	// PortBindings are ports that will be forwarded to the infra container
    78  	// and then shared with the pod.
    79  	PortBindings map[string][]InspectHostPort
    80  	// HostNetwork is whether the infra container (and thus the whole pod)
    81  	// will use the host's network and not create a network namespace.
    82  	HostNetwork bool
    83  	// StaticIP is a static IPv4 that will be assigned to the infra
    84  	// container and then used by the pod.
    85  	// swagger:strfmt ipv4
    86  	StaticIP net.IP
    87  	// StaticMAC is a static MAC address that will be assigned to the infra
    88  	// container and then used by the pod.
    89  	StaticMAC string
    90  	// NoManageResolvConf indicates that the pod will not manage resolv.conf
    91  	// and instead each container will handle their own.
    92  	NoManageResolvConf bool
    93  	// DNSServer is a set of DNS Servers that will be used by the infra
    94  	// container's resolv.conf and shared with the remainder of the pod.
    95  	DNSServer []string
    96  	// DNSSearch is a set of DNS search domains that will be used by the
    97  	// infra container's resolv.conf and shared with the remainder of the
    98  	// pod.
    99  	DNSSearch []string
   100  	// DNSOption is a set of DNS options that will be used by the infra
   101  	// container's resolv.conf and shared with the remainder of the pod.
   102  	DNSOption []string
   103  	// NoManageHosts indicates that the pod will not manage /etc/hosts and
   104  	// instead each container will handle their own.
   105  	NoManageHosts bool
   106  	// HostAdd adds a number of hosts to the infra container's resolv.conf
   107  	// which will be shared with the rest of the pod.
   108  	HostAdd []string
   109  	// Networks is a list of CNI networks the pod will join.
   110  	Networks []string
   111  	// NetworkOptions are additional options for each network
   112  	NetworkOptions map[string][]string
   113  	// CPUPeriod contains the CPU period of the pod
   114  	CPUPeriod uint64 `json:"cpu_period,omitempty"`
   115  	// CPUQuota contains the CPU quota of the pod
   116  	CPUQuota int64 `json:"cpu_quota,omitempty"`
   117  	// CPUSetCPUs contains linux specific CPU data for the container
   118  	CPUSetCPUs string `json:"cpuset_cpus,omitempty"`
   119  	// Pid is the PID namespace mode of the pod's infra container
   120  	PidNS string `json:"pid_ns,omitempty"`
   121  	// UserNS is the usernamespace that all the containers in the pod will join.
   122  	UserNS string `json:"userns,omitempty"`
   123  }
   124  
   125  // InspectPodContainerInfo contains information on a container in a pod.
   126  type InspectPodContainerInfo struct {
   127  	// ID is the ID of the container.
   128  	ID string `json:"Id"`
   129  	// Name is the name of the container.
   130  	Name string
   131  	// State is the current status of the container.
   132  	State string
   133  }