Class SubnetworkLogConfig.Builder (1.18.0)

public static final class SubnetworkLogConfig.Builder extends GeneratedMessageV3.Builder<SubnetworkLogConfig.Builder> implements SubnetworkLogConfigOrBuilder

The available logging options for this subnetwork.

Protobuf type google.cloud.compute.v1.SubnetworkLogConfig

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllMetadataFields(Iterable<String> values)

public SubnetworkLogConfig.Builder addAllMetadataFields(Iterable<String> values)

Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.

repeated string metadata_fields = 378461641;

Parameter
NameDescription
valuesIterable<String>

The metadataFields to add.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

addMetadataFields(String value)

public SubnetworkLogConfig.Builder addMetadataFields(String value)

Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.

repeated string metadata_fields = 378461641;

Parameter
NameDescription
valueString

The metadataFields to add.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

addMetadataFieldsBytes(ByteString value)

public SubnetworkLogConfig.Builder addMetadataFieldsBytes(ByteString value)

Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.

repeated string metadata_fields = 378461641;

Parameter
NameDescription
valueByteString

The bytes of the metadataFields to add.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SubnetworkLogConfig.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides

build()

public SubnetworkLogConfig build()
Returns
TypeDescription
SubnetworkLogConfig

buildPartial()

public SubnetworkLogConfig buildPartial()
Returns
TypeDescription
SubnetworkLogConfig

clear()

public SubnetworkLogConfig.Builder clear()
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides

clearAggregationInterval()

public SubnetworkLogConfig.Builder clearAggregationInterval()

Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Check the AggregationInterval enum for the list of possible values.

optional string aggregation_interval = 174919042;

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

clearEnable()

public SubnetworkLogConfig.Builder clearEnable()

Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled.

optional bool enable = 311764355;

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public SubnetworkLogConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides

clearFilterExpr()

public SubnetworkLogConfig.Builder clearFilterExpr()

Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.

optional string filter_expr = 183374428;

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

clearFlowSampling()

public SubnetworkLogConfig.Builder clearFlowSampling()

Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.

optional float flow_sampling = 530150360;

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

clearMetadata()

public SubnetworkLogConfig.Builder clearMetadata()

Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. Check the Metadata enum for the list of possible values.

optional string metadata = 86866735;

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

clearMetadataFields()

public SubnetworkLogConfig.Builder clearMetadataFields()

Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.

repeated string metadata_fields = 378461641;

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public SubnetworkLogConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides

clone()

public SubnetworkLogConfig.Builder clone()
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides

getAggregationInterval()

public String getAggregationInterval()

Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Check the AggregationInterval enum for the list of possible values.

optional string aggregation_interval = 174919042;

Returns
TypeDescription
String

The aggregationInterval.

getAggregationIntervalBytes()

public ByteString getAggregationIntervalBytes()

Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Check the AggregationInterval enum for the list of possible values.

optional string aggregation_interval = 174919042;

Returns
TypeDescription
ByteString

The bytes for aggregationInterval.

getDefaultInstanceForType()

public SubnetworkLogConfig getDefaultInstanceForType()
Returns
TypeDescription
SubnetworkLogConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getEnable()

public boolean getEnable()

Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled.

optional bool enable = 311764355;

Returns
TypeDescription
boolean

The enable.

getFilterExpr()

public String getFilterExpr()

Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.

optional string filter_expr = 183374428;

Returns
TypeDescription
String

The filterExpr.

getFilterExprBytes()

public ByteString getFilterExprBytes()

Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.

optional string filter_expr = 183374428;

Returns
TypeDescription
ByteString

The bytes for filterExpr.

getFlowSampling()

public float getFlowSampling()

Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.

optional float flow_sampling = 530150360;

Returns
TypeDescription
float

The flowSampling.

getMetadata()

public String getMetadata()

Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. Check the Metadata enum for the list of possible values.

optional string metadata = 86866735;

Returns
TypeDescription
String

The metadata.

getMetadataBytes()

public ByteString getMetadataBytes()

Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. Check the Metadata enum for the list of possible values.

optional string metadata = 86866735;

Returns
TypeDescription
ByteString

The bytes for metadata.

getMetadataFields(int index)

public String getMetadataFields(int index)

Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.

repeated string metadata_fields = 378461641;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The metadataFields at the given index.

getMetadataFieldsBytes(int index)

public ByteString getMetadataFieldsBytes(int index)

Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.

repeated string metadata_fields = 378461641;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the metadataFields at the given index.

getMetadataFieldsCount()

public int getMetadataFieldsCount()

Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.

repeated string metadata_fields = 378461641;

Returns
TypeDescription
int

The count of metadataFields.

getMetadataFieldsList()

public ProtocolStringList getMetadataFieldsList()

Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.

repeated string metadata_fields = 378461641;

Returns
TypeDescription
ProtocolStringList

A list containing the metadataFields.

hasAggregationInterval()

public boolean hasAggregationInterval()

Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Check the AggregationInterval enum for the list of possible values.

optional string aggregation_interval = 174919042;

Returns
TypeDescription
boolean

Whether the aggregationInterval field is set.

hasEnable()

public boolean hasEnable()

Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled.

optional bool enable = 311764355;

Returns
TypeDescription
boolean

Whether the enable field is set.

hasFilterExpr()

public boolean hasFilterExpr()

Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.

optional string filter_expr = 183374428;

Returns
TypeDescription
boolean

Whether the filterExpr field is set.

hasFlowSampling()

public boolean hasFlowSampling()

Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.

optional float flow_sampling = 530150360;

Returns
TypeDescription
boolean

Whether the flowSampling field is set.

hasMetadata()

public boolean hasMetadata()

Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. Check the Metadata enum for the list of possible values.

optional string metadata = 86866735;

Returns
TypeDescription
boolean

Whether the metadata field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(SubnetworkLogConfig other)

public SubnetworkLogConfig.Builder mergeFrom(SubnetworkLogConfig other)
Parameter
NameDescription
otherSubnetworkLogConfig
Returns
TypeDescription
SubnetworkLogConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SubnetworkLogConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public SubnetworkLogConfig.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SubnetworkLogConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides

setAggregationInterval(String value)

public SubnetworkLogConfig.Builder setAggregationInterval(String value)

Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Check the AggregationInterval enum for the list of possible values.

optional string aggregation_interval = 174919042;

Parameter
NameDescription
valueString

The aggregationInterval to set.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

setAggregationIntervalBytes(ByteString value)

public SubnetworkLogConfig.Builder setAggregationIntervalBytes(ByteString value)

Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Check the AggregationInterval enum for the list of possible values.

optional string aggregation_interval = 174919042;

Parameter
NameDescription
valueByteString

The bytes for aggregationInterval to set.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

setEnable(boolean value)

public SubnetworkLogConfig.Builder setEnable(boolean value)

Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled.

optional bool enable = 311764355;

Parameter
NameDescription
valueboolean

The enable to set.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public SubnetworkLogConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides

setFilterExpr(String value)

public SubnetworkLogConfig.Builder setFilterExpr(String value)

Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.

optional string filter_expr = 183374428;

Parameter
NameDescription
valueString

The filterExpr to set.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

setFilterExprBytes(ByteString value)

public SubnetworkLogConfig.Builder setFilterExprBytes(ByteString value)

Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging.

optional string filter_expr = 183374428;

Parameter
NameDescription
valueByteString

The bytes for filterExpr to set.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

setFlowSampling(float value)

public SubnetworkLogConfig.Builder setFlowSampling(float value)

Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported.

optional float flow_sampling = 530150360;

Parameter
NameDescription
valuefloat

The flowSampling to set.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

setMetadata(String value)

public SubnetworkLogConfig.Builder setMetadata(String value)

Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. Check the Metadata enum for the list of possible values.

optional string metadata = 86866735;

Parameter
NameDescription
valueString

The metadata to set.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

setMetadataBytes(ByteString value)

public SubnetworkLogConfig.Builder setMetadataBytes(ByteString value)

Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. Check the Metadata enum for the list of possible values.

optional string metadata = 86866735;

Parameter
NameDescription
valueByteString

The bytes for metadata to set.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

setMetadataFields(int index, String value)

public SubnetworkLogConfig.Builder setMetadataFields(int index, String value)

Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.

repeated string metadata_fields = 378461641;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The metadataFields to set.

Returns
TypeDescription
SubnetworkLogConfig.Builder

This builder for chaining.

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

public SubnetworkLogConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final SubnetworkLogConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SubnetworkLogConfig.Builder
Overrides