Class PodSpecGenerator
java.lang.Object
io.github.alersrt.pod4j.openapi.model.PodSpecGenerator
- All Implemented Interfaces:
Serializable
@Generated("org.openapitools.codegen.languages.JavaClientCodegen")
public class PodSpecGenerator
extends Object
implements Serializable
PodSpecGenerator describes options to create a pod
- 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 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 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 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) addImageVolumesItem(ImageVolume imageVolumesItem) addInfraCommandItem(String infraCommandItem) addMountsItem(Mount mountsItem) addOverlayVolumesItem(OverlayVolume overlayVolumesItem) addPodCreateCommandItem(String podCreateCommandItem) addPodDevicesItem(String podDevicesItem) addPortmappingsItem(PortMapping portmappingsItem) addSecurityOptItem(String securityOptItem) addSharedNamespacesItem(String sharedNamespacesItem) addVolumesFromItem(String volumesFromItem) addVolumesItem(NamedVolume volumesItem) cgroupParent(String cgroupParent) cniNetworks(List<String> cniNetworks) booleanexitPolicy(String exitPolicy) static PodSpecGeneratorCreate an instance of PodSpecGenerator given an JSON stringCgroupParent is the parent for the Cgroup that the pod will create.CNINetworks is a list of CNI networks to join the container to.CPU period of the cpuset, determined by --cpusCPU quota of the cpuset, determined by --cpusDNSOption 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.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.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.ExitPolicy determines the pod's exit and stop behaviour.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.Hostname is the pod's hostname.HostsFile is the base file to create the `/etc/hosts` file inside the infra container.@Valid IDMappingOptionsGet idmappings@Valid List<ImageVolume>Image volumes bind-mount a container-image mount into the pod's infra container.InfraCommand sets the command that will be used to start the infra container.InfraConmonPidFile is a custom path to store the infra container's conmon PID.InfraImage is the image that will be used for the infra container.InfraName is the name that will be used for the infra container.@Valid NamespacegetIpcns()Get ipcnsLabels are key-value pairs that are used to add metadata to pods.Mounts are mounts that will be added to the pod.getName()Name is the name of the pod.@Valid NamespacegetNetns()Get netnsNetworkOptions are additional options for each network Optional.@Valid Map<String,PerNetworkOptions> Map of networks names to ids the container should join to.NoInfra tells the pod not to create an infra container.NoManageHostname indicates that /etc/hostname should not be managed by the pod.NoManageHosts indicates that /etc/hosts should not be managed by the pod.NoManageResolvConf indicates that /etc/resolv.conf should not be managed by the pod.@Valid List<OverlayVolume>Overlay volumes are named volumes that will be added to the pod.@Valid NamespacegetPidns()Get pidnsGet podCreateCommandDevices contains user specified Devices to be added to the Pod@Valid List<PortMapping>PortMappings is a set of ports to map into the infra container.@Valid LinuxResourcesGet resourceLimitsRestartPolicy is the pod's restart policy - an action which will be taken when one or all the containers in the pod exits.RestartRetries is the number of attempts that will be made to restart the container.Get securityOptThe ID of the pod's service container.SharedNamespaces instructs the pod to share a set of namespaces.PodCreateCommand is the command used to create this pod.ShmSize is the size of the tmpfs to mount in at /dev/shm, in bytes.ShmSizeSystemd is the size of systemd-specific tmpfs mounts specifically /run, /run/lock, /var/log/journal and /tmp.Sysctl sets kernel parameters for the pod@Valid Map<String,LinuxThrottleDevice> ThrottleReadBpsDevice contains the rate at which the devices in the pod can be read from/accessed@Valid NamespaceGet userns@Valid NamespacegetUtsns()Get utsns@Valid List<NamedVolume>Volumes are named volumes that will be added to the pod.VolumesFrom is a set of containers whose volumes will be added to this pod.inthashCode()idmappings(IDMappingOptions idmappings) imageVolumes(List<ImageVolume> imageVolumes) infraCommand(List<String> infraCommand) infraConmonPidFile(String infraConmonPidFile) infraImage(String infraImage) networkOptions(Map<String, List<String>> networkOptions) networks(Map<String, PerNetworkOptions> networks) noManageHostname(Boolean noManageHostname) noManageHosts(Boolean noManageHosts) noManageResolvConf(Boolean noManageResolvConf) overlayVolumes(List<OverlayVolume> overlayVolumes) podCreateCommand(List<String> podCreateCommand) podDevices(List<String> podDevices) portmappings(List<PortMapping> portmappings) putLabelsItem(String key, String labelsItem) putNetworkOptionsItem(String key, List<String> networkOptionsItem) putNetworksItem(String key, PerNetworkOptions networksItem) putSysctlItem(String key, String sysctlItem) putThrottleReadBpsDeviceItem(String key, LinuxThrottleDevice throttleReadBpsDeviceItem) resourceLimits(LinuxResources resourceLimits) restartPolicy(String restartPolicy) restartTries(Integer restartTries) securityOpt(List<String> securityOpt) serviceContainerID(String serviceContainerID) voidsetCgroupParent(String cgroupParent) voidsetCniNetworks(List<String> cniNetworks) voidsetCpuPeriod(Integer cpuPeriod) voidsetCpuQuota(Long cpuQuota) voidsetDnsOption(List<String> dnsOption) voidsetDnsSearch(List<String> dnsSearch) voidsetDnsServer(List<String> dnsServer) voidsetExitPolicy(String exitPolicy) voidsetHostadd(List<String> hostadd) voidsetHostname(String hostname) voidsetHostsFile(String hostsFile) voidsetIdmappings(IDMappingOptions idmappings) voidsetImageVolumes(List<ImageVolume> imageVolumes) voidsetInfraCommand(List<String> infraCommand) voidsetInfraConmonPidFile(String infraConmonPidFile) voidsetInfraImage(String infraImage) voidsetInfraName(String infraName) voidvoidvoidvoidvoidvoidsetNetworkOptions(Map<String, List<String>> networkOptions) voidsetNetworks(Map<String, PerNetworkOptions> networks) voidsetNoInfra(Boolean noInfra) voidsetNoManageHostname(Boolean noManageHostname) voidsetNoManageHosts(Boolean noManageHosts) voidsetNoManageResolvConf(Boolean noManageResolvConf) voidsetOverlayVolumes(List<OverlayVolume> overlayVolumes) voidvoidsetPodCreateCommand(List<String> podCreateCommand) voidsetPodDevices(List<String> podDevices) voidsetPortmappings(List<PortMapping> portmappings) voidsetResourceLimits(LinuxResources resourceLimits) voidsetRestartPolicy(String restartPolicy) voidsetRestartTries(Integer restartTries) voidsetSecurityOpt(List<String> securityOpt) voidsetServiceContainerID(String serviceContainerID) voidsetSharedNamespaces(List<String> sharedNamespaces) voidsetShareParent(Boolean shareParent) voidsetShmSize(Long shmSize) voidsetShmSizeSystemd(Long shmSizeSystemd) voidvoidsetThrottleReadBpsDevice(Map<String, LinuxThrottleDevice> throttleReadBpsDevice) voidvoidvoidsetVolumes(List<NamedVolume> volumes) voidsetVolumesFrom(List<String> volumesFrom) sharedNamespaces(List<String> sharedNamespaces) shareParent(Boolean shareParent) shmSizeSystemd(Long shmSizeSystemd) throttleReadBpsDevice(Map<String, LinuxThrottleDevice> throttleReadBpsDevice) toJson()Convert an instance of PodSpecGenerator to an JSON stringtoString()static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj) Validates the JSON Object and throws an exception if issues foundvolumes(List<NamedVolume> volumes) volumesFrom(List<String> volumesFrom)
-
Field Details
-
SERIALIZED_NAME_NETWORKS
- See Also:
-
SERIALIZED_NAME_CGROUP_PARENT
- See Also:
-
SERIALIZED_NAME_CNI_NETWORKS
- See Also:
-
SERIALIZED_NAME_CPU_PERIOD
- See Also:
-
SERIALIZED_NAME_CPU_QUOTA
- See Also:
-
SERIALIZED_NAME_DNS_OPTION
- See Also:
-
SERIALIZED_NAME_DNS_SEARCH
- See Also:
-
SERIALIZED_NAME_DNS_SERVER
- See Also:
-
SERIALIZED_NAME_EXIT_POLICY
- See Also:
-
SERIALIZED_NAME_HOSTADD
- See Also:
-
SERIALIZED_NAME_HOSTNAME
- See Also:
-
SERIALIZED_NAME_HOSTS_FILE
- See Also:
-
SERIALIZED_NAME_IDMAPPINGS
- See Also:
-
SERIALIZED_NAME_IMAGE_VOLUMES
- See Also:
-
SERIALIZED_NAME_INFRA_COMMAND
- See Also:
-
SERIALIZED_NAME_INFRA_CONMON_PID_FILE
- See Also:
-
SERIALIZED_NAME_INFRA_IMAGE
- See Also:
-
SERIALIZED_NAME_INFRA_NAME
- See Also:
-
SERIALIZED_NAME_IPCNS
- See Also:
-
SERIALIZED_NAME_LABELS
- See Also:
-
SERIALIZED_NAME_MOUNTS
- See Also:
-
SERIALIZED_NAME_NAME
- See Also:
-
SERIALIZED_NAME_NETNS
- See Also:
-
SERIALIZED_NAME_NETWORK_OPTIONS
- See Also:
-
SERIALIZED_NAME_NO_INFRA
- See Also:
-
SERIALIZED_NAME_NO_MANAGE_HOSTNAME
- See Also:
-
SERIALIZED_NAME_NO_MANAGE_HOSTS
- See Also:
-
SERIALIZED_NAME_NO_MANAGE_RESOLV_CONF
- See Also:
-
SERIALIZED_NAME_OVERLAY_VOLUMES
- See Also:
-
SERIALIZED_NAME_PIDNS
- See Also:
-
SERIALIZED_NAME_POD_CREATE_COMMAND
- See Also:
-
SERIALIZED_NAME_POD_DEVICES
- See Also:
-
SERIALIZED_NAME_PORTMAPPINGS
- See Also:
-
SERIALIZED_NAME_RESOURCE_LIMITS
- See Also:
-
SERIALIZED_NAME_RESTART_POLICY
- See Also:
-
SERIALIZED_NAME_RESTART_TRIES
- See Also:
-
SERIALIZED_NAME_SECURITY_OPT
- See Also:
-
SERIALIZED_NAME_SERVICE_CONTAINER_I_D
- See Also:
-
SERIALIZED_NAME_SHARE_PARENT
- See Also:
-
SERIALIZED_NAME_SHARED_NAMESPACES
- See Also:
-
SERIALIZED_NAME_SHM_SIZE
- See Also:
-
SERIALIZED_NAME_SHM_SIZE_SYSTEMD
- See Also:
-
SERIALIZED_NAME_SYSCTL
- See Also:
-
SERIALIZED_NAME_THROTTLE_READ_BPS_DEVICE
- See Also:
-
SERIALIZED_NAME_USERNS
- See Also:
-
SERIALIZED_NAME_UTSNS
- See Also:
-
SERIALIZED_NAME_VOLUMES
- See Also:
-
SERIALIZED_NAME_VOLUMES_FROM
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
PodSpecGenerator
public PodSpecGenerator()
-
-
Method Details
-
networks
-
putNetworksItem
-
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
-
cgroupParent
-
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
-
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
-
cpuPeriod
-
getCpuPeriod
CPU period of the cpuset, determined by --cpus- Returns:
- cpuPeriod
-
setCpuPeriod
-
cpuQuota
-
getCpuQuota
CPU quota of the cpuset, determined by --cpus- Returns:
- cpuQuota
-
setCpuQuota
-
dnsOption
-
addDnsOptionItem
-
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
-
dnsSearch
-
addDnsSearchItem
-
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
-
dnsServer
-
addDnsServerItem
-
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
-
exitPolicy
-
getExitPolicy
ExitPolicy determines the pod's exit and stop behaviour.- Returns:
- exitPolicy
-
setExitPolicy
-
hostadd
-
addHostaddItem
-
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
-
hostname
-
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
-
hostsFile
-
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
-
idmappings
-
getIdmappings
Get idmappings- Returns:
- idmappings
-
setIdmappings
-
imageVolumes
-
addImageVolumesItem
-
getImageVolumes
Image volumes bind-mount a container-image mount into the pod's infra container. Optional.- Returns:
- imageVolumes
-
setImageVolumes
-
infraCommand
-
addInfraCommandItem
-
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
-
infraConmonPidFile
-
getInfraConmonPidFile
InfraConmonPidFile is a custom path to store the infra container's conmon PID.- Returns:
- infraConmonPidFile
-
setInfraConmonPidFile
-
infraImage
-
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
-
infraName
-
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
-
ipcns
-
getIpcns
Get ipcns- Returns:
- ipcns
-
setIpcns
-
labels
-
putLabelsItem
-
getLabels
Labels are key-value pairs that are used to add metadata to pods. Optional.- Returns:
- labels
-
setLabels
-
mounts
-
addMountsItem
-
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
-
name
-
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
-
netns
-
getNetns
Get netns- Returns:
- netns
-
setNetns
-
networkOptions
-
putNetworkOptionsItem
-
getNetworkOptions
NetworkOptions are additional options for each network Optional.- Returns:
- networkOptions
-
setNetworkOptions
-
noInfra
-
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
-
noManageHostname
-
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
-
noManageHosts
-
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
-
noManageResolvConf
-
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
-
overlayVolumes
-
addOverlayVolumesItem
-
getOverlayVolumes
Overlay volumes are named volumes that will be added to the pod. Optional.- Returns:
- overlayVolumes
-
setOverlayVolumes
-
pidns
-
getPidns
Get pidns- Returns:
- pidns
-
setPidns
-
podCreateCommand
-
addPodCreateCommandItem
-
getPodCreateCommand
Get podCreateCommand- Returns:
- podCreateCommand
-
setPodCreateCommand
-
podDevices
-
addPodDevicesItem
-
getPodDevices
Devices contains user specified Devices to be added to the Pod- Returns:
- podDevices
-
setPodDevices
-
portmappings
-
addPortmappingsItem
-
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
-
resourceLimits
-
getResourceLimits
Get resourceLimits- Returns:
- resourceLimits
-
setResourceLimits
-
restartPolicy
-
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
-
restartTries
-
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
-
securityOpt
-
addSecurityOptItem
-
getSecurityOpt
Get securityOpt- Returns:
- securityOpt
-
setSecurityOpt
-
serviceContainerID
-
getServiceContainerID
The ID of the pod's service container.- Returns:
- serviceContainerID
-
setServiceContainerID
-
shmSize
-
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
-
shmSizeSystemd
-
getShmSizeSystemd
ShmSizeSystemd is the size of systemd-specific tmpfs mounts specifically /run, /run/lock, /var/log/journal and /tmp. Optional- Returns:
- shmSizeSystemd
-
setShmSizeSystemd
-
sysctl
-
putSysctlItem
-
getSysctl
Sysctl sets kernel parameters for the pod- Returns:
- sysctl
-
setSysctl
-
throttleReadBpsDevice
public PodSpecGenerator throttleReadBpsDevice(Map<String, LinuxThrottleDevice> throttleReadBpsDevice) -
putThrottleReadBpsDeviceItem
public PodSpecGenerator putThrottleReadBpsDeviceItem(String key, LinuxThrottleDevice throttleReadBpsDeviceItem) -
getThrottleReadBpsDevice
ThrottleReadBpsDevice contains the rate at which the devices in the pod can be read from/accessed- Returns:
- throttleReadBpsDevice
-
setThrottleReadBpsDevice
-
userns
-
getUserns
Get userns- Returns:
- userns
-
setUserns
-
utsns
-
getUtsns
Get utsns- Returns:
- utsns
-
setUtsns
-
volumes
-
addVolumesItem
-
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
-
volumesFrom
-
addVolumesFromItem
-
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
-
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 PodSpecGenerator
-
fromJson
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
-
toJson
Convert an instance of PodSpecGenerator to an JSON string- Returns:
- JSON string
-