Class PodNetworkConfig

java.lang.Object
io.github.alersrt.pod4j.openapi.model.PodNetworkConfig
All Implemented Interfaces:
Serializable

@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class PodNetworkConfig extends Object implements Serializable
PodNetworkConfig
See Also:
  • Field Details

  • Constructor Details

    • PodNetworkConfig

      public PodNetworkConfig()
  • Method Details

    • networks

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

      public PodNetworkConfig 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)
    • cniNetworks

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

      public PodNetworkConfig 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)
    • dnsOption

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

      public PodNetworkConfig 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 PodNetworkConfig dnsSearch(List<String> dnsSearch)
    • addDnsSearchItem

      public PodNetworkConfig 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 PodNetworkConfig dnsServer(List<String> dnsServer)
    • addDnsServerItem

      public PodNetworkConfig 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)
    • hostadd

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

      public PodNetworkConfig 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)
    • hostsFile

      public PodNetworkConfig hostsFile(String hostsFile)
    • getHostsFile

      @Nullable public String getHostsFile()
      HostsFile is the base file to create the `/etc/hosts` file inside the infra container. This must either be an absolute path to a file on the host system, or one of the special flags `image` or `none`. If it is empty it defaults to the base_hosts_file configuration in containers.conf. Conflicts with NoInfra=true and NoManageHosts. Optional.
      Returns:
      hostsFile
    • setHostsFile

      public void setHostsFile(String hostsFile)
    • netns

      public PodNetworkConfig netns(Namespace netns)
    • getNetns

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

      public void setNetns(Namespace netns)
    • networkOptions

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

      public PodNetworkConfig 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)
    • noManageHostname

      public PodNetworkConfig noManageHostname(Boolean noManageHostname)
    • getNoManageHostname

      @Nullable public Boolean getNoManageHostname()
      NoManageHostname indicates that /etc/hostname should not be managed by the pod. Instead, each container will create a separate etc/hostname as they would if not in a pod.
      Returns:
      noManageHostname
    • setNoManageHostname

      public void setNoManageHostname(Boolean noManageHostname)
    • noManageHosts

      public PodNetworkConfig 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 PodNetworkConfig 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)
    • portmappings

      public PodNetworkConfig portmappings(List<PortMapping> portmappings)
    • addPortmappingsItem

      public PodNetworkConfig addPortmappingsItem(PortMapping portmappingsItem)
    • getPortmappings

      @Nullable @Valid public @Valid List<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<PortMapping> portmappings)
    • 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
    • validateJsonObject

      public static void validateJsonObject(com.google.gson.JsonObject jsonObj) throws IOException
      Validates the JSON Object and throws an exception if issues found
      Parameters:
      jsonObj - JSON Object
      Throws:
      IOException - if the JSON Object is invalid with respect to PodNetworkConfig
    • fromJson

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

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