Class PodSpecGenerator

java.lang.Object
io.github.alersrt.pod4j.openapi.model.PodSpecGenerator

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-11-29T01:29:49.168634544+07:00[Asia/Barnaul]", comments="Generator version: 7.7.0") public class PodSpecGenerator extends Object
PodSpecGenerator describes options to create a pod
  • Field Details

  • Constructor Details

    • PodSpecGenerator

      public PodSpecGenerator()
  • Method Details

    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to PodSpecGenerator
    • fromJson

      public static PodSpecGenerator fromJson(String jsonString) throws IOException
      Create an instance of PodSpecGenerator given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of PodSpecGenerator
      Throws:
      IOException - if the JSON string is invalid with respect to PodSpecGenerator
    • networks

      public PodSpecGenerator networks(Map<String,PerNetworkOptions> networks)
    • putNetworksItem

      public PodSpecGenerator putNetworksItem(String key, PerNetworkOptions networksItem)
    • getNetworks

      @Nullable @Valid public @Valid Map<String,PerNetworkOptions> getNetworks()
      Map of networks names to ids the container should join to. You can request additional settings for each network, you can set network aliases, static ips, static mac address and the network interface name for this container on the specific network. If the map is empty and the bridge network mode is set the container will be joined to the default network.
      Returns:
      networks
    • setNetworks

      public void setNetworks(Map<String,PerNetworkOptions> networks)
    • cgroupParent

      public PodSpecGenerator cgroupParent(String cgroupParent)
    • getCgroupParent

      @Nullable public String getCgroupParent()
      CgroupParent is the parent for the Cgroup that the pod will create. This pod cgroup will, in turn, be the default cgroup parent for all containers in the pod. Optional.
      Returns:
      cgroupParent
    • setCgroupParent

      public void setCgroupParent(String cgroupParent)
    • cniNetworks

      public PodSpecGenerator cniNetworks(List<String> cniNetworks)
    • addCniNetworksItem

      public PodSpecGenerator addCniNetworksItem(String cniNetworksItem)
    • getCniNetworks

      @Nullable public List<String> getCniNetworks()
      CNINetworks is a list of CNI networks to join the container to. If this list is empty, the default CNI network will be joined instead. If at least one entry is present, we will not join the default network (unless it is part of this list). Only available if NetNS is set to bridge. Optional. Deprecated: as of podman 4.0 use \"Networks\" instead.
      Returns:
      cniNetworks
    • setCniNetworks

      public void setCniNetworks(List<String> cniNetworks)
    • cpuPeriod

      public PodSpecGenerator cpuPeriod(Integer cpuPeriod)
    • getCpuPeriod

      @Nullable public Integer getCpuPeriod()
      CPU period of the cpuset, determined by --cpus
      Returns:
      cpuPeriod
    • setCpuPeriod

      public void setCpuPeriod(Integer cpuPeriod)
    • cpuQuota

      public PodSpecGenerator cpuQuota(Long cpuQuota)
    • getCpuQuota

      @Nullable public Long getCpuQuota()
      CPU quota of the cpuset, determined by --cpus
      Returns:
      cpuQuota
    • setCpuQuota

      public void setCpuQuota(Long cpuQuota)
    • dnsOption

      public PodSpecGenerator dnsOption(List<String> dnsOption)
    • addDnsOptionItem

      public PodSpecGenerator addDnsOptionItem(String dnsOptionItem)
    • getDnsOption

      @Nullable public List<String> getDnsOption()
      DNSOption is a set of DNS options that will be used in the infra container's resolv.conf, which will, by default, be shared with all containers in the pod. Conflicts with NoInfra=true. Optional.
      Returns:
      dnsOption
    • setDnsOption

      public void setDnsOption(List<String> dnsOption)
    • dnsSearch

      public PodSpecGenerator dnsSearch(List<String> dnsSearch)
    • addDnsSearchItem

      public PodSpecGenerator addDnsSearchItem(String dnsSearchItem)
    • getDnsSearch

      @Nullable public List<String> getDnsSearch()
      DNSSearch is a set of DNS search domains that will be used in the infra container's resolv.conf, which will, by default, be shared with all containers in the pod. If not provided, DNS search domains from the host's resolv.conf will be used. Conflicts with NoInfra=true. Optional.
      Returns:
      dnsSearch
    • setDnsSearch

      public void setDnsSearch(List<String> dnsSearch)
    • dnsServer

      public PodSpecGenerator dnsServer(List<String> dnsServer)
    • addDnsServerItem

      public PodSpecGenerator addDnsServerItem(String dnsServerItem)
    • getDnsServer

      @Nullable public List<String> getDnsServer()
      DNSServer is a set of DNS servers that will be used in the infra container's resolv.conf, which will, by default, be shared with all containers in the pod. If not provided, the host's DNS servers will be used, unless the only server set is a localhost address. As the container cannot connect to the host's localhost, a default server will instead be set. Conflicts with NoInfra=true. Optional.
      Returns:
      dnsServer
    • setDnsServer

      public void setDnsServer(List<String> dnsServer)
    • exitPolicy

      public PodSpecGenerator exitPolicy(String exitPolicy)
    • getExitPolicy

      @Nullable public String getExitPolicy()
      ExitPolicy determines the pod's exit and stop behaviour.
      Returns:
      exitPolicy
    • setExitPolicy

      public void setExitPolicy(String exitPolicy)
    • hostadd

      public PodSpecGenerator hostadd(List<String> hostadd)
    • addHostaddItem

      public PodSpecGenerator addHostaddItem(String hostaddItem)
    • getHostadd

      @Nullable public List<String> getHostadd()
      HostAdd is a set of hosts that will be added to the infra container's etc/hosts that will, by default, be shared with all containers in the pod. Conflicts with NoInfra=true and NoManageHosts. Optional.
      Returns:
      hostadd
    • setHostadd

      public void setHostadd(List<String> hostadd)
    • hostname

      public PodSpecGenerator hostname(String hostname)
    • getHostname

      @Nullable public String getHostname()
      Hostname is the pod's hostname. If not set, the name of the pod will be used (if a name was not provided here, the name auto-generated for the pod will be used). This will be used by the infra container and all containers in the pod as long as the UTS namespace is shared. Optional.
      Returns:
      hostname
    • setHostname

      public void setHostname(String hostname)
    • idmappings

      public PodSpecGenerator idmappings(IDMappingOptions idmappings)
    • getIdmappings

      @Nullable @Valid public @Valid IDMappingOptions getIdmappings()
      Get idmappings
      Returns:
      idmappings
    • setIdmappings

      public void setIdmappings(IDMappingOptions idmappings)
    • imageVolumes

      public PodSpecGenerator imageVolumes(List<@Valid ImageVolume> imageVolumes)
    • addImageVolumesItem

      public PodSpecGenerator addImageVolumesItem(ImageVolume imageVolumesItem)
    • getImageVolumes

      @Nullable @Valid public @Valid List<@Valid ImageVolume> getImageVolumes()
      Image volumes bind-mount a container-image mount into the pod's infra container. Optional.
      Returns:
      imageVolumes
    • setImageVolumes

      public void setImageVolumes(List<@Valid ImageVolume> imageVolumes)
    • infraCommand

      public PodSpecGenerator infraCommand(List<String> infraCommand)
    • addInfraCommandItem

      public PodSpecGenerator addInfraCommandItem(String infraCommandItem)
    • getInfraCommand

      @Nullable public List<String> getInfraCommand()
      InfraCommand sets the command that will be used to start the infra container. If not set, the default set in the Libpod configuration file will be used. Conflicts with NoInfra=true. Optional.
      Returns:
      infraCommand
    • setInfraCommand

      public void setInfraCommand(List<String> infraCommand)
    • infraConmonPidFile

      public PodSpecGenerator infraConmonPidFile(String infraConmonPidFile)
    • getInfraConmonPidFile

      @Nullable public String getInfraConmonPidFile()
      InfraConmonPidFile is a custom path to store the infra container's conmon PID.
      Returns:
      infraConmonPidFile
    • setInfraConmonPidFile

      public void setInfraConmonPidFile(String infraConmonPidFile)
    • infraImage

      public PodSpecGenerator infraImage(String infraImage)
    • getInfraImage

      @Nullable public String getInfraImage()
      InfraImage is the image that will be used for the infra container. If not set, the default set in the Libpod configuration file will be used. Conflicts with NoInfra=true. Optional.
      Returns:
      infraImage
    • setInfraImage

      public void setInfraImage(String infraImage)
    • infraName

      public PodSpecGenerator infraName(String infraName)
    • getInfraName

      @Nullable public String getInfraName()
      InfraName is the name that will be used for the infra container. If not set, the default set in the Libpod configuration file will be used. Conflicts with NoInfra=true. Optional.
      Returns:
      infraName
    • setInfraName

      public void setInfraName(String infraName)
    • ipcns

      public PodSpecGenerator ipcns(Namespace ipcns)
    • getIpcns

      @Nullable @Valid public @Valid Namespace getIpcns()
      Get ipcns
      Returns:
      ipcns
    • setIpcns

      public void setIpcns(Namespace ipcns)
    • labels

      public PodSpecGenerator labels(Map<String,String> labels)
    • putLabelsItem

      public PodSpecGenerator putLabelsItem(String key, String labelsItem)
    • getLabels

      @Nullable public Map<String,String> getLabels()
      Labels are key-value pairs that are used to add metadata to pods. Optional.
      Returns:
      labels
    • setLabels

      public void setLabels(Map<String,String> labels)
    • mounts

      public PodSpecGenerator mounts(List<@Valid Mount> mounts)
    • addMountsItem

      public PodSpecGenerator addMountsItem(Mount mountsItem)
    • getMounts

      @Nullable @Valid public @Valid List<@Valid Mount> getMounts()
      Mounts are mounts that will be added to the pod. These will supersede Image Volumes and VolumesFrom volumes where there are conflicts. Optional.
      Returns:
      mounts
    • setMounts

      public void setMounts(List<@Valid Mount> mounts)
    • name

      public PodSpecGenerator name(String name)
    • getName

      @Nullable public String getName()
      Name is the name of the pod. If not provided, a name will be generated when the pod is created. Optional.
      Returns:
      name
    • setName

      public void setName(String name)
    • netns

      public PodSpecGenerator netns(Namespace netns)
    • getNetns

      @Nullable @Valid public @Valid Namespace getNetns()
      Get netns
      Returns:
      netns
    • setNetns

      public void setNetns(Namespace netns)
    • networkOptions

      public PodSpecGenerator networkOptions(Map<String,List<String>> networkOptions)
    • putNetworkOptionsItem

      public PodSpecGenerator putNetworkOptionsItem(String key, List<String> networkOptionsItem)
    • getNetworkOptions

      @Nullable @Valid public @Valid Map<String,List<String>> getNetworkOptions()
      NetworkOptions are additional options for each network Optional.
      Returns:
      networkOptions
    • setNetworkOptions

      public void setNetworkOptions(Map<String,List<String>> networkOptions)
    • noInfra

      public PodSpecGenerator noInfra(Boolean noInfra)
    • getNoInfra

      @Nullable public Boolean getNoInfra()
      NoInfra tells the pod not to create an infra container. If this is done, many networking-related options will become unavailable. Conflicts with setting any options in PodNetworkConfig, and the InfraCommand and InfraImages in this struct. Optional.
      Returns:
      noInfra
    • setNoInfra

      public void setNoInfra(Boolean noInfra)
    • noManageHosts

      public PodSpecGenerator noManageHosts(Boolean noManageHosts)
    • getNoManageHosts

      @Nullable public Boolean getNoManageHosts()
      NoManageHosts indicates that /etc/hosts should not be managed by the pod. Instead, each container will create a separate /etc/hosts as they would if not in a pod. Conflicts with HostAdd.
      Returns:
      noManageHosts
    • setNoManageHosts

      public void setNoManageHosts(Boolean noManageHosts)
    • noManageResolvConf

      public PodSpecGenerator noManageResolvConf(Boolean noManageResolvConf)
    • getNoManageResolvConf

      @Nullable public Boolean getNoManageResolvConf()
      NoManageResolvConf indicates that /etc/resolv.conf should not be managed by the pod. Instead, each container will create and manage a separate resolv.conf as if they had not joined a pod. Conflicts with NoInfra=true and DNSServer, DNSSearch, DNSOption. Optional.
      Returns:
      noManageResolvConf
    • setNoManageResolvConf

      public void setNoManageResolvConf(Boolean noManageResolvConf)
    • overlayVolumes

      public PodSpecGenerator overlayVolumes(List<@Valid OverlayVolume> overlayVolumes)
    • addOverlayVolumesItem

      public PodSpecGenerator addOverlayVolumesItem(OverlayVolume overlayVolumesItem)
    • getOverlayVolumes

      @Nullable @Valid public @Valid List<@Valid OverlayVolume> getOverlayVolumes()
      Overlay volumes are named volumes that will be added to the pod. Optional.
      Returns:
      overlayVolumes
    • setOverlayVolumes

      public void setOverlayVolumes(List<@Valid OverlayVolume> overlayVolumes)
    • pidns

      public PodSpecGenerator pidns(Namespace pidns)
    • getPidns

      @Nullable @Valid public @Valid Namespace getPidns()
      Get pidns
      Returns:
      pidns
    • setPidns

      public void setPidns(Namespace pidns)
    • podCreateCommand

      public PodSpecGenerator podCreateCommand(List<String> podCreateCommand)
    • addPodCreateCommandItem

      public PodSpecGenerator addPodCreateCommandItem(String podCreateCommandItem)
    • getPodCreateCommand

      @Nullable public List<String> getPodCreateCommand()
      Get podCreateCommand
      Returns:
      podCreateCommand
    • setPodCreateCommand

      public void setPodCreateCommand(List<String> podCreateCommand)
    • podDevices

      public PodSpecGenerator podDevices(List<String> podDevices)
    • addPodDevicesItem

      public PodSpecGenerator addPodDevicesItem(String podDevicesItem)
    • getPodDevices

      @Nullable public List<String> getPodDevices()
      Devices contains user specified Devices to be added to the Pod
      Returns:
      podDevices
    • setPodDevices

      public void setPodDevices(List<String> podDevices)
    • portmappings

      public PodSpecGenerator portmappings(List<@Valid PortMapping> portmappings)
    • addPortmappingsItem

      public PodSpecGenerator addPortmappingsItem(PortMapping portmappingsItem)
    • getPortmappings

      @Nullable @Valid public @Valid List<@Valid PortMapping> getPortmappings()
      PortMappings is a set of ports to map into the infra container. As, by default, containers share their network with the infra container, this will forward the ports to the entire pod. Only available if NetNS is set to Bridge, Slirp, or Pasta. Optional.
      Returns:
      portmappings
    • setPortmappings

      public void setPortmappings(List<@Valid PortMapping> portmappings)
    • resourceLimits

      public PodSpecGenerator resourceLimits(LinuxResources resourceLimits)
    • getResourceLimits

      @Nullable @Valid public @Valid LinuxResources getResourceLimits()
      Get resourceLimits
      Returns:
      resourceLimits
    • setResourceLimits

      public void setResourceLimits(LinuxResources resourceLimits)
    • restartPolicy

      public PodSpecGenerator restartPolicy(String restartPolicy)
    • getRestartPolicy

      @Nullable public String getRestartPolicy()
      RestartPolicy is the pod's restart policy - an action which will be taken when one or all the containers in the pod exits. If not given, the default policy will be set to Always, which restarts the containers in the pod when they exit indefinitely. Optional.
      Returns:
      restartPolicy
    • setRestartPolicy

      public void setRestartPolicy(String restartPolicy)
    • restartTries

      public PodSpecGenerator restartTries(Integer restartTries)
    • getRestartTries

      @Nullable public Integer getRestartTries()
      RestartRetries is the number of attempts that will be made to restart the container. Only available when RestartPolicy is set to \"on-failure\". Optional.
      Returns:
      restartTries
    • setRestartTries

      public void setRestartTries(Integer restartTries)
    • securityOpt

      public PodSpecGenerator securityOpt(List<String> securityOpt)
    • addSecurityOptItem

      public PodSpecGenerator addSecurityOptItem(String securityOptItem)
    • getSecurityOpt

      @Nullable public List<String> getSecurityOpt()
      Get securityOpt
      Returns:
      securityOpt
    • setSecurityOpt

      public void setSecurityOpt(List<String> securityOpt)
    • serviceContainerID

      public PodSpecGenerator serviceContainerID(String serviceContainerID)
    • getServiceContainerID

      @Nullable public String getServiceContainerID()
      The ID of the pod's service container.
      Returns:
      serviceContainerID
    • setServiceContainerID

      public void setServiceContainerID(String serviceContainerID)
    • shareParent

      public PodSpecGenerator shareParent(Boolean shareParent)
    • getShareParent

      @Nullable public Boolean getShareParent()
      PodCreateCommand is the command used to create this pod. This will be shown in the output of Inspect() on the pod, and may also be used by some tools that wish to recreate the pod (e.g. `podman generate systemd --new`). Optional. ShareParent determines if all containers in the pod will share the pod's cgroup as the cgroup parent
      Returns:
      shareParent
    • setShareParent

      public void setShareParent(Boolean shareParent)
    • sharedNamespaces

      public PodSpecGenerator sharedNamespaces(List<String> sharedNamespaces)
    • addSharedNamespacesItem

      public PodSpecGenerator addSharedNamespacesItem(String sharedNamespacesItem)
    • getSharedNamespaces

      @Nullable public List<String> getSharedNamespaces()
      SharedNamespaces instructs the pod to share a set of namespaces. Shared namespaces will be joined (by default) by every container which joins the pod. If not set and NoInfra is false, the pod will set a default set of namespaces to share. Conflicts with NoInfra=true. Optional.
      Returns:
      sharedNamespaces
    • setSharedNamespaces

      public void setSharedNamespaces(List<String> sharedNamespaces)
    • shmSize

      public PodSpecGenerator shmSize(Long shmSize)
    • getShmSize

      @Nullable public Long getShmSize()
      ShmSize is the size of the tmpfs to mount in at /dev/shm, in bytes. Conflicts with ShmSize if IpcNS is not private. Optional.
      Returns:
      shmSize
    • setShmSize

      public void setShmSize(Long shmSize)
    • shmSizeSystemd

      public PodSpecGenerator shmSizeSystemd(Long shmSizeSystemd)
    • getShmSizeSystemd

      @Nullable public Long getShmSizeSystemd()
      ShmSizeSystemd is the size of systemd-specific tmpfs mounts specifically /run, /run/lock, /var/log/journal and /tmp. Optional
      Returns:
      shmSizeSystemd
    • setShmSizeSystemd

      public void setShmSizeSystemd(Long shmSizeSystemd)
    • sysctl

      public PodSpecGenerator sysctl(Map<String,String> sysctl)
    • putSysctlItem

      public PodSpecGenerator putSysctlItem(String key, String sysctlItem)
    • getSysctl

      @Nullable public Map<String,String> getSysctl()
      Sysctl sets kernel parameters for the pod
      Returns:
      sysctl
    • setSysctl

      public void setSysctl(Map<String,String> sysctl)
    • throttleReadBpsDevice

      public PodSpecGenerator throttleReadBpsDevice(Map<String,LinuxThrottleDevice> throttleReadBpsDevice)
    • putThrottleReadBpsDeviceItem

      public PodSpecGenerator putThrottleReadBpsDeviceItem(String key, LinuxThrottleDevice throttleReadBpsDeviceItem)
    • getThrottleReadBpsDevice

      @Nullable @Valid public @Valid Map<String,LinuxThrottleDevice> getThrottleReadBpsDevice()
      ThrottleReadBpsDevice contains the rate at which the devices in the pod can be read from/accessed
      Returns:
      throttleReadBpsDevice
    • setThrottleReadBpsDevice

      public void setThrottleReadBpsDevice(Map<String,LinuxThrottleDevice> throttleReadBpsDevice)
    • userns

      public PodSpecGenerator userns(Namespace userns)
    • getUserns

      @Nullable @Valid public @Valid Namespace getUserns()
      Get userns
      Returns:
      userns
    • setUserns

      public void setUserns(Namespace userns)
    • utsns

      public PodSpecGenerator utsns(Namespace utsns)
    • getUtsns

      @Nullable @Valid public @Valid Namespace getUtsns()
      Get utsns
      Returns:
      utsns
    • setUtsns

      public void setUtsns(Namespace utsns)
    • volumes

      public PodSpecGenerator volumes(List<@Valid NamedVolume> volumes)
    • addVolumesItem

      public PodSpecGenerator addVolumesItem(NamedVolume volumesItem)
    • getVolumes

      @Nullable @Valid public @Valid List<@Valid NamedVolume> getVolumes()
      Volumes are named volumes that will be added to the pod. These will supersede Image Volumes and VolumesFrom volumes where there are conflicts. Optional.
      Returns:
      volumes
    • setVolumes

      public void setVolumes(List<@Valid NamedVolume> volumes)
    • volumesFrom

      public PodSpecGenerator volumesFrom(List<String> volumesFrom)
    • addVolumesFromItem

      public PodSpecGenerator addVolumesFromItem(String volumesFromItem)
    • getVolumesFrom

      @Nullable public List<String> getVolumesFrom()
      VolumesFrom is a set of containers whose volumes will be added to this pod. The name or ID of the container must be provided, and may optionally be followed by a : and then one or more comma-separated options. Valid options are 'ro', 'rw', and 'z'. Options will be used for all volumes sourced from the container.
      Returns:
      volumesFrom
    • setVolumesFrom

      public void setVolumesFrom(List<String> volumesFrom)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toJson

      public String toJson()
      Convert an instance of PodSpecGenerator to an JSON string
      Returns:
      JSON string