Class DaemonContainerDefinition

java.lang.Object
software.amazon.awssdk.services.ecs.model.DaemonContainerDefinition
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<DaemonContainerDefinition.Builder,DaemonContainerDefinition>

@Generated("software.amazon.awssdk:codegen") public final class DaemonContainerDefinition extends Object implements SdkPojo, Serializable, ToCopyableBuilder<DaemonContainerDefinition.Builder,DaemonContainerDefinition>

A container definition for a daemon task. Daemon container definitions describe the containers that run as part of a daemon task on container instances managed by capacity providers.

See Also:
  • Method Details

    • name

      public final String name()

      The name of the container. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.

      Returns:
      The name of the container. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.
    • image

      public final String image()

      The image used to start the container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest .

      Returns:
      The image used to start the container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest .
    • memory

      public final Integer memory()

      The amount (in MiB) of memory to present to the container. If the container attempts to exceed the memory specified here, the container is killed.

      Returns:
      The amount (in MiB) of memory to present to the container. If the container attempts to exceed the memory specified here, the container is killed.
    • memoryReservation

      public final Integer memoryReservation()

      The soft limit (in MiB) of memory to reserve for the container.

      Returns:
      The soft limit (in MiB) of memory to reserve for the container.
    • repositoryCredentials

      public final RepositoryCredentials repositoryCredentials()

      The private repository authentication credentials to use.

      Returns:
      The private repository authentication credentials to use.
    • healthCheck

      public final HealthCheck healthCheck()

      The container health check command and associated configuration parameters for the container.

      Returns:
      The container health check command and associated configuration parameters for the container.
    • cpu

      public final Integer cpu()

      The number of cpu units reserved for the container.

      Returns:
      The number of cpu units reserved for the container.
    • essential

      public final Boolean essential()

      If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped.

      Returns:
      If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped.
    • hasEntryPoint

      public final boolean hasEntryPoint()
      For responses, this returns true if the service returned a value for the EntryPoint property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • entryPoint

      public final List<String> entryPoint()

      The entry point that's passed to the container.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasEntryPoint() method.

      Returns:
      The entry point that's passed to the container.
    • hasCommand

      public final boolean hasCommand()
      For responses, this returns true if the service returned a value for the Command property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • command

      public final List<String> command()

      The command that's passed to the container.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasCommand() method.

      Returns:
      The command that's passed to the container.
    • workingDirectory

      public final String workingDirectory()

      The working directory to run commands inside the container in.

      Returns:
      The working directory to run commands inside the container in.
    • hasEnvironmentFiles

      public final boolean hasEnvironmentFiles()
      For responses, this returns true if the service returned a value for the EnvironmentFiles property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • environmentFiles

      public final List<EnvironmentFile> environmentFiles()

      A list of files containing the environment variables to pass to a container.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasEnvironmentFiles() method.

      Returns:
      A list of files containing the environment variables to pass to a container.
    • hasEnvironment

      public final boolean hasEnvironment()
      For responses, this returns true if the service returned a value for the Environment property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • environment

      public final List<KeyValuePair> environment()

      The environment variables to pass to a container.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasEnvironment() method.

      Returns:
      The environment variables to pass to a container.
    • hasSecrets

      public final boolean hasSecrets()
      For responses, this returns true if the service returned a value for the Secrets property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • secrets

      public final List<Secret> secrets()

      The secrets to pass to the container.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasSecrets() method.

      Returns:
      The secrets to pass to the container.
    • readonlyRootFilesystem

      public final Boolean readonlyRootFilesystem()

      When this parameter is true, the container is given read-only access to its root file system.

      Returns:
      When this parameter is true, the container is given read-only access to its root file system.
    • hasMountPoints

      public final boolean hasMountPoints()
      For responses, this returns true if the service returned a value for the MountPoints property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • mountPoints

      public final List<MountPoint> mountPoints()

      The mount points for data volumes in your container.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasMountPoints() method.

      Returns:
      The mount points for data volumes in your container.
    • logConfiguration

      public final LogConfiguration logConfiguration()

      The log configuration specification for the container.

      Returns:
      The log configuration specification for the container.
    • firelensConfiguration

      public final FirelensConfiguration firelensConfiguration()

      The FireLens configuration for the container. This is used to specify and configure a log router for container logs.

      Returns:
      The FireLens configuration for the container. This is used to specify and configure a log router for container logs.
    • privileged

      public final Boolean privileged()

      When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).

      Returns:
      When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).
    • user

      public final String user()

      The user to use inside the container.

      Returns:
      The user to use inside the container.
    • hasUlimits

      public final boolean hasUlimits()
      For responses, this returns true if the service returned a value for the Ulimits property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • ulimits

      public final List<Ulimit> ulimits()

      A list of ulimits to set in the container.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasUlimits() method.

      Returns:
      A list of ulimits to set in the container.
    • linuxParameters

      public final DaemonLinuxParameters linuxParameters()

      Linux-specific modifications that are applied to the container configuration, such as Linux kernel capabilities.

      Returns:
      Linux-specific modifications that are applied to the container configuration, such as Linux kernel capabilities.
    • hasDependsOn

      public final boolean hasDependsOn()
      For responses, this returns true if the service returned a value for the DependsOn property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • dependsOn

      public final List<ContainerDependency> dependsOn()

      The dependencies defined for container startup and shutdown. A container can contain multiple dependencies on other containers in a task definition.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasDependsOn() method.

      Returns:
      The dependencies defined for container startup and shutdown. A container can contain multiple dependencies on other containers in a task definition.
    • startTimeout

      public final Integer startTimeout()

      Time duration (in seconds) to wait before giving up on resolving dependencies for a container.

      Returns:
      Time duration (in seconds) to wait before giving up on resolving dependencies for a container.
    • stopTimeout

      public final Integer stopTimeout()

      Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.

      Returns:
      Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.
    • hasSystemControls

      public final boolean hasSystemControls()
      For responses, this returns true if the service returned a value for the SystemControls property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • systemControls

      public final List<SystemControl> systemControls()

      A list of namespaced kernel parameters to set in the container.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasSystemControls() method.

      Returns:
      A list of namespaced kernel parameters to set in the container.
    • interactive

      public final Boolean interactive()

      When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated.

      Returns:
      When this parameter is true, you can deploy containerized applications that require stdin or a tty to be allocated.
    • pseudoTerminal

      public final Boolean pseudoTerminal()

      When this parameter is true, a TTY is allocated.

      Returns:
      When this parameter is true, a TTY is allocated.
    • restartPolicy

      public final ContainerRestartPolicy restartPolicy()

      The restart policy for the container. When you set up a restart policy, Amazon ECS can restart the container without needing to replace the task.

      Returns:
      The restart policy for the container. When you set up a restart policy, Amazon ECS can restart the container without needing to replace the task.
    • toBuilder

      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<DaemonContainerDefinition.Builder,DaemonContainerDefinition>
      Returns:
      a builder for type T
    • builder

      public static DaemonContainerDefinition.Builder builder()
    • serializableBuilderClass

      public static Class<? extends DaemonContainerDefinition.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.