Class Container.Builder

  • Enclosing class:
    Container

    public static class Container.Builder
    extends Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • displayName

        public Container.Builder displayName​(String displayName)
        A user-friendly name.

        Does not have to be unique, and it’s changeable. Avoid entering confidential information.

        Parameters:
        displayName - the value to set
        Returns:
        this builder
      • compartmentId

        public Container.Builder compartmentId​(String compartmentId)
        The OCID of the compartment that contains the container.
        Parameters:
        compartmentId - the value to set
        Returns:
        this builder
      • freeformTags

        public Container.Builder freeformTags​(Map<String,​String> freeformTags)
        Simple key-value pair that is applied without any predefined name, type or scope.

        Exists for cross-compatibility only. Example: {“bar-key”: “value”}

        Parameters:
        freeformTags - the value to set
        Returns:
        this builder
      • definedTags

        public Container.Builder definedTags​(Map<String,​Map<String,​Object>> definedTags)
        Defined tags for this resource.

        Each key is predefined and scoped to a namespace. Example: {“foo-namespace”: {“bar-key”: “value”}}.

        Parameters:
        definedTags - the value to set
        Returns:
        this builder
      • systemTags

        public Container.Builder systemTags​(Map<String,​Map<String,​Object>> systemTags)
        Usage of system tag keys.

        These predefined keys are scoped to namespaces. Example: {“orcl-cloud”: {“free-tier-retained”: “true”}}.

        Parameters:
        systemTags - the value to set
        Returns:
        this builder
      • availabilityDomain

        public Container.Builder availabilityDomain​(String availabilityDomain)
        The availability domain where the container instance that hosts the container runs.
        Parameters:
        availabilityDomain - the value to set
        Returns:
        this builder
      • faultDomain

        public Container.Builder faultDomain​(String faultDomain)
        The fault domain of the container instance that hosts the container runs.
        Parameters:
        faultDomain - the value to set
        Returns:
        this builder
      • lifecycleState

        public Container.Builder lifecycleState​(Container.LifecycleState lifecycleState)
        The current state of the container.
        Parameters:
        lifecycleState - the value to set
        Returns:
        this builder
      • lifecycleDetails

        public Container.Builder lifecycleDetails​(String lifecycleDetails)
        A message that describes the current state of the container in more detail.

        Can be used to provide actionable information.

        Parameters:
        lifecycleDetails - the value to set
        Returns:
        this builder
      • exitCode

        public Container.Builder exitCode​(Integer exitCode)
        The exit code of the container process when it stopped running.
        Parameters:
        exitCode - the value to set
        Returns:
        this builder
      • timeTerminated

        public Container.Builder timeTerminated​(Date timeTerminated)
        The time when the container last deleted (terminated), in the format defined by RFC 3339.
        Parameters:
        timeTerminated - the value to set
        Returns:
        this builder
      • timeCreated

        public Container.Builder timeCreated​(Date timeCreated)
        The time the container was created, in the format defined by RFC 3339.
        Parameters:
        timeCreated - the value to set
        Returns:
        this builder
      • timeUpdated

        public Container.Builder timeUpdated​(Date timeUpdated)
        The time the container was updated, in the format defined by RFC 3339.
        Parameters:
        timeUpdated - the value to set
        Returns:
        this builder
      • containerInstanceId

        public Container.Builder containerInstanceId​(String containerInstanceId)
        The OCID of the container instance that the container is running on.
        Parameters:
        containerInstanceId - the value to set
        Returns:
        this builder
      • imageUrl

        public Container.Builder imageUrl​(String imageUrl)
        The container image information.

        Currently only supports public Docker registry.

        You can provide either the image name (containerImage), image name with version (containerImagev1), or complete Docker image URL docker.io/library/containerImage:latest.

        If you do not provide a registry, the registry defaults to public Docker hub docker.io/library. The registry used for the container image must be reachable over the VNIC of the container instance.

        Parameters:
        imageUrl - the value to set
        Returns:
        this builder
      • command

        public Container.Builder command​(List<String> command)
        This command overrides ENTRYPOINT process of the container.

        If you do not specify this command, the existing ENTRYPOINT process defined in the image is the default.

        Parameters:
        command - the value to set
        Returns:
        this builder
      • arguments

        public Container.Builder arguments​(List<String> arguments)
        A list of string arguments for the ENTRYPOINT process of the container.

        Many containers use an ENTRYPOINT process pointing to a shell /bin/bash. For those containers, you can use the argument list to specify the main command in the container process.

        Parameters:
        arguments - the value to set
        Returns:
        this builder
      • workingDirectory

        public Container.Builder workingDirectory​(String workingDirectory)
        The working directory within the container’s filesystem for the container process.

        If not specified, the default working directory from the image is used.

        Parameters:
        workingDirectory - the value to set
        Returns:
        this builder
      • environmentVariables

        public Container.Builder environmentVariables​(Map<String,​String> environmentVariables)
        A map of additional environment variables to set in the environment of the ENTRYPOINT process of the container.

        These variables are in addition to any variables already defined in the container’s image.

        Parameters:
        environmentVariables - the value to set
        Returns:
        this builder
      • volumeMounts

        public Container.Builder volumeMounts​(List<VolumeMount> volumeMounts)
        List of the volume mounts.
        Parameters:
        volumeMounts - the value to set
        Returns:
        this builder
      • isResourcePrincipalDisabled

        public Container.Builder isResourcePrincipalDisabled​(Boolean isResourcePrincipalDisabled)
        Determines if the container will have access to the container instance resource principal.

        This method utilizes resource principal version 2.2. For more information on how to use the exposed resource principal elements, see https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication_methods.htm#sdk_authentication_methods_resource_principal.

        Parameters:
        isResourcePrincipalDisabled - the value to set
        Returns:
        this builder
      • containerRestartAttemptCount

        public Container.Builder containerRestartAttemptCount​(Integer containerRestartAttemptCount)
        The number of container restart attempts.

        Depending on the restart policy, a restart might be attempted after a health check failure or a container exit.

        Parameters:
        containerRestartAttemptCount - the value to set
        Returns:
        this builder