Class HubConfig.Builder (1.54.0)

public static final class HubConfig.Builder extends GeneratedMessageV3.Builder<HubConfig.Builder> implements HubConfigOrBuilder

Configuration for Policy Controller

Protobuf type google.cloud.gkehub.policycontroller.v1beta.HubConfig

Implements

HubConfigOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllExemptableNamespaces(Iterable<String> values)

public HubConfig.Builder addAllExemptableNamespaces(Iterable<String> values)

The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.

repeated string exemptable_namespaces = 3;

Parameter
Name Description
values Iterable<String>

The exemptableNamespaces to add.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

addExemptableNamespaces(String value)

public HubConfig.Builder addExemptableNamespaces(String value)

The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.

repeated string exemptable_namespaces = 3;

Parameter
Name Description
value String

The exemptableNamespaces to add.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

addExemptableNamespacesBytes(ByteString value)

public HubConfig.Builder addExemptableNamespacesBytes(ByteString value)

The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.

repeated string exemptable_namespaces = 3;

Parameter
Name Description
value ByteString

The bytes of the exemptableNamespaces to add.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public HubConfig build()
Returns
Type Description
HubConfig

buildPartial()

public HubConfig buildPartial()
Returns
Type Description
HubConfig

clear()

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

clearAuditIntervalSeconds()

public HubConfig.Builder clearAuditIntervalSeconds()

Sets the interval for Policy Controller Audit Scans (in seconds). When set to 0, this disables audit functionality altogether.

optional int64 audit_interval_seconds = 2;

Returns
Type Description
HubConfig.Builder

This builder for chaining.

clearConstraintViolationLimit()

public HubConfig.Builder clearConstraintViolationLimit()

The maximum number of audit violations to be stored in a constraint. If not set, the internal default (currently 20) will be used.

optional int64 constraint_violation_limit = 10;

Returns
Type Description
HubConfig.Builder

This builder for chaining.

clearDeploymentConfigs()

public HubConfig.Builder clearDeploymentConfigs()
Returns
Type Description
HubConfig.Builder

clearExemptableNamespaces()

public HubConfig.Builder clearExemptableNamespaces()

The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.

repeated string exemptable_namespaces = 3;

Returns
Type Description
HubConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearInstallSpec()

public HubConfig.Builder clearInstallSpec()

The install_spec represents the intended state specified by the latest request that mutated install_spec in the feature spec, not the lifecycle state of the feature observed by the Hub feature controller that is reported in the feature state.

.google.cloud.gkehub.policycontroller.v1beta.HubConfig.InstallSpec install_spec = 1;

Returns
Type Description
HubConfig.Builder

This builder for chaining.

clearLogDeniesEnabled()

public HubConfig.Builder clearLogDeniesEnabled()

Logs all denies and dry run failures.

bool log_denies_enabled = 5;

Returns
Type Description
HubConfig.Builder

This builder for chaining.

clearMonitoring()

public HubConfig.Builder clearMonitoring()

Monitoring specifies the configuration of monitoring.

optional .google.cloud.gkehub.policycontroller.v1beta.MonitoringConfig monitoring = 8;

Returns
Type Description
HubConfig.Builder

clearMutationEnabled()

public HubConfig.Builder clearMutationEnabled()

Enables the ability to mutate resources using Policy Controller.

bool mutation_enabled = 6;

Returns
Type Description
HubConfig.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPolicyContent()

public HubConfig.Builder clearPolicyContent()

Specifies the desired policy content on the cluster

optional .google.cloud.gkehub.policycontroller.v1beta.PolicyContentSpec policy_content = 9;

Returns
Type Description
HubConfig.Builder

clearReferentialRulesEnabled()

public HubConfig.Builder clearReferentialRulesEnabled()

Enables the ability to use Constraint Templates that reference to objects other than the object currently being evaluated.

bool referential_rules_enabled = 4;

Returns
Type Description
HubConfig.Builder

This builder for chaining.

clone()

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

containsDeploymentConfigs(String key)

public boolean containsDeploymentConfigs(String key)

Map of deployment configs to deployments ("admission", "audit", "mutation').

map<string, .google.cloud.gkehub.policycontroller.v1beta.PolicyControllerDeploymentConfig> deployment_configs = 11;

Parameter
Name Description
key String
Returns
Type Description
boolean

getAuditIntervalSeconds()

public long getAuditIntervalSeconds()

Sets the interval for Policy Controller Audit Scans (in seconds). When set to 0, this disables audit functionality altogether.

optional int64 audit_interval_seconds = 2;

Returns
Type Description
long

The auditIntervalSeconds.

getConstraintViolationLimit()

public long getConstraintViolationLimit()

The maximum number of audit violations to be stored in a constraint. If not set, the internal default (currently 20) will be used.

optional int64 constraint_violation_limit = 10;

Returns
Type Description
long

The constraintViolationLimit.

getDefaultInstanceForType()

public HubConfig getDefaultInstanceForType()
Returns
Type Description
HubConfig

getDeploymentConfigs() (deprecated)

public Map<String,PolicyControllerDeploymentConfig> getDeploymentConfigs()
Returns
Type Description
Map<String,PolicyControllerDeploymentConfig>

getDeploymentConfigsCount()

public int getDeploymentConfigsCount()

Map of deployment configs to deployments ("admission", "audit", "mutation').

map<string, .google.cloud.gkehub.policycontroller.v1beta.PolicyControllerDeploymentConfig> deployment_configs = 11;

Returns
Type Description
int

getDeploymentConfigsMap()

public Map<String,PolicyControllerDeploymentConfig> getDeploymentConfigsMap()

Map of deployment configs to deployments ("admission", "audit", "mutation').

map<string, .google.cloud.gkehub.policycontroller.v1beta.PolicyControllerDeploymentConfig> deployment_configs = 11;

Returns
Type Description
Map<String,PolicyControllerDeploymentConfig>

getDeploymentConfigsOrDefault(String key, PolicyControllerDeploymentConfig defaultValue)

public PolicyControllerDeploymentConfig getDeploymentConfigsOrDefault(String key, PolicyControllerDeploymentConfig defaultValue)

Map of deployment configs to deployments ("admission", "audit", "mutation').

map<string, .google.cloud.gkehub.policycontroller.v1beta.PolicyControllerDeploymentConfig> deployment_configs = 11;

Parameters
Name Description
key String
defaultValue PolicyControllerDeploymentConfig
Returns
Type Description
PolicyControllerDeploymentConfig

getDeploymentConfigsOrThrow(String key)

public PolicyControllerDeploymentConfig getDeploymentConfigsOrThrow(String key)

Map of deployment configs to deployments ("admission", "audit", "mutation').

map<string, .google.cloud.gkehub.policycontroller.v1beta.PolicyControllerDeploymentConfig> deployment_configs = 11;

Parameter
Name Description
key String
Returns
Type Description
PolicyControllerDeploymentConfig

getDescriptorForType()

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

getExemptableNamespaces(int index)

public String getExemptableNamespaces(int index)

The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.

repeated string exemptable_namespaces = 3;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The exemptableNamespaces at the given index.

getExemptableNamespacesBytes(int index)

public ByteString getExemptableNamespacesBytes(int index)

The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.

repeated string exemptable_namespaces = 3;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the exemptableNamespaces at the given index.

getExemptableNamespacesCount()

public int getExemptableNamespacesCount()

The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.

repeated string exemptable_namespaces = 3;

Returns
Type Description
int

The count of exemptableNamespaces.

getExemptableNamespacesList()

public ProtocolStringList getExemptableNamespacesList()

The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.

repeated string exemptable_namespaces = 3;

Returns
Type Description
ProtocolStringList

A list containing the exemptableNamespaces.

getInstallSpec()

public HubConfig.InstallSpec getInstallSpec()

The install_spec represents the intended state specified by the latest request that mutated install_spec in the feature spec, not the lifecycle state of the feature observed by the Hub feature controller that is reported in the feature state.

.google.cloud.gkehub.policycontroller.v1beta.HubConfig.InstallSpec install_spec = 1;

Returns
Type Description
HubConfig.InstallSpec

The installSpec.

getInstallSpecValue()

public int getInstallSpecValue()

The install_spec represents the intended state specified by the latest request that mutated install_spec in the feature spec, not the lifecycle state of the feature observed by the Hub feature controller that is reported in the feature state.

.google.cloud.gkehub.policycontroller.v1beta.HubConfig.InstallSpec install_spec = 1;

Returns
Type Description
int

The enum numeric value on the wire for installSpec.

getLogDeniesEnabled()

public boolean getLogDeniesEnabled()

Logs all denies and dry run failures.

bool log_denies_enabled = 5;

Returns
Type Description
boolean

The logDeniesEnabled.

getMonitoring()

public MonitoringConfig getMonitoring()

Monitoring specifies the configuration of monitoring.

optional .google.cloud.gkehub.policycontroller.v1beta.MonitoringConfig monitoring = 8;

Returns
Type Description
MonitoringConfig

The monitoring.

getMonitoringBuilder()

public MonitoringConfig.Builder getMonitoringBuilder()

Monitoring specifies the configuration of monitoring.

optional .google.cloud.gkehub.policycontroller.v1beta.MonitoringConfig monitoring = 8;

Returns
Type Description
MonitoringConfig.Builder

getMonitoringOrBuilder()

public MonitoringConfigOrBuilder getMonitoringOrBuilder()

Monitoring specifies the configuration of monitoring.

optional .google.cloud.gkehub.policycontroller.v1beta.MonitoringConfig monitoring = 8;

Returns
Type Description
MonitoringConfigOrBuilder

getMutableDeploymentConfigs() (deprecated)

public Map<String,PolicyControllerDeploymentConfig> getMutableDeploymentConfigs()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,PolicyControllerDeploymentConfig>

getMutationEnabled()

public boolean getMutationEnabled()

Enables the ability to mutate resources using Policy Controller.

bool mutation_enabled = 6;

Returns
Type Description
boolean

The mutationEnabled.

getPolicyContent()

public PolicyContentSpec getPolicyContent()

Specifies the desired policy content on the cluster

optional .google.cloud.gkehub.policycontroller.v1beta.PolicyContentSpec policy_content = 9;

Returns
Type Description
PolicyContentSpec

The policyContent.

getPolicyContentBuilder()

public PolicyContentSpec.Builder getPolicyContentBuilder()

Specifies the desired policy content on the cluster

optional .google.cloud.gkehub.policycontroller.v1beta.PolicyContentSpec policy_content = 9;

Returns
Type Description
PolicyContentSpec.Builder

getPolicyContentOrBuilder()

public PolicyContentSpecOrBuilder getPolicyContentOrBuilder()

Specifies the desired policy content on the cluster

optional .google.cloud.gkehub.policycontroller.v1beta.PolicyContentSpec policy_content = 9;

Returns
Type Description
PolicyContentSpecOrBuilder

getReferentialRulesEnabled()

public boolean getReferentialRulesEnabled()

Enables the ability to use Constraint Templates that reference to objects other than the object currently being evaluated.

bool referential_rules_enabled = 4;

Returns
Type Description
boolean

The referentialRulesEnabled.

hasAuditIntervalSeconds()

public boolean hasAuditIntervalSeconds()

Sets the interval for Policy Controller Audit Scans (in seconds). When set to 0, this disables audit functionality altogether.

optional int64 audit_interval_seconds = 2;

Returns
Type Description
boolean

Whether the auditIntervalSeconds field is set.

hasConstraintViolationLimit()

public boolean hasConstraintViolationLimit()

The maximum number of audit violations to be stored in a constraint. If not set, the internal default (currently 20) will be used.

optional int64 constraint_violation_limit = 10;

Returns
Type Description
boolean

Whether the constraintViolationLimit field is set.

hasMonitoring()

public boolean hasMonitoring()

Monitoring specifies the configuration of monitoring.

optional .google.cloud.gkehub.policycontroller.v1beta.MonitoringConfig monitoring = 8;

Returns
Type Description
boolean

Whether the monitoring field is set.

hasPolicyContent()

public boolean hasPolicyContent()

Specifies the desired policy content on the cluster

optional .google.cloud.gkehub.policycontroller.v1beta.PolicyContentSpec policy_content = 9;

Returns
Type Description
boolean

Whether the policyContent field is set.

internalGetFieldAccessorTable()

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

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(HubConfig other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeMonitoring(MonitoringConfig value)

public HubConfig.Builder mergeMonitoring(MonitoringConfig value)

Monitoring specifies the configuration of monitoring.

optional .google.cloud.gkehub.policycontroller.v1beta.MonitoringConfig monitoring = 8;

Parameter
Name Description
value MonitoringConfig
Returns
Type Description
HubConfig.Builder

mergePolicyContent(PolicyContentSpec value)

public HubConfig.Builder mergePolicyContent(PolicyContentSpec value)

Specifies the desired policy content on the cluster

optional .google.cloud.gkehub.policycontroller.v1beta.PolicyContentSpec policy_content = 9;

Parameter
Name Description
value PolicyContentSpec
Returns
Type Description
HubConfig.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllDeploymentConfigs(Map<String,PolicyControllerDeploymentConfig> values)

public HubConfig.Builder putAllDeploymentConfigs(Map<String,PolicyControllerDeploymentConfig> values)

Map of deployment configs to deployments ("admission", "audit", "mutation').

map<string, .google.cloud.gkehub.policycontroller.v1beta.PolicyControllerDeploymentConfig> deployment_configs = 11;

Parameter
Name Description
values Map<String,PolicyControllerDeploymentConfig>
Returns
Type Description
HubConfig.Builder

putDeploymentConfigs(String key, PolicyControllerDeploymentConfig value)

public HubConfig.Builder putDeploymentConfigs(String key, PolicyControllerDeploymentConfig value)

Map of deployment configs to deployments ("admission", "audit", "mutation').

map<string, .google.cloud.gkehub.policycontroller.v1beta.PolicyControllerDeploymentConfig> deployment_configs = 11;

Parameters
Name Description
key String
value PolicyControllerDeploymentConfig
Returns
Type Description
HubConfig.Builder

putDeploymentConfigsBuilderIfAbsent(String key)

public PolicyControllerDeploymentConfig.Builder putDeploymentConfigsBuilderIfAbsent(String key)

Map of deployment configs to deployments ("admission", "audit", "mutation').

map<string, .google.cloud.gkehub.policycontroller.v1beta.PolicyControllerDeploymentConfig> deployment_configs = 11;

Parameter
Name Description
key String
Returns
Type Description
PolicyControllerDeploymentConfig.Builder

removeDeploymentConfigs(String key)

public HubConfig.Builder removeDeploymentConfigs(String key)

Map of deployment configs to deployments ("admission", "audit", "mutation').

map<string, .google.cloud.gkehub.policycontroller.v1beta.PolicyControllerDeploymentConfig> deployment_configs = 11;

Parameter
Name Description
key String
Returns
Type Description
HubConfig.Builder

setAuditIntervalSeconds(long value)

public HubConfig.Builder setAuditIntervalSeconds(long value)

Sets the interval for Policy Controller Audit Scans (in seconds). When set to 0, this disables audit functionality altogether.

optional int64 audit_interval_seconds = 2;

Parameter
Name Description
value long

The auditIntervalSeconds to set.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

setConstraintViolationLimit(long value)

public HubConfig.Builder setConstraintViolationLimit(long value)

The maximum number of audit violations to be stored in a constraint. If not set, the internal default (currently 20) will be used.

optional int64 constraint_violation_limit = 10;

Parameter
Name Description
value long

The constraintViolationLimit to set.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

setExemptableNamespaces(int index, String value)

public HubConfig.Builder setExemptableNamespaces(int index, String value)

The set of namespaces that are excluded from Policy Controller checks. Namespaces do not need to currently exist on the cluster.

repeated string exemptable_namespaces = 3;

Parameters
Name Description
index int

The index to set the value at.

value String

The exemptableNamespaces to set.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setInstallSpec(HubConfig.InstallSpec value)

public HubConfig.Builder setInstallSpec(HubConfig.InstallSpec value)

The install_spec represents the intended state specified by the latest request that mutated install_spec in the feature spec, not the lifecycle state of the feature observed by the Hub feature controller that is reported in the feature state.

.google.cloud.gkehub.policycontroller.v1beta.HubConfig.InstallSpec install_spec = 1;

Parameter
Name Description
value HubConfig.InstallSpec

The installSpec to set.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

setInstallSpecValue(int value)

public HubConfig.Builder setInstallSpecValue(int value)

The install_spec represents the intended state specified by the latest request that mutated install_spec in the feature spec, not the lifecycle state of the feature observed by the Hub feature controller that is reported in the feature state.

.google.cloud.gkehub.policycontroller.v1beta.HubConfig.InstallSpec install_spec = 1;

Parameter
Name Description
value int

The enum numeric value on the wire for installSpec to set.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

setLogDeniesEnabled(boolean value)

public HubConfig.Builder setLogDeniesEnabled(boolean value)

Logs all denies and dry run failures.

bool log_denies_enabled = 5;

Parameter
Name Description
value boolean

The logDeniesEnabled to set.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

setMonitoring(MonitoringConfig value)

public HubConfig.Builder setMonitoring(MonitoringConfig value)

Monitoring specifies the configuration of monitoring.

optional .google.cloud.gkehub.policycontroller.v1beta.MonitoringConfig monitoring = 8;

Parameter
Name Description
value MonitoringConfig
Returns
Type Description
HubConfig.Builder

setMonitoring(MonitoringConfig.Builder builderForValue)

public HubConfig.Builder setMonitoring(MonitoringConfig.Builder builderForValue)

Monitoring specifies the configuration of monitoring.

optional .google.cloud.gkehub.policycontroller.v1beta.MonitoringConfig monitoring = 8;

Parameter
Name Description
builderForValue MonitoringConfig.Builder
Returns
Type Description
HubConfig.Builder

setMutationEnabled(boolean value)

public HubConfig.Builder setMutationEnabled(boolean value)

Enables the ability to mutate resources using Policy Controller.

bool mutation_enabled = 6;

Parameter
Name Description
value boolean

The mutationEnabled to set.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

setPolicyContent(PolicyContentSpec value)

public HubConfig.Builder setPolicyContent(PolicyContentSpec value)

Specifies the desired policy content on the cluster

optional .google.cloud.gkehub.policycontroller.v1beta.PolicyContentSpec policy_content = 9;

Parameter
Name Description
value PolicyContentSpec
Returns
Type Description
HubConfig.Builder

setPolicyContent(PolicyContentSpec.Builder builderForValue)

public HubConfig.Builder setPolicyContent(PolicyContentSpec.Builder builderForValue)

Specifies the desired policy content on the cluster

optional .google.cloud.gkehub.policycontroller.v1beta.PolicyContentSpec policy_content = 9;

Parameter
Name Description
builderForValue PolicyContentSpec.Builder
Returns
Type Description
HubConfig.Builder

setReferentialRulesEnabled(boolean value)

public HubConfig.Builder setReferentialRulesEnabled(boolean value)

Enables the ability to use Constraint Templates that reference to objects other than the object currently being evaluated.

bool referential_rules_enabled = 4;

Parameter
Name Description
value boolean

The referentialRulesEnabled to set.

Returns
Type Description
HubConfig.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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