Class AdmissionRule.Builder (1.59.0)

publicstaticfinalclassAdmissionRule.BuilderextendsGeneratedMessageV3.Builder<AdmissionRule.Builder>implementsAdmissionRuleOrBuilder

An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied.

Images matching an admission allowlist pattern are exempted from admission rules and will never block a pod creation.

Protobuf type google.cloud.binaryauthorization.v1beta1.AdmissionRule

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllRequireAttestationsBy(Iterable<String> values)

publicAdmissionRule.BuilderaddAllRequireAttestationsBy(Iterable<String>values)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesIterable<String>

The requireAttestationsBy to add.

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicAdmissionRule.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
AdmissionRule.Builder
Overrides

addRequireAttestationsBy(String value)

publicAdmissionRule.BuilderaddRequireAttestationsBy(Stringvalue)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The requireAttestationsBy to add.

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

addRequireAttestationsByBytes(ByteString value)

publicAdmissionRule.BuilderaddRequireAttestationsByBytes(ByteStringvalue)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes of the requireAttestationsBy to add.

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

build()

publicAdmissionRulebuild()
Returns
TypeDescription
AdmissionRule

buildPartial()

publicAdmissionRulebuildPartial()
Returns
TypeDescription
AdmissionRule

clear()

publicAdmissionRule.Builderclear()
Returns
TypeDescription
AdmissionRule.Builder
Overrides

clearEnforcementMode()

publicAdmissionRule.BuilderclearEnforcementMode()

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

clearEvaluationMode()

publicAdmissionRule.BuilderclearEvaluationMode()

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicAdmissionRule.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
AdmissionRule.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicAdmissionRule.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
AdmissionRule.Builder
Overrides

clearRequireAttestationsBy()

publicAdmissionRule.BuilderclearRequireAttestationsBy()

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

clone()

publicAdmissionRule.Builderclone()
Returns
TypeDescription
AdmissionRule.Builder
Overrides

getDefaultInstanceForType()

publicAdmissionRulegetDefaultInstanceForType()
Returns
TypeDescription
AdmissionRule

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getEnforcementMode()

publicAdmissionRule.EnforcementModegetEnforcementMode()

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
AdmissionRule.EnforcementMode

The enforcementMode.

getEnforcementModeValue()

publicintgetEnforcementModeValue()

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
int

The enum numeric value on the wire for enforcementMode.

getEvaluationMode()

publicAdmissionRule.EvaluationModegetEvaluationMode()

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
AdmissionRule.EvaluationMode

The evaluationMode.

getEvaluationModeValue()

publicintgetEvaluationModeValue()

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
int

The enum numeric value on the wire for evaluationMode.

getRequireAttestationsBy(int index)

publicStringgetRequireAttestationsBy(intindex)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The requireAttestationsBy at the given index.

getRequireAttestationsByBytes(int index)

publicByteStringgetRequireAttestationsByBytes(intindex)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the requireAttestationsBy at the given index.

getRequireAttestationsByCount()

publicintgetRequireAttestationsByCount()

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The count of requireAttestationsBy.

getRequireAttestationsByList()

publicProtocolStringListgetRequireAttestationsByList()

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ProtocolStringList

A list containing the requireAttestationsBy.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(AdmissionRule other)

publicAdmissionRule.BuildermergeFrom(AdmissionRuleother)
Parameter
NameDescription
otherAdmissionRule
Returns
TypeDescription
AdmissionRule.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicAdmissionRule.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AdmissionRule.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

publicAdmissionRule.BuildermergeFrom(Messageother)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
AdmissionRule.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalAdmissionRule.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AdmissionRule.Builder
Overrides

setEnforcementMode(AdmissionRule.EnforcementMode value)

publicAdmissionRule.BuildersetEnforcementMode(AdmissionRule.EnforcementModevalue)

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueAdmissionRule.EnforcementMode

The enforcementMode to set.

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

setEnforcementModeValue(int value)

publicAdmissionRule.BuildersetEnforcementModeValue(intvalue)

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueint

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

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

setEvaluationMode(AdmissionRule.EvaluationMode value)

publicAdmissionRule.BuildersetEvaluationMode(AdmissionRule.EvaluationModevalue)

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueAdmissionRule.EvaluationMode

The evaluationMode to set.

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

setEvaluationModeValue(int value)

publicAdmissionRule.BuildersetEvaluationModeValue(intvalue)

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueint

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

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicAdmissionRule.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
AdmissionRule.Builder
Overrides

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

publicAdmissionRule.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
AdmissionRule.Builder
Overrides

setRequireAttestationsBy(int index, String value)

publicAdmissionRule.BuildersetRequireAttestationsBy(intindex,Stringvalue)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The requireAttestationsBy to set.

Returns
TypeDescription
AdmissionRule.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalAdmissionRule.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
AdmissionRule.Builder
Overrides