Class V1EndpointSlice

java.lang.Object
io.kubernetes.client.openapi.models.V1EndpointSlice
All Implemented Interfaces:
KubernetesObject, KubernetesType

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2025-05-20T20:47:13.890592Z[Etc/UTC]", comments="Generator version: 7.13.0") public class V1EndpointSlice extends Object implements KubernetesObject
EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name.
  • Field Details

  • Constructor Details

    • V1EndpointSlice

      public V1EndpointSlice()
  • Method Details

    • addressType

      public V1EndpointSlice addressType(@Nonnull String addressType)
    • getAddressType

      @Nonnull public String getAddressType()
      addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type.
      Returns:
      addressType
    • setAddressType

      public void setAddressType(@Nonnull String addressType)
    • apiVersion

      public V1EndpointSlice apiVersion(@Nullable String apiVersion)
    • getApiVersion

      @Nullable public String getApiVersion()
      APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
      Specified by:
      getApiVersion in interface KubernetesType
      Returns:
      apiVersion
    • setApiVersion

      public void setApiVersion(@Nullable String apiVersion)
    • endpoints

      public V1EndpointSlice endpoints(@Nonnull List<V1Endpoint> endpoints)
    • addEndpointsItem

      public V1EndpointSlice addEndpointsItem(V1Endpoint endpointsItem)
    • getEndpoints

      @Nonnull public List<V1Endpoint> getEndpoints()
      endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
      Returns:
      endpoints
    • setEndpoints

      public void setEndpoints(@Nonnull List<V1Endpoint> endpoints)
    • kind

      public V1EndpointSlice kind(@Nullable String kind)
    • getKind

      @Nullable public String getKind()
      Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
      Specified by:
      getKind in interface KubernetesType
      Returns:
      kind
    • setKind

      public void setKind(@Nullable String kind)
    • metadata

      public V1EndpointSlice metadata(@Nullable V1ObjectMeta metadata)
    • getMetadata

      @Nullable public V1ObjectMeta getMetadata()
      Get metadata
      Specified by:
      getMetadata in interface KubernetesObject
      Returns:
      metadata
    • setMetadata

      public void setMetadata(@Nullable V1ObjectMeta metadata)
    • ports

      public V1EndpointSlice ports(@Nullable List<DiscoveryV1EndpointPort> ports)
    • addPortsItem

      public V1EndpointSlice addPortsItem(DiscoveryV1EndpointPort portsItem)
    • getPorts

      @Nullable public List<DiscoveryV1EndpointPort> getPorts()
      ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.
      Returns:
      ports
    • setPorts

      public void setPorts(@Nullable List<DiscoveryV1EndpointPort> ports)
    • 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 V1EndpointSlice
    • fromJson

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

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