Class SecretVolume.Builder (2.50.0)

public static final class SecretVolume.Builder extends GeneratedMessageV3.Builder<SecretVolume.Builder> implements SecretVolumeOrBuilder

Configuration for a secret volume. It has the information necessary to fetch the secret value from secret manager and make it available as files mounted at the requested paths within the application container. Secret value is not a part of the configuration. Every filesystem read operation performs a lookup in secret manager to retrieve the secret value.

Protobuf type google.cloud.functions.v1.SecretVolume

Static Methods

getDescriptor()

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

Methods

addAllVersions(Iterable<? extends SecretVolume.SecretVersion> values)

public SecretVolume.Builder addAllVersions(Iterable<? extends SecretVolume.SecretVersion> values)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameter
Name Description
values Iterable<? extends com.google.cloud.functions.v1.SecretVolume.SecretVersion>
Returns
Type Description
SecretVolume.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SecretVolume.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SecretVolume.Builder
Overrides

addVersions(SecretVolume.SecretVersion value)

public SecretVolume.Builder addVersions(SecretVolume.SecretVersion value)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameter
Name Description
value SecretVolume.SecretVersion
Returns
Type Description
SecretVolume.Builder

addVersions(SecretVolume.SecretVersion.Builder builderForValue)

public SecretVolume.Builder addVersions(SecretVolume.SecretVersion.Builder builderForValue)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameter
Name Description
builderForValue SecretVolume.SecretVersion.Builder
Returns
Type Description
SecretVolume.Builder

addVersions(int index, SecretVolume.SecretVersion value)

public SecretVolume.Builder addVersions(int index, SecretVolume.SecretVersion value)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameters
Name Description
index int
value SecretVolume.SecretVersion
Returns
Type Description
SecretVolume.Builder

addVersions(int index, SecretVolume.SecretVersion.Builder builderForValue)

public SecretVolume.Builder addVersions(int index, SecretVolume.SecretVersion.Builder builderForValue)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameters
Name Description
index int
builderForValue SecretVolume.SecretVersion.Builder
Returns
Type Description
SecretVolume.Builder

addVersionsBuilder()

public SecretVolume.SecretVersion.Builder addVersionsBuilder()

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Returns
Type Description
SecretVolume.SecretVersion.Builder

addVersionsBuilder(int index)

public SecretVolume.SecretVersion.Builder addVersionsBuilder(int index)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameter
Name Description
index int
Returns
Type Description
SecretVolume.SecretVersion.Builder

build()

public SecretVolume build()
Returns
Type Description
SecretVolume

buildPartial()

public SecretVolume buildPartial()
Returns
Type Description
SecretVolume

clear()

public SecretVolume.Builder clear()
Returns
Type Description
SecretVolume.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public SecretVolume.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
SecretVolume.Builder
Overrides

clearMountPath()

public SecretVolume.Builder clearMountPath()

The path within the container to mount the secret volume. For example, setting the mount_path as /etc/secrets would mount the secret value files under the /etc/secrets directory. This directory will also be completely shadowed and unavailable to mount any other secrets.

Recommended mount paths: /etc/secrets Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log

string mount_path = 1;

Returns
Type Description
SecretVolume.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public SecretVolume.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
SecretVolume.Builder
Overrides

clearProjectId()

public SecretVolume.Builder clearProjectId()

Project identifier (preferrably project number but can also be the project ID) of the project that contains the secret. If not set, it will be populated with the function's project assuming that the secret exists in the same project as of the function.

string project_id = 2;

Returns
Type Description
SecretVolume.Builder

This builder for chaining.

clearSecret()

public SecretVolume.Builder clearSecret()

Name of the secret in secret manager (not the full resource name).

string secret = 3;

Returns
Type Description
SecretVolume.Builder

This builder for chaining.

clearVersions()

public SecretVolume.Builder clearVersions()

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Returns
Type Description
SecretVolume.Builder

clone()

public SecretVolume.Builder clone()
Returns
Type Description
SecretVolume.Builder
Overrides

getDefaultInstanceForType()

public SecretVolume getDefaultInstanceForType()
Returns
Type Description
SecretVolume

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMountPath()

public String getMountPath()

The path within the container to mount the secret volume. For example, setting the mount_path as /etc/secrets would mount the secret value files under the /etc/secrets directory. This directory will also be completely shadowed and unavailable to mount any other secrets.

Recommended mount paths: /etc/secrets Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log

string mount_path = 1;

Returns
Type Description
String

The mountPath.

getMountPathBytes()

public ByteString getMountPathBytes()

The path within the container to mount the secret volume. For example, setting the mount_path as /etc/secrets would mount the secret value files under the /etc/secrets directory. This directory will also be completely shadowed and unavailable to mount any other secrets.

Recommended mount paths: /etc/secrets Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log

string mount_path = 1;

Returns
Type Description
ByteString

The bytes for mountPath.

getProjectId()

public String getProjectId()

Project identifier (preferrably project number but can also be the project ID) of the project that contains the secret. If not set, it will be populated with the function's project assuming that the secret exists in the same project as of the function.

string project_id = 2;

Returns
Type Description
String

The projectId.

getProjectIdBytes()

public ByteString getProjectIdBytes()

Project identifier (preferrably project number but can also be the project ID) of the project that contains the secret. If not set, it will be populated with the function's project assuming that the secret exists in the same project as of the function.

string project_id = 2;

Returns
Type Description
ByteString

The bytes for projectId.

getSecret()

public String getSecret()

Name of the secret in secret manager (not the full resource name).

string secret = 3;

Returns
Type Description
String

The secret.

getSecretBytes()

public ByteString getSecretBytes()

Name of the secret in secret manager (not the full resource name).

string secret = 3;

Returns
Type Description
ByteString

The bytes for secret.

getVersions(int index)

public SecretVolume.SecretVersion getVersions(int index)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameter
Name Description
index int
Returns
Type Description
SecretVolume.SecretVersion

getVersionsBuilder(int index)

public SecretVolume.SecretVersion.Builder getVersionsBuilder(int index)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameter
Name Description
index int
Returns
Type Description
SecretVolume.SecretVersion.Builder

getVersionsBuilderList()

public List<SecretVolume.SecretVersion.Builder> getVersionsBuilderList()

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Returns
Type Description
List<Builder>

getVersionsCount()

public int getVersionsCount()

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Returns
Type Description
int

getVersionsList()

public List<SecretVolume.SecretVersion> getVersionsList()

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Returns
Type Description
List<SecretVersion>

getVersionsOrBuilder(int index)

public SecretVolume.SecretVersionOrBuilder getVersionsOrBuilder(int index)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameter
Name Description
index int
Returns
Type Description
SecretVolume.SecretVersionOrBuilder

getVersionsOrBuilderList()

public List<? extends SecretVolume.SecretVersionOrBuilder> getVersionsOrBuilderList()

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Returns
Type Description
List<? extends com.google.cloud.functions.v1.SecretVolume.SecretVersionOrBuilder>

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SecretVolume other)

public SecretVolume.Builder mergeFrom(SecretVolume other)
Parameter
Name Description
other SecretVolume
Returns
Type Description
SecretVolume.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SecretVolume.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SecretVolume.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public SecretVolume.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
SecretVolume.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SecretVolume.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SecretVolume.Builder
Overrides

removeVersions(int index)

public SecretVolume.Builder removeVersions(int index)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameter
Name Description
index int
Returns
Type Description
SecretVolume.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public SecretVolume.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SecretVolume.Builder
Overrides

setMountPath(String value)

public SecretVolume.Builder setMountPath(String value)

The path within the container to mount the secret volume. For example, setting the mount_path as /etc/secrets would mount the secret value files under the /etc/secrets directory. This directory will also be completely shadowed and unavailable to mount any other secrets.

Recommended mount paths: /etc/secrets Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log

string mount_path = 1;

Parameter
Name Description
value String

The mountPath to set.

Returns
Type Description
SecretVolume.Builder

This builder for chaining.

setMountPathBytes(ByteString value)

public SecretVolume.Builder setMountPathBytes(ByteString value)

The path within the container to mount the secret volume. For example, setting the mount_path as /etc/secrets would mount the secret value files under the /etc/secrets directory. This directory will also be completely shadowed and unavailable to mount any other secrets.

Recommended mount paths: /etc/secrets Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log

string mount_path = 1;

Parameter
Name Description
value ByteString

The bytes for mountPath to set.

Returns
Type Description
SecretVolume.Builder

This builder for chaining.

setProjectId(String value)

public SecretVolume.Builder setProjectId(String value)

Project identifier (preferrably project number but can also be the project ID) of the project that contains the secret. If not set, it will be populated with the function's project assuming that the secret exists in the same project as of the function.

string project_id = 2;

Parameter
Name Description
value String

The projectId to set.

Returns
Type Description
SecretVolume.Builder

This builder for chaining.

setProjectIdBytes(ByteString value)

public SecretVolume.Builder setProjectIdBytes(ByteString value)

Project identifier (preferrably project number but can also be the project ID) of the project that contains the secret. If not set, it will be populated with the function's project assuming that the secret exists in the same project as of the function.

string project_id = 2;

Parameter
Name Description
value ByteString

The bytes for projectId to set.

Returns
Type Description
SecretVolume.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public SecretVolume.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SecretVolume.Builder
Overrides

setSecret(String value)

public SecretVolume.Builder setSecret(String value)

Name of the secret in secret manager (not the full resource name).

string secret = 3;

Parameter
Name Description
value String

The secret to set.

Returns
Type Description
SecretVolume.Builder

This builder for chaining.

setSecretBytes(ByteString value)

public SecretVolume.Builder setSecretBytes(ByteString value)

Name of the secret in secret manager (not the full resource name).

string secret = 3;

Parameter
Name Description
value ByteString

The bytes for secret to set.

Returns
Type Description
SecretVolume.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final SecretVolume.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SecretVolume.Builder
Overrides

setVersions(int index, SecretVolume.SecretVersion value)

public SecretVolume.Builder setVersions(int index, SecretVolume.SecretVersion value)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameters
Name Description
index int
value SecretVolume.SecretVersion
Returns
Type Description
SecretVolume.Builder

setVersions(int index, SecretVolume.SecretVersion.Builder builderForValue)

public SecretVolume.Builder setVersions(int index, SecretVolume.SecretVersion.Builder builderForValue)

List of secret versions to mount for this secret. If empty, the latest version of the secret will be made available in a file named after the secret under the mount point.

repeated .google.cloud.functions.v1.SecretVolume.SecretVersion versions = 4;

Parameters
Name Description
index int
builderForValue SecretVolume.SecretVersion.Builder
Returns
Type Description
SecretVolume.Builder