github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/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  	// State represents the current state of the pod.
    23  	State string `json:"State"`
    24  	// Hostname is the hostname that the pod will set.
    25  	Hostname string
    26  	// Labels is a set of key-value labels that have been applied to the
    27  	// pod.
    28  	Labels map[string]string `json:"Labels,omitempty"`
    29  	// CreateCgroup is whether this pod will create its own CGroup to group
    30  	// containers under.
    31  	CreateCgroup bool
    32  	// CgroupParent is the parent of the pod's CGroup.
    33  	CgroupParent string `json:"CgroupParent,omitempty"`
    34  	// CgroupPath is the path to the pod's CGroup.
    35  	CgroupPath string `json:"CgroupPath,omitempty"`
    36  	// CreateInfra is whether this pod will create an infra container to
    37  	// share namespaces.
    38  	CreateInfra bool
    39  	// InfraContainerID is the ID of the pod's infra container, if one is
    40  	// present.
    41  	InfraContainerID string `json:"InfraContainerID,omitempty"`
    42  	// InfraConfig is the configuration of the infra container of the pod.
    43  	// Will only be set if CreateInfra is true.
    44  	InfraConfig *InspectPodInfraConfig `json:"InfraConfig,omitempty"`
    45  	// SharedNamespaces contains a list of namespaces that will be shared by
    46  	// containers within the pod. Can only be set if CreateInfra is true.
    47  	SharedNamespaces []string `json:"SharedNamespaces,omitempty"`
    48  	// NumContainers is the number of containers in the pod, including the
    49  	// infra container.
    50  	NumContainers uint
    51  	// Containers gives a brief summary of all containers in the pod and
    52  	// their current status.
    53  	Containers []InspectPodContainerInfo `json:"Containers,omitempty"`
    54  }
    55  
    56  // InspectPodInfraConfig contains the configuration of the pod's infra
    57  // container.
    58  type InspectPodInfraConfig struct {
    59  	// PortBindings are ports that will be forwarded to the infra container
    60  	// and then shared with the pod.
    61  	PortBindings map[string][]InspectHostPort
    62  	// HostNetwork is whether the infra container (and thus the whole pod)
    63  	// will use the host's network and not create a network namespace.
    64  	HostNetwork bool
    65  	// StaticIP is a static IPv4 that will be assigned to the infra
    66  	// container and then used by the pod.
    67  	StaticIP net.IP
    68  	// StaticMAC is a static MAC address that will be assigned to the infra
    69  	// container and then used by the pod.
    70  	StaticMAC string
    71  	// NoManageResolvConf indicates that the pod will not manage resolv.conf
    72  	// and instead each container will handle their own.
    73  	NoManageResolvConf bool
    74  	// DNSServer is a set of DNS Servers that will be used by the infra
    75  	// container's resolv.conf and shared with the remainder of the pod.
    76  	DNSServer []string
    77  	// DNSSearch is a set of DNS search domains that will be used by the
    78  	// infra container's resolv.conf and shared with the remainder of the
    79  	// pod.
    80  	DNSSearch []string
    81  	// DNSOption is a set of DNS options that will be used by the infra
    82  	// container's resolv.conf and shared with the remainder of the pod.
    83  	DNSOption []string
    84  	// NoManageHosts indicates that the pod will not manage /etc/hosts and
    85  	// instead each container will handle their own.
    86  	NoManageHosts bool
    87  	// HostAdd adds a number of hosts to the infra container's resolv.conf
    88  	// which will be shared with the rest of the pod.
    89  	HostAdd []string
    90  	// Networks is a list of CNI networks the pod will join.
    91  	Networks []string
    92  	// NetworkOptions are additional options for each network
    93  	NetworkOptions map[string][]string
    94  }
    95  
    96  // InspectPodContainerInfo contains information on a container in a pod.
    97  type InspectPodContainerInfo struct {
    98  	// ID is the ID of the container.
    99  	ID string `json:"Id"`
   100  	// Name is the name of the container.
   101  	Name string
   102  	// State is the current status of the container.
   103  	State string
   104  }