Class Container
- java.lang.Object
-
- com.azure.resourcemanager.containerinstance.models.Container
-
public final class Container extends Object
A container instance.
-
-
Constructor Summary
Constructors Constructor Description Container()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>command()Get the command property: The commands to execute within the container instance in exec form.List<EnvironmentVariable>environmentVariables()Get the environmentVariables property: The environment variables to set in the container instance.Stringimage()Get the image property: The name of the image used to create the container instance.ContainerPropertiesInstanceViewinstanceView()Get the instanceView property: The instance view of the container instance.ContainerProbelivenessProbe()Get the livenessProbe property: The liveness probe.Stringname()Get the name property: The user-provided name of the container instance.List<ContainerPort>ports()Get the ports property: The exposed ports on the container instance.ContainerProbereadinessProbe()Get the readinessProbe property: The readiness probe.ResourceRequirementsresources()Get the resources property: The resource requirements of the container instance.voidvalidate()Validates the instance.List<VolumeMount>volumeMounts()Get the volumeMounts property: The volume mounts available to the container instance.ContainerwithCommand(List<String> command)Set the command property: The commands to execute within the container instance in exec form.ContainerwithEnvironmentVariables(List<EnvironmentVariable> environmentVariables)Set the environmentVariables property: The environment variables to set in the container instance.ContainerwithImage(String image)Set the image property: The name of the image used to create the container instance.ContainerwithLivenessProbe(ContainerProbe livenessProbe)Set the livenessProbe property: The liveness probe.ContainerwithName(String name)Set the name property: The user-provided name of the container instance.ContainerwithPorts(List<ContainerPort> ports)Set the ports property: The exposed ports on the container instance.ContainerwithReadinessProbe(ContainerProbe readinessProbe)Set the readinessProbe property: The readiness probe.ContainerwithResources(ResourceRequirements resources)Set the resources property: The resource requirements of the container instance.ContainerwithVolumeMounts(List<VolumeMount> volumeMounts)Set the volumeMounts property: The volume mounts available to the container instance.
-
-
-
Method Detail
-
name
public String name()
Get the name property: The user-provided name of the container instance.- Returns:
- the name value.
-
withName
public Container withName(String name)
Set the name property: The user-provided name of the container instance.- Parameters:
name- the name value to set.- Returns:
- the Container object itself.
-
image
public String image()
Get the image property: The name of the image used to create the container instance.- Returns:
- the image value.
-
withImage
public Container withImage(String image)
Set the image property: The name of the image used to create the container instance.- Parameters:
image- the image value to set.- Returns:
- the Container object itself.
-
command
public List<String> command()
Get the command property: The commands to execute within the container instance in exec form.- Returns:
- the command value.
-
withCommand
public Container withCommand(List<String> command)
Set the command property: The commands to execute within the container instance in exec form.- Parameters:
command- the command value to set.- Returns:
- the Container object itself.
-
ports
public List<ContainerPort> ports()
Get the ports property: The exposed ports on the container instance.- Returns:
- the ports value.
-
withPorts
public Container withPorts(List<ContainerPort> ports)
Set the ports property: The exposed ports on the container instance.- Parameters:
ports- the ports value to set.- Returns:
- the Container object itself.
-
environmentVariables
public List<EnvironmentVariable> environmentVariables()
Get the environmentVariables property: The environment variables to set in the container instance.- Returns:
- the environmentVariables value.
-
withEnvironmentVariables
public Container withEnvironmentVariables(List<EnvironmentVariable> environmentVariables)
Set the environmentVariables property: The environment variables to set in the container instance.- Parameters:
environmentVariables- the environmentVariables value to set.- Returns:
- the Container object itself.
-
instanceView
public ContainerPropertiesInstanceView instanceView()
Get the instanceView property: The instance view of the container instance. Only valid in response.- Returns:
- the instanceView value.
-
resources
public ResourceRequirements resources()
Get the resources property: The resource requirements of the container instance.- Returns:
- the resources value.
-
withResources
public Container withResources(ResourceRequirements resources)
Set the resources property: The resource requirements of the container instance.- Parameters:
resources- the resources value to set.- Returns:
- the Container object itself.
-
volumeMounts
public List<VolumeMount> volumeMounts()
Get the volumeMounts property: The volume mounts available to the container instance.- Returns:
- the volumeMounts value.
-
withVolumeMounts
public Container withVolumeMounts(List<VolumeMount> volumeMounts)
Set the volumeMounts property: The volume mounts available to the container instance.- Parameters:
volumeMounts- the volumeMounts value to set.- Returns:
- the Container object itself.
-
livenessProbe
public ContainerProbe livenessProbe()
Get the livenessProbe property: The liveness probe.- Returns:
- the livenessProbe value.
-
withLivenessProbe
public Container withLivenessProbe(ContainerProbe livenessProbe)
Set the livenessProbe property: The liveness probe.- Parameters:
livenessProbe- the livenessProbe value to set.- Returns:
- the Container object itself.
-
readinessProbe
public ContainerProbe readinessProbe()
Get the readinessProbe property: The readiness probe.- Returns:
- the readinessProbe value.
-
withReadinessProbe
public Container withReadinessProbe(ContainerProbe readinessProbe)
Set the readinessProbe property: The readiness probe.- Parameters:
readinessProbe- the readinessProbe value to set.- Returns:
- the Container object itself.
-
validate
public void validate()
Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
-