Class SubnetworkLogConfig.Builder (1.88.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
Type Description
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
Name Description
values Iterable<String>

The metadataFields to add.

Returns
Type Description
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
Name Description
value String

The metadataFields to add.

Returns
Type Description
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
Name Description
value ByteString

The bytes of the metadataFields to add.

Returns
Type Description
SubnetworkLogConfig.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public SubnetworkLogConfig build()
Returns
Type Description
SubnetworkLogConfig

buildPartial()

public SubnetworkLogConfig buildPartial()
Returns
Type Description
SubnetworkLogConfig

clear()

public SubnetworkLogConfig.Builder clear()
Returns
Type Description
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
Type Description
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. Flow logging isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.

optional bool enable = 311764355;

Returns
Type Description
SubnetworkLogConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public SubnetworkLogConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
SubnetworkLogConfig.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

public SubnetworkLogConfig.Builder clone()
Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for aggregationInterval.

getDefaultInstanceForType()

public SubnetworkLogConfig getDefaultInstanceForType()
Returns
Type Description
SubnetworkLogConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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. Flow logging isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.

optional bool enable = 311764355;

Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Name Description
index int

The index of the element to return.

Returns
Type Description
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
Name Description
index int

The index of the value to return.

Returns
Type Description
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
Type Description
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
Type Description