Class ContainerNetworkConfig

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

@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class ContainerNetworkConfig extends Object implements Serializable
ContainerNetworkConfig contains information on a container's network configuration.
See Also:
  • Field Details

  • Constructor Details

    • ContainerNetworkConfig

      public ContainerNetworkConfig()
  • Method Details

    • networks

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

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

      @Nullable @Valid public @Valid Map<String,PerNetworkOptions> getNetworks()
      Map of networks names or ids that the container should join. 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. Optional.
      Returns:
      networks
    • setNetworks

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

      public ContainerNetworkConfig baseHostsFile(String baseHostsFile)
    • getBaseHostsFile

      @Nullable public String getBaseHostsFile()
      BaseHostsFile is the base file to create the `/etc/hosts` file inside the 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. Optional.
      Returns:
      baseHostsFile
    • setBaseHostsFile

      public void setBaseHostsFile(String baseHostsFile)
    • cniNetworks

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

      public ContainerNetworkConfig 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 ContainerNetworkConfig dnsOption(List<String> dnsOption)
    • addDnsOptionItem

      public ContainerNetworkConfig addDnsOptionItem(String dnsOptionItem)
    • getDnsOption

      @Nullable public List<String> getDnsOption()
      DNSOptions is a set of DNS options that will be used in the container's resolv.conf, replacing the host's DNS options which are used by default. Conflicts with UseImageResolvConf. Optional.
      Returns:
      dnsOption
    • setDnsOption

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

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

      public ContainerNetworkConfig addDnsSearchItem(String dnsSearchItem)
    • getDnsSearch

      @Nullable public List<String> getDnsSearch()
      DNSSearch is a set of DNS search domains that will be used in the container's resolv.conf, replacing the host's DNS search domains which are used by default. Conflicts with UseImageResolvConf. Optional.
      Returns:
      dnsSearch
    • setDnsSearch

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

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

      public ContainerNetworkConfig addDnsServerItem(String dnsServerItem)
    • getDnsServer

      @Nullable public List<String> getDnsServer()
      DNSServers is a set of DNS servers that will be used in the container's resolv.conf, replacing the host's DNS Servers which are used by default. Conflicts with UseImageResolvConf. Optional.
      Returns:
      dnsServer
    • setDnsServer

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

      public ContainerNetworkConfig expose(Object expose)
    • getExpose

      @Nullable public Object getExpose()
      Expose is a number of ports that will be forwarded to the container if PublishExposedPorts is set. Expose is a map of uint16 (port number) to a string representing protocol i.e map[uint16]string. Allowed protocols are \"tcp\", \"udp\", and \"sctp\", or some combination of the three separated by commas. If protocol is set to \"\" we will assume TCP. Only available if NetNS is set to Bridge or Slirp, and PublishExposedPorts is set. Optional.
      Returns:
      expose
    • setExpose

      public void setExpose(Object expose)
    • hostadd

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

      public ContainerNetworkConfig addHostaddItem(String hostaddItem)
    • getHostadd

      @Nullable public List<String> getHostadd()
      HostAdd is a set of hosts which will be added to the container's etc/hosts file. Conflicts with UseImageHosts. Optional.
      Returns:
      hostadd
    • setHostadd

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

      public ContainerNetworkConfig netns(Namespace netns)
    • getNetns

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

      public void setNetns(Namespace netns)
    • networkOptions

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

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

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

      public ContainerNetworkConfig addPortmappingsItem(PortMapping portmappingsItem)
    • getPortmappings

      @Nullable @Valid public @Valid List<PortMapping> getPortmappings()
      PortBindings is a set of ports to map into the container. Only available if NetNS is set to bridge, slirp, or pasta. Optional.
      Returns:
      portmappings
    • setPortmappings

      public void setPortmappings(List<PortMapping> portmappings)
    • publishImagePorts

      public ContainerNetworkConfig publishImagePorts(Boolean publishImagePorts)
    • getPublishImagePorts

      @Nullable public Boolean getPublishImagePorts()
      PublishExposedPorts will publish ports specified in the image to random unused ports (guaranteed to be above 1024) on the host. This is based on ports set in Expose below, and any ports specified by the Image (if one is given). Only available if NetNS is set to Bridge or Slirp. Optional.
      Returns:
      publishImagePorts
    • setPublishImagePorts

      public void setPublishImagePorts(Boolean publishImagePorts)
    • useImageHostname

      public ContainerNetworkConfig useImageHostname(Boolean useImageHostname)
    • getUseImageHostname

      @Nullable public Boolean getUseImageHostname()
      UseImageHostname indicates that /etc/hostname should not be managed by Podman, and instead sourced from the image. Optional.
      Returns:
      useImageHostname
    • setUseImageHostname

      public void setUseImageHostname(Boolean useImageHostname)
    • useImageHosts

      public ContainerNetworkConfig useImageHosts(Boolean useImageHosts)
    • getUseImageHosts

      @Nullable public Boolean getUseImageHosts()
      UseImageHosts indicates that /etc/hosts should not be managed by Podman, and instead sourced from the image. Conflicts with HostAdd. Optional.
      Returns:
      useImageHosts
    • setUseImageHosts

      public void setUseImageHosts(Boolean useImageHosts)
    • useImageResolveConf

      public ContainerNetworkConfig useImageResolveConf(Boolean useImageResolveConf)
    • getUseImageResolveConf

      @Nullable public Boolean getUseImageResolveConf()
      UseImageResolvConf indicates that resolv.conf should not be managed by Podman, but instead sourced from the image. Conflicts with DNSServer, DNSSearch, DNSOption. Optional.
      Returns:
      useImageResolveConf
    • setUseImageResolveConf

      public void setUseImageResolveConf(Boolean useImageResolveConf)
    • 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 ContainerNetworkConfig
    • fromJson

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

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