
org.cdk8s.plus23.k8s.KubeEndpointSlice Maven / Gradle / Ivy
package org.cdk8s.plus23.k8s;
/**
* EndpointSlice represents a subset of the endpoints that implement a service.
*
* For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.75.0 (build 63bb957)", date = "2023-02-21T09:46:03.876Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = org.cdk8s.plus23.$Module.class, fqn = "cdk8s-plus-23.k8s.KubeEndpointSlice")
public class KubeEndpointSlice extends org.cdk8s.ApiObject {
protected KubeEndpointSlice(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected KubeEndpointSlice(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
static {
GVK = software.amazon.jsii.JsiiObject.jsiiStaticGet(org.cdk8s.plus23.k8s.KubeEndpointSlice.class, "GVK", software.amazon.jsii.NativeType.forClass(org.cdk8s.GroupVersionKind.class));
}
/**
* Defines a "io.k8s.api.discovery.v1.EndpointSlice" API object.
*
* @param scope the scope in which to define this object. This parameter is required.
* @param id a scope-local name for the object. This parameter is required.
* @param props initialization props. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public KubeEndpointSlice(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull org.cdk8s.plus23.k8s.KubeEndpointSliceProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* Renders a Kubernetes manifest for "io.k8s.api.discovery.v1.EndpointSlice".
*
* This can be used to inline resource manifests inside other objects (e.g. as templates).
*
* @param props initialization props. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static @org.jetbrains.annotations.NotNull java.lang.Object manifest(final @org.jetbrains.annotations.NotNull org.cdk8s.plus23.k8s.KubeEndpointSliceProps props) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.plus23.k8s.KubeEndpointSlice.class, "manifest", software.amazon.jsii.NativeType.forClass(java.lang.Object.class), new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* Renders the object to Kubernetes JSON.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull java.lang.Object toJson() {
return software.amazon.jsii.Kernel.call(this, "toJson", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
}
/**
* Returns the apiVersion and kind for "io.k8s.api.discovery.v1.EndpointSlice".
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public final static org.cdk8s.GroupVersionKind GVK;
/**
* A fluent builder for {@link org.cdk8s.plus23.k8s.KubeEndpointSlice}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope the scope in which to define this object. This parameter is required.
* @param id a scope-local name for the object. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final org.cdk8s.plus23.k8s.KubeEndpointSliceProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new org.cdk8s.plus23.k8s.KubeEndpointSliceProps.Builder();
}
/**
* 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.
*
* Possible enum values:
*
*
* "FQDN"
represents a FQDN.
* "IPv4"
represents an IPv4 Address.
* "IPv6"
represents an IPv6 Address.
*
*
* @return {@code this}
* @param addressType addressType specifies the type of address carried by this EndpointSlice. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder addressType(final org.cdk8s.plus23.k8s.IoK8SApiDiscoveryV1EndpointSliceAddressType addressType) {
this.props.addressType(addressType);
return this;
}
/**
* endpoints is a list of unique endpoints in this slice.
*
* Each slice may include a maximum of 1000 endpoints.
*
* @return {@code this}
* @param endpoints endpoints is a list of unique endpoints in this slice. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder endpoints(final java.util.List extends org.cdk8s.plus23.k8s.Endpoint> endpoints) {
this.props.endpoints(endpoints);
return this;
}
/**
* Standard object's metadata.
*
* @return {@code this}
* @param metadata Standard object's metadata. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder metadata(final org.cdk8s.plus23.k8s.ObjectMeta metadata) {
this.props.metadata(metadata);
return this;
}
/**
* ports specifies the list of network ports exposed by each endpoint in this slice.
*
* Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
*
* @return {@code this}
* @param ports ports specifies the list of network ports exposed by each endpoint in this slice. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ports(final java.util.List extends org.cdk8s.plus23.k8s.EndpointPort> ports) {
this.props.ports(ports);
return this;
}
/**
* @returns a newly built instance of {@link org.cdk8s.plus23.k8s.KubeEndpointSlice}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public org.cdk8s.plus23.k8s.KubeEndpointSlice build() {
return new org.cdk8s.plus23.k8s.KubeEndpointSlice(
this.scope,
this.id,
this.props.build()
);
}
}
}