Class Container (0.46.0)

public final class Container extends GeneratedMessageV3 implements ContainerOrBuilder

A single application container. This specifies both the container to run, the command to run in the container and the arguments to supply to it. Note that additional arguments can be supplied by the system to the container at runtime.

Protobuf type google.cloud.run.v2.Container

Implements

ContainerOrBuilder

Static Fields

ARGS_FIELD_NUMBER

public static final int ARGS_FIELD_NUMBER
Field Value
Type Description
int

COMMAND_FIELD_NUMBER

public static final int COMMAND_FIELD_NUMBER
Field Value
Type Description
int

DEPENDS_ON_FIELD_NUMBER

public static final int DEPENDS_ON_FIELD_NUMBER
Field Value
Type Description
int

ENV_FIELD_NUMBER

public static final int ENV_FIELD_NUMBER
Field Value
Type Description
int

IMAGE_FIELD_NUMBER

public static final int IMAGE_FIELD_NUMBER
Field Value
Type Description
int

LIVENESS_PROBE_FIELD_NUMBER

public static final int LIVENESS_PROBE_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PORTS_FIELD_NUMBER

public static final int PORTS_FIELD_NUMBER
Field Value
Type Description
int

RESOURCES_FIELD_NUMBER

public static final int RESOURCES_FIELD_NUMBER
Field Value
Type Description
int

STARTUP_PROBE_FIELD_NUMBER

public static final int STARTUP_PROBE_FIELD_NUMBER
Field Value
Type Description
int

VOLUME_MOUNTS_FIELD_NUMBER

public static final int VOLUME_MOUNTS_FIELD_NUMBER
Field Value
Type Description
int

WORKING_DIR_FIELD_NUMBER

public static final int WORKING_DIR_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Container getDefaultInstance()
Returns
Type Description
Container

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Container.Builder newBuilder()
Returns
Type Description
Container.Builder

newBuilder(Container prototype)

public static Container.Builder newBuilder(Container prototype)
Parameter
Name Description
prototype Container
Returns
Type Description
Container.Builder

parseDelimitedFrom(InputStream input)

public static Container parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Container parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Container parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Container parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Container parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Container parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Container parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Container parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Container parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Container parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Container parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Container parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Container
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Container> parser()
Returns
Type Description
Parser<Container>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getArgs(int index)

public String getArgs(int index)

Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

repeated string args = 4;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The args at the given index.

getArgsBytes(int index)

public ByteString getArgsBytes(int index)

Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

repeated string args = 4;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the args at the given index.

getArgsCount()

public int getArgsCount()

Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

repeated string args = 4;

Returns
Type Description
int

The count of args.

getArgsList()

public ProtocolStringList getArgsList()

Arguments to the entrypoint. The docker image's CMD is used if this is not provided.

repeated string args = 4;

Returns
Type Description
ProtocolStringList

A list containing the args.

getCommand(int index)

public String getCommand(int index)

Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

repeated string command = 3;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The command at the given index.

getCommandBytes(int index)

public ByteString getCommandBytes(int index)

Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

repeated string command = 3;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the command at the given index.

getCommandCount()

public int getCommandCount()

Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

repeated string command = 3;

Returns
Type Description
int

The count of command.

getCommandList()

public ProtocolStringList getCommandList()

Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided.

repeated string command = 3;

Returns
Type Description
ProtocolStringList

A list containing the command.

getDefaultInstanceForType()

public Container getDefaultInstanceForType()
Returns
Type Description
Container

getDependsOn(int index)

public String getDependsOn(int index)

Names of the containers that must start before this container.

repeated string depends_on = 12;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The dependsOn at the given index.

getDependsOnBytes(int index)

public ByteString getDependsOnBytes(int index)

Names of the containers that must start before this container.

repeated string depends_on = 12;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the dependsOn at the given index.

getDependsOnCount()

public int getDependsOnCount()

Names of the containers that must start before this container.

repeated string depends_on = 12;

Returns
Type Description
int

The count of dependsOn.

getDependsOnList()

public ProtocolStringList getDependsOnList()

Names of the containers that must start before this container.

repeated string depends_on = 12;

Returns
Type Description
ProtocolStringList

A list containing the dependsOn.

getEnv(int index)

public EnvVar getEnv(int index)

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Parameter
Name Description
index int
Returns
Type Description
EnvVar

getEnvCount()

public int getEnvCount()

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Returns
Type Description
int

getEnvList()

public List<EnvVar> getEnvList()

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Returns
Type Description
List<EnvVar>

getEnvOrBuilder(int index)

public EnvVarOrBuilder getEnvOrBuilder(int index)

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Parameter
Name Description
index int
Returns
Type Description
EnvVarOrBuilder

getEnvOrBuilderList()

public List<? extends EnvVarOrBuilder> getEnvOrBuilderList()

List of environment variables to set in the container.

repeated .google.cloud.run.v2.EnvVar env = 5;

Returns
Type Description
List<? extends com.google.cloud.run.v2.EnvVarOrBuilder>

getImage()

public String getImage()

Required. Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed.

string image = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The image.

getImageBytes()

public ByteString getImageBytes()

Required. Name of the container image in Dockerhub, Google Artifact Registry, or Google Container Registry. If the host is not provided, Dockerhub is assumed.

string image = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for image.

getLivenessProbe()

public Probe getLivenessProbe()

Periodic probe of container liveness. Container will be restarted if the probe fails.

.google.cloud.run.v2.Probe liveness_probe = 10;

Returns
Type Description
Probe

The livenessProbe.

getLivenessProbeOrBuilder()

public ProbeOrBuilder getLivenessProbeOrBuilder()

Periodic probe of container liveness. Container will be restarted if the probe fails.

.google.cloud.run.v2.Probe liveness_probe = 10;

Returns
Type Description
ProbeOrBuilder

getName()

public String getName()

Name of the container specified as a DNS_LABEL (RFC 1123).

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of the container specified as a DNS_LABEL (RFC 1123).

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<Container> getParserForType()
Returns
Type Description
Parser<Container>
Overrides

getPorts(int index)

public ContainerPort getPorts(int index)

List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible.

If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Parameter
Name Description
index int
Returns
Type Description
ContainerPort

getPortsCount()

public int getPortsCount()

List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible.

If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Returns
Type Description
int

getPortsList()

public List<ContainerPort> getPortsList()

List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible.

If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Returns
Type Description
List<ContainerPort>

getPortsOrBuilder(int index)

public ContainerPortOrBuilder getPortsOrBuilder(int index)

List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible.

If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Parameter
Name Description
index int
Returns
Type Description
ContainerPortOrBuilder

getPortsOrBuilderList()

public List<? extends ContainerPortOrBuilder> getPortsOrBuilderList()

List of ports to expose from the container. Only a single port can be specified. The specified ports must be listening on all interfaces (0.0.0.0) within the container to be accessible.

If omitted, a port number will be chosen and passed to the container through the PORT environment variable for the container to listen on.

repeated .google.cloud.run.v2.ContainerPort ports = 7;

Returns
Type Description
List<? extends com.google.cloud.run.v2.ContainerPortOrBuilder>

getResources()

public ResourceRequirements getResources()

Compute Resource requirements by this container.

.google.cloud.run.v2.ResourceRequirements resources = 6;

Returns
Type Description
ResourceRequirements

The resources.

getResourcesOrBuilder()

public ResourceRequirementsOrBuilder getResourcesOrBuilder()

Compute Resource requirements by this container.

.google.cloud.run.v2.ResourceRequirements resources = 6;

Returns
Type Description
ResourceRequirementsOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getStartupProbe()

public Probe getStartupProbe()

Startup probe of application within the container. All other probes are disabled if a startup probe is provided, until it succeeds. Container will not be added to service endpoints if the probe fails.

.google.cloud.run.v2.Probe startup_probe = 11;

Returns
Type Description
Probe

The startupProbe.

getStartupProbeOrBuilder()

public ProbeOrBuilder getStartupProbeOrBuilder()

Startup probe of application within the container. All other probes are disabled if a startup probe is provided, until it succeeds. Container will not be added to service endpoints if the probe fails.

.google.cloud.run.v2.Probe startup_probe = 11;

Returns
Type Description
ProbeOrBuilder

getVolumeMounts(int index)

public VolumeMount getVolumeMounts(int index)

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Parameter
Name Description
index int
Returns
Type Description
VolumeMount

getVolumeMountsCount()

public int getVolumeMountsCount()

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Returns
Type Description
int

getVolumeMountsList()

public List<VolumeMount> getVolumeMountsList()

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Returns
Type Description
List<VolumeMount>

getVolumeMountsOrBuilder(int index)

public VolumeMountOrBuilder getVolumeMountsOrBuilder(int index)

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Parameter
Name Description
index int
Returns
Type Description
VolumeMountOrBuilder

getVolumeMountsOrBuilderList()

public List<? extends VolumeMountOrBuilder> getVolumeMountsOrBuilderList()

Volume to mount into the container's filesystem.

repeated .google.cloud.run.v2.VolumeMount volume_mounts = 8;

Returns
Type Description
List<? extends com.google.cloud.run.v2.VolumeMountOrBuilder>

getWorkingDir()

public String getWorkingDir()

Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image.

string working_dir = 9;

Returns
Type Description
String

The workingDir.

getWorkingDirBytes()

public ByteString getWorkingDirBytes()

Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image.

string working_dir = 9;

Returns
Type Description
ByteString

The bytes for workingDir.

hasLivenessProbe()

public boolean hasLivenessProbe()

Periodic probe of container liveness. Container will be restarted if the probe fails.

.google.cloud.run.v2.Probe liveness_probe = 10;

Returns
Type Description
boolean

Whether the livenessProbe field is set.

hasResources()

public boolean hasResources()

Compute Resource requirements by this container.

.google.cloud.run.v2.ResourceRequirements resources = 6;

Returns
Type Description
boolean

Whether the resources field is set.

hasStartupProbe()

public boolean hasStartupProbe()

Startup probe of application within the container. All other probes are disabled if a startup probe is provided, until it succeeds. Container will not be added to service endpoints if the probe fails.

.google.cloud.run.v2.Probe startup_probe = 11;

Returns
Type Description
boolean

Whether the startupProbe field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Container.Builder newBuilderForType()
Returns
Type Description
Container.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Container.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Container.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Container.Builder toBuilder()
Returns
Type Description
Container.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException