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:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCniNetworksItem(String cniNetworksItem) addDnsOptionItem(String dnsOptionItem) addDnsSearchItem(String dnsSearchItem) addDnsServerItem(String dnsServerItem) addHostaddItem(String hostaddItem) addPortmappingsItem(PortMapping portmappingsItem) baseHostsFile(String baseHostsFile) cniNetworks(List<String> cniNetworks) booleanstatic ContainerNetworkConfigCreate an instance of ContainerNetworkConfig given an JSON stringBaseHostsFile is the base file to create the `/etc/hosts` file inside the container.CNINetworks is a list of CNI networks to join the container to.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.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.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.Expose is a number of ports that will be forwarded to the container if PublishExposedPorts is set.HostAdd is a set of hosts which will be added to the container's etc/hosts file.@Valid NamespacegetNetns()Get netnsNetworkOptions are additional options for each network Optional.@Valid Map<String,PerNetworkOptions> Map of networks names or ids that the container should join.@Valid List<PortMapping>PortBindings is a set of ports to map into the container.PublishExposedPorts will publish ports specified in the image to random unused ports (guaranteed to be above 1024) on the host.UseImageHostname indicates that /etc/hostname should not be managed by Podman, and instead sourced from the image.UseImageHosts indicates that /etc/hosts should not be managed by Podman, and instead sourced from the image.UseImageResolvConf indicates that resolv.conf should not be managed by Podman, but instead sourced from the image.inthashCode()networkOptions(Map<String, List<String>> networkOptions) networks(Map<String, PerNetworkOptions> networks) portmappings(List<PortMapping> portmappings) publishImagePorts(Boolean publishImagePorts) putNetworkOptionsItem(String key, List<String> networkOptionsItem) putNetworksItem(String key, PerNetworkOptions networksItem) voidsetBaseHostsFile(String baseHostsFile) voidsetCniNetworks(List<String> cniNetworks) voidsetDnsOption(List<String> dnsOption) voidsetDnsSearch(List<String> dnsSearch) voidsetDnsServer(List<String> dnsServer) voidvoidsetHostadd(List<String> hostadd) voidvoidsetNetworkOptions(Map<String, List<String>> networkOptions) voidsetNetworks(Map<String, PerNetworkOptions> networks) voidsetPortmappings(List<PortMapping> portmappings) voidsetPublishImagePorts(Boolean publishImagePorts) voidsetUseImageHostname(Boolean useImageHostname) voidsetUseImageHosts(Boolean useImageHosts) voidsetUseImageResolveConf(Boolean useImageResolveConf) toJson()Convert an instance of ContainerNetworkConfig to an JSON stringtoString()useImageHostname(Boolean useImageHostname) useImageHosts(Boolean useImageHosts) useImageResolveConf(Boolean useImageResolveConf) static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj) Validates the JSON Object and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_NETWORKS
- See Also:
-
SERIALIZED_NAME_BASE_HOSTS_FILE
- See Also:
-
SERIALIZED_NAME_CNI_NETWORKS
- See Also:
-
SERIALIZED_NAME_DNS_OPTION
- See Also:
-
SERIALIZED_NAME_DNS_SEARCH
- See Also:
-
SERIALIZED_NAME_DNS_SERVER
- See Also:
-
SERIALIZED_NAME_EXPOSE
- See Also:
-
SERIALIZED_NAME_HOSTADD
- See Also:
-
SERIALIZED_NAME_NETNS
- See Also:
-
SERIALIZED_NAME_NETWORK_OPTIONS
- See Also:
-
SERIALIZED_NAME_PORTMAPPINGS
- See Also:
-
SERIALIZED_NAME_PUBLISH_IMAGE_PORTS
- See Also:
-
SERIALIZED_NAME_USE_IMAGE_HOSTNAME
- See Also:
-
SERIALIZED_NAME_USE_IMAGE_HOSTS
- See Also:
-
SERIALIZED_NAME_USE_IMAGE_RESOLVE_CONF
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
ContainerNetworkConfig
public ContainerNetworkConfig()
-
-
Method Details
-
networks
-
putNetworksItem
-
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
-
baseHostsFile
-
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
-
cniNetworks
-
addCniNetworksItem
-
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
-
dnsOption
-
addDnsOptionItem
-
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
-
dnsSearch
-
addDnsSearchItem
-
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
-
dnsServer
-
addDnsServerItem
-
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
-
expose
-
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
-
hostadd
-
addHostaddItem
-
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
-
netns
-
getNetns
Get netns- Returns:
- netns
-
setNetns
-
networkOptions
-
putNetworkOptionsItem
-
getNetworkOptions
NetworkOptions are additional options for each network Optional.- Returns:
- networkOptions
-
setNetworkOptions
-
portmappings
-
addPortmappingsItem
-
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
-
publishImagePorts
-
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
-
useImageHostname
-
getUseImageHostname
UseImageHostname indicates that /etc/hostname should not be managed by Podman, and instead sourced from the image. Optional.- Returns:
- useImageHostname
-
setUseImageHostname
-
useImageHosts
-
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
-
useImageResolveConf
-
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
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonObject
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
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
Convert an instance of ContainerNetworkConfig to an JSON string- Returns:
- JSON string
-