Class ContainerDefinition
- java.lang.Object
-
- software.amazon.awssdk.services.gamelift.model.ContainerDefinition
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<ContainerDefinition.Builder,ContainerDefinition>
@Generated("software.amazon.awssdk:codegen") public final class ContainerDefinition extends Object implements SdkPojo, Serializable, ToCopyableBuilder<ContainerDefinition.Builder,ContainerDefinition>
This data type is used with the Amazon GameLift containers feature, which is currently in public preview.
Describes a container in a container fleet, the resources available to the container, and the commands that are run when the container starts. Container properties can't be updated. To change a property, create a new container group definition. See also ContainerDefinitionInput.
Part of: ContainerGroupDefinition
Returned by: DescribeContainerGroupDefinition, ListContainerGroupDefinitions
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceContainerDefinition.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContainerDefinition.Builderbuilder()List<String>command()A command that's passed to the container on startup.StringcontainerName()The container definition identifier.Integercpu()The number of CPU units that are reserved for the container.List<ContainerDependency>dependsOn()Indicates that the container relies on the status of other containers in the same container group during its startup and shutdown sequences.List<String>entryPoint()The entry point that's passed to the container on startup.List<ContainerEnvironment>environment()A set of environment variables that's passed to the container on startup.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)Booleanessential()Indicates whether the container is vital to the container group.<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)booleanhasCommand()For responses, this returns true if the service returned a value for the Command property.booleanhasDependsOn()For responses, this returns true if the service returned a value for the DependsOn property.booleanhasEntryPoint()For responses, this returns true if the service returned a value for the EntryPoint property.booleanhasEnvironment()For responses, this returns true if the service returned a value for the Environment property.inthashCode()ContainerHealthCheckhealthCheck()A configuration for a non-terminal health check.StringimageUri()The URI to the image that $short; copied and deployed to a container fleet.ContainerMemoryLimitsmemoryLimits()The amount of memory that Amazon GameLift makes available to the container.ContainerPortConfigurationportConfiguration()Defines the ports that are available to assign to processes in the container.StringresolvedImageDigest()A unique and immutable identifier for the container image that is deployed to a container fleet.List<SdkField<?>>sdkFields()static Class<? extends ContainerDefinition.Builder>serializableBuilderClass()ContainerDefinition.BuildertoBuilder()StringtoString()Returns a string representation of this object.StringworkingDirectory()The directory in the container where commands are run.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
containerName
public final String containerName()
The container definition identifier. Container names are unique within a container group definition.
- Returns:
- The container definition identifier. Container names are unique within a container group definition.
-
imageUri
public final String imageUri()
The URI to the image that $short; copied and deployed to a container fleet. For a more specific identifier, see
ResolvedImageDigest.- Returns:
- The URI to the image that $short; copied and deployed to a container fleet. For a more specific
identifier, see
ResolvedImageDigest.
-
resolvedImageDigest
public final String resolvedImageDigest()
A unique and immutable identifier for the container image that is deployed to a container fleet. The digest is a SHA 256 hash of the container image manifest.
- Returns:
- A unique and immutable identifier for the container image that is deployed to a container fleet. The digest is a SHA 256 hash of the container image manifest.
-
memoryLimits
public final ContainerMemoryLimits memoryLimits()
The amount of memory that Amazon GameLift makes available to the container. If memory limits aren't set for an individual container, the container shares the container group's total memory allocation.
Related data type: ContainerGroupDefinition$TotalMemoryLimit
- Returns:
- The amount of memory that Amazon GameLift makes available to the container. If memory limits aren't set
for an individual container, the container shares the container group's total memory allocation.
Related data type: ContainerGroupDefinition$TotalMemoryLimit
-
portConfiguration
public final ContainerPortConfiguration portConfiguration()
Defines the ports that are available to assign to processes in the container. For example, a game server process requires a container port to allow game clients to connect to it. Container ports aren't directly accessed by inbound traffic. Amazon GameLift maps these container ports to externally accessible connection ports, which are assigned as needed from the container fleet's
ConnectionPortRange.- Returns:
- Defines the ports that are available to assign to processes in the container. For example, a game server
process requires a container port to allow game clients to connect to it. Container ports aren't directly
accessed by inbound traffic. Amazon GameLift maps these container ports to externally accessible
connection ports, which are assigned as needed from the container fleet's
ConnectionPortRange.
-
cpu
public final Integer cpu()
The number of CPU units that are reserved for the container. Note: 1 vCPU unit equals 1024 CPU units. If no resources are reserved, the container shares the total CPU limit for the container group.
Related data type: ContainerGroupDefinition$TotalCpuLimit
- Returns:
- The number of CPU units that are reserved for the container. Note: 1 vCPU unit equals 1024 CPU units. If
no resources are reserved, the container shares the total CPU limit for the container group.
Related data type: ContainerGroupDefinition$TotalCpuLimit
-
healthCheck
public final ContainerHealthCheck healthCheck()
A configuration for a non-terminal health check. A container, which automatically restarts if it stops functioning, also restarts if it fails this health check. If an essential container in the daemon group fails a health check, the entire container group is restarted. The essential container in the replica group doesn't use this health check mechanism, because the Amazon GameLift Agent automatically handles the task.
- Returns:
- A configuration for a non-terminal health check. A container, which automatically restarts if it stops functioning, also restarts if it fails this health check. If an essential container in the daemon group fails a health check, the entire container group is restarted. The essential container in the replica group doesn't use this health check mechanism, because the Amazon GameLift Agent automatically handles the task.
-
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 theisEmpty()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()
A command that's passed to the container on startup. Each argument for the command is an additional string in the array. See the ContainerDefinition::command parameter in the Amazon Elastic Container Service API reference.
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:
- A command that's passed to the container on startup. Each argument for the command is an additional string in the array. See the ContainerDefinition::command parameter in the Amazon Elastic Container Service API reference.
-
essential
public final Boolean essential()
Indicates whether the container is vital to the container group. If an essential container fails, the entire container group is restarted.
- Returns:
- Indicates whether the container is vital to the container group. If an essential container fails, the entire container group is restarted.
-
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 theisEmpty()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 on startup. If there are multiple arguments, each argument is an additional string in the array. See the ContainerDefinition::entryPoint parameter in the Amazon Elastic Container Service API Reference.
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 on startup. If there are multiple arguments, each argument is an additional string in the array. See the ContainerDefinition::entryPoint parameter in the Amazon Elastic Container Service API Reference.
-
workingDirectory
public final String workingDirectory()
The directory in the container where commands are run. See the ContainerDefinition::workingDirectory parameter in the Amazon Elastic Container Service API Reference.
- Returns:
- The directory in the container where commands are run. See the ContainerDefinition::workingDirectory parameter in the Amazon Elastic Container Service API Reference.
-
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 theisEmpty()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<ContainerEnvironment> environment()
A set of environment variables that's passed to the container on startup. See the ContainerDefinition::environment parameter in the Amazon Elastic Container Service API Reference.
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:
- A set of environment variables that's passed to the container on startup. See the ContainerDefinition::environment parameter in the Amazon Elastic Container Service API Reference.
-
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 theisEmpty()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()
Indicates that the container relies on the status of other containers in the same container group during its startup and shutdown sequences. A container might have dependencies on multiple containers.
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:
- Indicates that the container relies on the status of other containers in the same container group during its startup and shutdown sequences. A container might have dependencies on multiple containers.
-
toBuilder
public ContainerDefinition.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<ContainerDefinition.Builder,ContainerDefinition>
-
builder
public static ContainerDefinition.Builder builder()
-
serializableBuilderClass
public static Class<? extends ContainerDefinition.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
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.
-
-