Class V1NetworkPolicyEgressRule

java.lang.Object
io.kubernetes.client.openapi.models.V1NetworkPolicyEgressRule

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2025-02-12T21:15:49.397498Z[Etc/UTC]", comments="Generator version: 7.6.0") public class V1NetworkPolicyEgressRule extends Object
NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to. This type is beta-level in 1.8
  • Field Details

  • Constructor Details

    • V1NetworkPolicyEgressRule

      public V1NetworkPolicyEgressRule()
  • Method Details

    • ports

    • addPortsItem

      public V1NetworkPolicyEgressRule addPortsItem(V1NetworkPolicyPort portsItem)
    • getPorts

      @Nullable public List<V1NetworkPolicyPort> getPorts()
      ports is a list of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.
      Returns:
      ports
    • setPorts

      public void setPorts(List<V1NetworkPolicyPort> ports)
    • to

    • addToItem

    • getTo

      @Nullable public List<V1NetworkPolicyPeer> getTo()
      to is a list of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list.
      Returns:
      to
    • setTo

      public void setTo(List<V1NetworkPolicyPeer> to)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to V1NetworkPolicyEgressRule
    • fromJson

      public static V1NetworkPolicyEgressRule fromJson(String jsonString) throws IOException
      Create an instance of V1NetworkPolicyEgressRule given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of V1NetworkPolicyEgressRule
      Throws:
      IOException - if the JSON string is invalid with respect to V1NetworkPolicyEgressRule
    • toJson

      public String toJson()
      Convert an instance of V1NetworkPolicyEgressRule to an JSON string
      Returns:
      JSON string