All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cdk8s.plus31.PodProps Maven / Gradle / Ivy

package org.cdk8s.plus31;

/**
 * Properties for Pod.
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T12:15:24.882Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.plus31.$Module.class, fqn = "cdk8s-plus-31.PodProps")
@software.amazon.jsii.Jsii.Proxy(PodProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface PodProps extends software.amazon.jsii.JsiiSerializable, org.cdk8s.plus31.AbstractPodProps {

    /**
     * @return a {@link Builder} of {@link PodProps}
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    static Builder builder() {
        return new Builder();
    }
    /**
     * A builder for {@link PodProps}
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public static final class Builder implements software.amazon.jsii.Builder {
        java.lang.Boolean automountServiceAccountToken;
        java.util.List containers;
        org.cdk8s.plus31.PodDnsProps dns;
        org.cdk8s.plus31.ISecret dockerRegistryAuth;
        java.util.List hostAliases;
        java.lang.Boolean hostNetwork;
        java.util.List initContainers;
        java.lang.Boolean isolate;
        org.cdk8s.plus31.RestartPolicy restartPolicy;
        org.cdk8s.plus31.PodSecurityContextProps securityContext;
        org.cdk8s.plus31.IServiceAccount serviceAccount;
        org.cdk8s.Duration terminationGracePeriod;
        java.util.List volumes;
        org.cdk8s.ApiObjectMetadata metadata;

        /**
         * Sets the value of {@link PodProps#getAutomountServiceAccountToken}
         * @param automountServiceAccountToken Indicates whether a service account token should be automatically mounted.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
        public Builder automountServiceAccountToken(java.lang.Boolean automountServiceAccountToken) {
            this.automountServiceAccountToken = automountServiceAccountToken;
            return this;
        }

        /**
         * Sets the value of {@link PodProps#getContainers}
         * @param containers List of containers belonging to the pod.
         *                   Containers cannot currently be
         *                   added or removed. There must be at least one container in a Pod.
         *                   

* You can add additionnal containers using podSpec.addContainer() * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @SuppressWarnings("unchecked") public Builder containers(java.util.List containers) { this.containers = (java.util.List)containers; return this; } /** * Sets the value of {@link PodProps#getDns} * @param dns DNS settings for the pod. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder dns(org.cdk8s.plus31.PodDnsProps dns) { this.dns = dns; return this; } /** * Sets the value of {@link PodProps#getDockerRegistryAuth} * @param dockerRegistryAuth A secret containing docker credentials for authenticating to a registry. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder dockerRegistryAuth(org.cdk8s.plus31.ISecret dockerRegistryAuth) { this.dockerRegistryAuth = dockerRegistryAuth; return this; } /** * Sets the value of {@link PodProps#getHostAliases} * @param hostAliases HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @SuppressWarnings("unchecked") public Builder hostAliases(java.util.List hostAliases) { this.hostAliases = (java.util.List)hostAliases; return this; } /** * Sets the value of {@link PodProps#getHostNetwork} * @param hostNetwork Host network for the pod. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder hostNetwork(java.lang.Boolean hostNetwork) { this.hostNetwork = hostNetwork; return this; } /** * Sets the value of {@link PodProps#getInitContainers} * @param initContainers List of initialization containers belonging to the pod. * Init containers are executed in order prior to containers being started. * If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. * The name for an init container or normal container must be unique among all containers. * Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. * The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit * for each resource type, and then using the max of of that value or the sum of the normal containers. * Limits are applied to init containers in a similar fashion. *

* Init containers cannot currently be added ,removed or updated. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @SuppressWarnings("unchecked") public Builder initContainers(java.util.List initContainers) { this.initContainers = (java.util.List)initContainers; return this; } /** * Sets the value of {@link PodProps#getIsolate} * @param isolate Isolates the pod. * This will prevent any ingress or egress connections to / from this pod. * You can however allow explicit connections post instantiation by using the .connections property. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder isolate(java.lang.Boolean isolate) { this.isolate = isolate; return this; } /** * Sets the value of {@link PodProps#getRestartPolicy} * @param restartPolicy Restart policy for all containers within the pod. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder restartPolicy(org.cdk8s.plus31.RestartPolicy restartPolicy) { this.restartPolicy = restartPolicy; return this; } /** * Sets the value of {@link PodProps#getSecurityContext} * @param securityContext SecurityContext holds pod-level security attributes and common container settings. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder securityContext(org.cdk8s.plus31.PodSecurityContextProps securityContext) { this.securityContext = securityContext; return this; } /** * Sets the value of {@link PodProps#getServiceAccount} * @param serviceAccount A service account provides an identity for processes that run in a Pod. * When you (a human) access the cluster (for example, using kubectl), you are * authenticated by the apiserver as a particular User Account (currently this * is usually admin, unless your cluster administrator has customized your * cluster). Processes in containers inside pods can also contact the * apiserver. When they do, they are authenticated as a particular Service * Account (for example, default). * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder serviceAccount(org.cdk8s.plus31.IServiceAccount serviceAccount) { this.serviceAccount = serviceAccount; return this; } /** * Sets the value of {@link PodProps#getTerminationGracePeriod} * @param terminationGracePeriod Grace period until the pod is terminated. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder terminationGracePeriod(org.cdk8s.Duration terminationGracePeriod) { this.terminationGracePeriod = terminationGracePeriod; return this; } /** * Sets the value of {@link PodProps#getVolumes} * @param volumes List of volumes that can be mounted by containers belonging to the pod. * You can also add volumes later using podSpec.addVolume() * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @SuppressWarnings("unchecked") public Builder volumes(java.util.List volumes) { this.volumes = (java.util.List)volumes; return this; } /** * Sets the value of {@link PodProps#getMetadata} * @param metadata Metadata that all persisted resources must have, which includes all objects users must create. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder metadata(org.cdk8s.ApiObjectMetadata metadata) { this.metadata = metadata; return this; } /** * Builds the configured instance. * @return a new instance of {@link PodProps} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override public PodProps build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link PodProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements PodProps { private final java.lang.Boolean automountServiceAccountToken; private final java.util.List containers; private final org.cdk8s.plus31.PodDnsProps dns; private final org.cdk8s.plus31.ISecret dockerRegistryAuth; private final java.util.List hostAliases; private final java.lang.Boolean hostNetwork; private final java.util.List initContainers; private final java.lang.Boolean isolate; private final org.cdk8s.plus31.RestartPolicy restartPolicy; private final org.cdk8s.plus31.PodSecurityContextProps securityContext; private final org.cdk8s.plus31.IServiceAccount serviceAccount; private final org.cdk8s.Duration terminationGracePeriod; private final java.util.List volumes; private final org.cdk8s.ApiObjectMetadata metadata; /** * Constructor that initializes the object based on values retrieved from the JsiiObject. * @param objRef Reference to the JSII managed object. */ protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); this.automountServiceAccountToken = software.amazon.jsii.Kernel.get(this, "automountServiceAccountToken", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class)); this.containers = software.amazon.jsii.Kernel.get(this, "containers", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.ContainerProps.class))); this.dns = software.amazon.jsii.Kernel.get(this, "dns", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.PodDnsProps.class)); this.dockerRegistryAuth = software.amazon.jsii.Kernel.get(this, "dockerRegistryAuth", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.ISecret.class)); this.hostAliases = software.amazon.jsii.Kernel.get(this, "hostAliases", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.HostAlias.class))); this.hostNetwork = software.amazon.jsii.Kernel.get(this, "hostNetwork", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class)); this.initContainers = software.amazon.jsii.Kernel.get(this, "initContainers", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.ContainerProps.class))); this.isolate = software.amazon.jsii.Kernel.get(this, "isolate", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class)); this.restartPolicy = software.amazon.jsii.Kernel.get(this, "restartPolicy", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.RestartPolicy.class)); this.securityContext = software.amazon.jsii.Kernel.get(this, "securityContext", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.PodSecurityContextProps.class)); this.serviceAccount = software.amazon.jsii.Kernel.get(this, "serviceAccount", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.IServiceAccount.class)); this.terminationGracePeriod = software.amazon.jsii.Kernel.get(this, "terminationGracePeriod", software.amazon.jsii.NativeType.forClass(org.cdk8s.Duration.class)); this.volumes = software.amazon.jsii.Kernel.get(this, "volumes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.cdk8s.plus31.Volume.class))); this.metadata = software.amazon.jsii.Kernel.get(this, "metadata", software.amazon.jsii.NativeType.forClass(org.cdk8s.ApiObjectMetadata.class)); } /** * Constructor that initializes the object based on literal property values passed by the {@link Builder}. */ @SuppressWarnings("unchecked") protected Jsii$Proxy(final Builder builder) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); this.automountServiceAccountToken = builder.automountServiceAccountToken; this.containers = (java.util.List)builder.containers; this.dns = builder.dns; this.dockerRegistryAuth = builder.dockerRegistryAuth; this.hostAliases = (java.util.List)builder.hostAliases; this.hostNetwork = builder.hostNetwork; this.initContainers = (java.util.List)builder.initContainers; this.isolate = builder.isolate; this.restartPolicy = builder.restartPolicy; this.securityContext = builder.securityContext; this.serviceAccount = builder.serviceAccount; this.terminationGracePeriod = builder.terminationGracePeriod; this.volumes = (java.util.List)builder.volumes; this.metadata = builder.metadata; } @Override public final java.lang.Boolean getAutomountServiceAccountToken() { return this.automountServiceAccountToken; } @Override public final java.util.List getContainers() { return this.containers; } @Override public final org.cdk8s.plus31.PodDnsProps getDns() { return this.dns; } @Override public final org.cdk8s.plus31.ISecret getDockerRegistryAuth() { return this.dockerRegistryAuth; } @Override public final java.util.List getHostAliases() { return this.hostAliases; } @Override public final java.lang.Boolean getHostNetwork() { return this.hostNetwork; } @Override public final java.util.List getInitContainers() { return this.initContainers; } @Override public final java.lang.Boolean getIsolate() { return this.isolate; } @Override public final org.cdk8s.plus31.RestartPolicy getRestartPolicy() { return this.restartPolicy; } @Override public final org.cdk8s.plus31.PodSecurityContextProps getSecurityContext() { return this.securityContext; } @Override public final org.cdk8s.plus31.IServiceAccount getServiceAccount() { return this.serviceAccount; } @Override public final org.cdk8s.Duration getTerminationGracePeriod() { return this.terminationGracePeriod; } @Override public final java.util.List getVolumes() { return this.volumes; } @Override public final org.cdk8s.ApiObjectMetadata getMetadata() { return this.metadata; } @Override @software.amazon.jsii.Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); if (this.getAutomountServiceAccountToken() != null) { data.set("automountServiceAccountToken", om.valueToTree(this.getAutomountServiceAccountToken())); } if (this.getContainers() != null) { data.set("containers", om.valueToTree(this.getContainers())); } if (this.getDns() != null) { data.set("dns", om.valueToTree(this.getDns())); } if (this.getDockerRegistryAuth() != null) { data.set("dockerRegistryAuth", om.valueToTree(this.getDockerRegistryAuth())); } if (this.getHostAliases() != null) { data.set("hostAliases", om.valueToTree(this.getHostAliases())); } if (this.getHostNetwork() != null) { data.set("hostNetwork", om.valueToTree(this.getHostNetwork())); } if (this.getInitContainers() != null) { data.set("initContainers", om.valueToTree(this.getInitContainers())); } if (this.getIsolate() != null) { data.set("isolate", om.valueToTree(this.getIsolate())); } if (this.getRestartPolicy() != null) { data.set("restartPolicy", om.valueToTree(this.getRestartPolicy())); } if (this.getSecurityContext() != null) { data.set("securityContext", om.valueToTree(this.getSecurityContext())); } if (this.getServiceAccount() != null) { data.set("serviceAccount", om.valueToTree(this.getServiceAccount())); } if (this.getTerminationGracePeriod() != null) { data.set("terminationGracePeriod", om.valueToTree(this.getTerminationGracePeriod())); } if (this.getVolumes() != null) { data.set("volumes", om.valueToTree(this.getVolumes())); } if (this.getMetadata() != null) { data.set("metadata", om.valueToTree(this.getMetadata())); } final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); struct.set("fqn", om.valueToTree("cdk8s-plus-31.PodProps")); struct.set("data", data); final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); obj.set("$jsii.struct", struct); return obj; } @Override public final boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PodProps.Jsii$Proxy that = (PodProps.Jsii$Proxy) o; if (this.automountServiceAccountToken != null ? !this.automountServiceAccountToken.equals(that.automountServiceAccountToken) : that.automountServiceAccountToken != null) return false; if (this.containers != null ? !this.containers.equals(that.containers) : that.containers != null) return false; if (this.dns != null ? !this.dns.equals(that.dns) : that.dns != null) return false; if (this.dockerRegistryAuth != null ? !this.dockerRegistryAuth.equals(that.dockerRegistryAuth) : that.dockerRegistryAuth != null) return false; if (this.hostAliases != null ? !this.hostAliases.equals(that.hostAliases) : that.hostAliases != null) return false; if (this.hostNetwork != null ? !this.hostNetwork.equals(that.hostNetwork) : that.hostNetwork != null) return false; if (this.initContainers != null ? !this.initContainers.equals(that.initContainers) : that.initContainers != null) return false; if (this.isolate != null ? !this.isolate.equals(that.isolate) : that.isolate != null) return false; if (this.restartPolicy != null ? !this.restartPolicy.equals(that.restartPolicy) : that.restartPolicy != null) return false; if (this.securityContext != null ? !this.securityContext.equals(that.securityContext) : that.securityContext != null) return false; if (this.serviceAccount != null ? !this.serviceAccount.equals(that.serviceAccount) : that.serviceAccount != null) return false; if (this.terminationGracePeriod != null ? !this.terminationGracePeriod.equals(that.terminationGracePeriod) : that.terminationGracePeriod != null) return false; if (this.volumes != null ? !this.volumes.equals(that.volumes) : that.volumes != null) return false; return this.metadata != null ? this.metadata.equals(that.metadata) : that.metadata == null; } @Override public final int hashCode() { int result = this.automountServiceAccountToken != null ? this.automountServiceAccountToken.hashCode() : 0; result = 31 * result + (this.containers != null ? this.containers.hashCode() : 0); result = 31 * result + (this.dns != null ? this.dns.hashCode() : 0); result = 31 * result + (this.dockerRegistryAuth != null ? this.dockerRegistryAuth.hashCode() : 0); result = 31 * result + (this.hostAliases != null ? this.hostAliases.hashCode() : 0); result = 31 * result + (this.hostNetwork != null ? this.hostNetwork.hashCode() : 0); result = 31 * result + (this.initContainers != null ? this.initContainers.hashCode() : 0); result = 31 * result + (this.isolate != null ? this.isolate.hashCode() : 0); result = 31 * result + (this.restartPolicy != null ? this.restartPolicy.hashCode() : 0); result = 31 * result + (this.securityContext != null ? this.securityContext.hashCode() : 0); result = 31 * result + (this.serviceAccount != null ? this.serviceAccount.hashCode() : 0); result = 31 * result + (this.terminationGracePeriod != null ? this.terminationGracePeriod.hashCode() : 0); result = 31 * result + (this.volumes != null ? this.volumes.hashCode() : 0); result = 31 * result + (this.metadata != null ? this.metadata.hashCode() : 0); return result; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy