Class Generated.NetworkPolicySpec

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable, Generated.NetworkPolicySpecOrBuilder
    Enclosing class:
    Generated

    public static final class Generated.NetworkPolicySpec
    extends com.google.protobuf.GeneratedMessageV3
    implements Generated.NetworkPolicySpecOrBuilder
     NetworkPolicySpec provides the specification of a NetworkPolicy
     
    Protobuf type k8s.io.api.networking.v1.NetworkPolicySpec
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasPodSelector

        public boolean hasPodSelector()
         podSelector selects the pods to which this NetworkPolicy object applies.
         The array of ingress rules is applied to any pods selected by this field.
         Multiple network policies can select the same set of pods. In this case,
         the ingress rules for each are combined additively.
         This field is NOT optional and follows standard label selector semantics.
         An empty podSelector matches all pods in this namespace.
         
        optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
        Specified by:
        hasPodSelector in interface Generated.NetworkPolicySpecOrBuilder
        Returns:
        Whether the podSelector field is set.
      • getPodSelector

        public Generated.LabelSelector getPodSelector()
         podSelector selects the pods to which this NetworkPolicy object applies.
         The array of ingress rules is applied to any pods selected by this field.
         Multiple network policies can select the same set of pods. In this case,
         the ingress rules for each are combined additively.
         This field is NOT optional and follows standard label selector semantics.
         An empty podSelector matches all pods in this namespace.
         
        optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
        Specified by:
        getPodSelector in interface Generated.NetworkPolicySpecOrBuilder
        Returns:
        The podSelector.
      • getPodSelectorOrBuilder

        public Generated.LabelSelectorOrBuilder getPodSelectorOrBuilder()
         podSelector selects the pods to which this NetworkPolicy object applies.
         The array of ingress rules is applied to any pods selected by this field.
         Multiple network policies can select the same set of pods. In this case,
         the ingress rules for each are combined additively.
         This field is NOT optional and follows standard label selector semantics.
         An empty podSelector matches all pods in this namespace.
         
        optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector podSelector = 1;
        Specified by:
        getPodSelectorOrBuilder in interface Generated.NetworkPolicySpecOrBuilder
      • getIngressList

        public List<Generated.NetworkPolicyIngressRule> getIngressList()
         ingress is a list of ingress rules to be applied to the selected pods.
         Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
         (and cluster policy otherwise allows the traffic), OR if the traffic source is
         the pod's local node, OR if the traffic matches at least one ingress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy does not allow any traffic (and serves
         solely to ensure that the pods it selects are isolated by default)
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyIngressRule ingress = 2;
        Specified by:
        getIngressList in interface Generated.NetworkPolicySpecOrBuilder
      • getIngressOrBuilderList

        public List<? extends Generated.NetworkPolicyIngressRuleOrBuilder> getIngressOrBuilderList()
         ingress is a list of ingress rules to be applied to the selected pods.
         Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
         (and cluster policy otherwise allows the traffic), OR if the traffic source is
         the pod's local node, OR if the traffic matches at least one ingress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy does not allow any traffic (and serves
         solely to ensure that the pods it selects are isolated by default)
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyIngressRule ingress = 2;
        Specified by:
        getIngressOrBuilderList in interface Generated.NetworkPolicySpecOrBuilder
      • getIngressCount

        public int getIngressCount()
         ingress is a list of ingress rules to be applied to the selected pods.
         Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
         (and cluster policy otherwise allows the traffic), OR if the traffic source is
         the pod's local node, OR if the traffic matches at least one ingress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy does not allow any traffic (and serves
         solely to ensure that the pods it selects are isolated by default)
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyIngressRule ingress = 2;
        Specified by:
        getIngressCount in interface Generated.NetworkPolicySpecOrBuilder
      • getIngress

        public Generated.NetworkPolicyIngressRule getIngress​(int index)
         ingress is a list of ingress rules to be applied to the selected pods.
         Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
         (and cluster policy otherwise allows the traffic), OR if the traffic source is
         the pod's local node, OR if the traffic matches at least one ingress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy does not allow any traffic (and serves
         solely to ensure that the pods it selects are isolated by default)
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyIngressRule ingress = 2;
        Specified by:
        getIngress in interface Generated.NetworkPolicySpecOrBuilder
      • getIngressOrBuilder

        public Generated.NetworkPolicyIngressRuleOrBuilder getIngressOrBuilder​(int index)
         ingress is a list of ingress rules to be applied to the selected pods.
         Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
         (and cluster policy otherwise allows the traffic), OR if the traffic source is
         the pod's local node, OR if the traffic matches at least one ingress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy does not allow any traffic (and serves
         solely to ensure that the pods it selects are isolated by default)
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyIngressRule ingress = 2;
        Specified by:
        getIngressOrBuilder in interface Generated.NetworkPolicySpecOrBuilder
      • getEgressList

        public List<Generated.NetworkPolicyEgressRule> getEgressList()
         egress is a list of egress rules to be applied to the selected pods. Outgoing traffic
         is allowed if there are no NetworkPolicies selecting the pod (and cluster policy
         otherwise allows the traffic), OR if the traffic matches at least one egress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
         solely to ensure that the pods it selects are isolated by default).
         This field is beta-level in 1.8
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyEgressRule egress = 3;
        Specified by:
        getEgressList in interface Generated.NetworkPolicySpecOrBuilder
      • getEgressOrBuilderList

        public List<? extends Generated.NetworkPolicyEgressRuleOrBuilder> getEgressOrBuilderList()
         egress is a list of egress rules to be applied to the selected pods. Outgoing traffic
         is allowed if there are no NetworkPolicies selecting the pod (and cluster policy
         otherwise allows the traffic), OR if the traffic matches at least one egress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
         solely to ensure that the pods it selects are isolated by default).
         This field is beta-level in 1.8
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyEgressRule egress = 3;
        Specified by:
        getEgressOrBuilderList in interface Generated.NetworkPolicySpecOrBuilder
      • getEgressCount

        public int getEgressCount()
         egress is a list of egress rules to be applied to the selected pods. Outgoing traffic
         is allowed if there are no NetworkPolicies selecting the pod (and cluster policy
         otherwise allows the traffic), OR if the traffic matches at least one egress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
         solely to ensure that the pods it selects are isolated by default).
         This field is beta-level in 1.8
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyEgressRule egress = 3;
        Specified by:
        getEgressCount in interface Generated.NetworkPolicySpecOrBuilder
      • getEgress

        public Generated.NetworkPolicyEgressRule getEgress​(int index)
         egress is a list of egress rules to be applied to the selected pods. Outgoing traffic
         is allowed if there are no NetworkPolicies selecting the pod (and cluster policy
         otherwise allows the traffic), OR if the traffic matches at least one egress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
         solely to ensure that the pods it selects are isolated by default).
         This field is beta-level in 1.8
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyEgressRule egress = 3;
        Specified by:
        getEgress in interface Generated.NetworkPolicySpecOrBuilder
      • getEgressOrBuilder

        public Generated.NetworkPolicyEgressRuleOrBuilder getEgressOrBuilder​(int index)
         egress is a list of egress rules to be applied to the selected pods. Outgoing traffic
         is allowed if there are no NetworkPolicies selecting the pod (and cluster policy
         otherwise allows the traffic), OR if the traffic matches at least one egress rule
         across all of the NetworkPolicy objects whose podSelector matches the pod. If
         this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
         solely to ensure that the pods it selects are isolated by default).
         This field is beta-level in 1.8
         +optional
         +listType=atomic
         
        repeated .k8s.io.api.networking.v1.NetworkPolicyEgressRule egress = 3;
        Specified by:
        getEgressOrBuilder in interface Generated.NetworkPolicySpecOrBuilder
      • getPolicyTypesList

        public com.google.protobuf.ProtocolStringList getPolicyTypesList()
         policyTypes is a list of rule types that the NetworkPolicy relates to.
         Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"].
         If this field is not specified, it will default based on the existence of ingress or egress rules;
         policies that contain an egress section are assumed to affect egress, and all policies
         (whether or not they contain an ingress section) are assumed to affect ingress.
         If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ].
         Likewise, if you want to write a policy that specifies that no egress is allowed,
         you must specify a policyTypes value that include "Egress" (since such a policy would not include
         an egress section and would otherwise default to just [ "Ingress" ]).
         This field is beta-level in 1.8
         +optional
         +listType=atomic
         
        repeated string policyTypes = 4;
        Specified by:
        getPolicyTypesList in interface Generated.NetworkPolicySpecOrBuilder
        Returns:
        A list containing the policyTypes.
      • getPolicyTypesCount

        public int getPolicyTypesCount()
         policyTypes is a list of rule types that the NetworkPolicy relates to.
         Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"].
         If this field is not specified, it will default based on the existence of ingress or egress rules;
         policies that contain an egress section are assumed to affect egress, and all policies
         (whether or not they contain an ingress section) are assumed to affect ingress.
         If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ].
         Likewise, if you want to write a policy that specifies that no egress is allowed,
         you must specify a policyTypes value that include "Egress" (since such a policy would not include
         an egress section and would otherwise default to just [ "Ingress" ]).
         This field is beta-level in 1.8
         +optional
         +listType=atomic
         
        repeated string policyTypes = 4;
        Specified by:
        getPolicyTypesCount in interface Generated.NetworkPolicySpecOrBuilder
        Returns:
        The count of policyTypes.
      • getPolicyTypes

        public String getPolicyTypes​(int index)
         policyTypes is a list of rule types that the NetworkPolicy relates to.
         Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"].
         If this field is not specified, it will default based on the existence of ingress or egress rules;
         policies that contain an egress section are assumed to affect egress, and all policies
         (whether or not they contain an ingress section) are assumed to affect ingress.
         If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ].
         Likewise, if you want to write a policy that specifies that no egress is allowed,
         you must specify a policyTypes value that include "Egress" (since such a policy would not include
         an egress section and would otherwise default to just [ "Ingress" ]).
         This field is beta-level in 1.8
         +optional
         +listType=atomic
         
        repeated string policyTypes = 4;
        Specified by:
        getPolicyTypes in interface Generated.NetworkPolicySpecOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The policyTypes at the given index.
      • getPolicyTypesBytes

        public com.google.protobuf.ByteString getPolicyTypesBytes​(int index)
         policyTypes is a list of rule types that the NetworkPolicy relates to.
         Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"].
         If this field is not specified, it will default based on the existence of ingress or egress rules;
         policies that contain an egress section are assumed to affect egress, and all policies
         (whether or not they contain an ingress section) are assumed to affect ingress.
         If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ].
         Likewise, if you want to write a policy that specifies that no egress is allowed,
         you must specify a policyTypes value that include "Egress" (since such a policy would not include
         an egress section and would otherwise default to just [ "Ingress" ]).
         This field is beta-level in 1.8
         +optional
         +listType=atomic
         
        repeated string policyTypes = 4;
        Specified by:
        getPolicyTypesBytes in interface Generated.NetworkPolicySpecOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the policyTypes at the given index.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Generated.NetworkPolicySpec parseFrom​(ByteBuffer data)
                                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Generated.NetworkPolicySpec parseFrom​(ByteBuffer data,
                                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Generated.NetworkPolicySpec parseFrom​(com.google.protobuf.ByteString data)
                                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Generated.NetworkPolicySpec parseFrom​(com.google.protobuf.ByteString data,
                                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Generated.NetworkPolicySpec parseFrom​(byte[] data)
                                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Generated.NetworkPolicySpec parseFrom​(byte[] data,
                                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • newBuilderForType

        public Generated.NetworkPolicySpec.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public Generated.NetworkPolicySpec.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected Generated.NetworkPolicySpec.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<Generated.NetworkPolicySpec> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public Generated.NetworkPolicySpec getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder