All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cdk8s.Chart Maven / Gradle / Ivy

Go to download

This is the core library of Cloud Development Kit (CDK) for Kubernetes (cdk8s). cdk8s apps synthesize into standard Kubernetes manifests which can be applied to any Kubernetes cluster.

There is a newer version: 2.69.27
Show newest version
package org.cdk8s;

/**
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.44.2 (build d848ef8)", date = "2021-11-19T00:22:55.699Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = org.cdk8s.$Module.class, fqn = "cdk8s.Chart")
public class Chart extends software.constructs.Construct {

    protected Chart(final software.amazon.jsii.JsiiObjectRef objRef) {
        super(objRef);
    }

    protected Chart(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
        super(initializationMode);
    }

    /**
     * @param scope This parameter is required.
     * @param id This parameter is required.
     * @param props
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public Chart(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.Nullable org.cdk8s.ChartProps 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"), props });
    }

    /**
     * @param scope This parameter is required.
     * @param id This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public Chart(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id) {
        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") });
    }

    /**
     * Finds the chart in which a node is defined.
     * 

* @param c a construct node. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull org.cdk8s.Chart of(final @org.jetbrains.annotations.NotNull software.constructs.IConstruct c) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Chart.class, "of", software.amazon.jsii.NativeType.forClass(org.cdk8s.Chart.class), new Object[] { java.util.Objects.requireNonNull(c, "c is required") }); } /** * Create a dependency between this Chart and other constructs. *

* These can be other ApiObjects, Charts, or custom. *

* @param dependencies the dependencies to add. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public void addDependency(final @org.jetbrains.annotations.NotNull software.constructs.IConstruct... dependencies) { software.amazon.jsii.Kernel.call(this, "addDependency", software.amazon.jsii.NativeType.VOID, java.util.Arrays.stream(dependencies).toArray(Object[]::new)); } /** * Generates a app-unique name for an object given it's construct node path. *

* Different resource types may have different constraints on names * (metadata.name). The previous version of the name generator was * compatible with DNS_SUBDOMAIN but not with DNS_LABEL. *

* For example, Deployment names must comply with DNS_SUBDOMAIN while * Service names must comply with DNS_LABEL. *

* Since there is no formal specification for this, the default name * generation scheme for kubernetes objects in cdk8s was changed to DNS_LABEL, * since it’s the common denominator for all kubernetes resources * (supposedly). *

* You can override this method if you wish to customize object names at the * chart level. *

* @param apiObject The API object to generate a name for. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.NotNull java.lang.String generateObjectName(final @org.jetbrains.annotations.NotNull org.cdk8s.ApiObject apiObject) { return software.amazon.jsii.Kernel.call(this, "generateObjectName", software.amazon.jsii.NativeType.forClass(java.lang.String.class), new Object[] { java.util.Objects.requireNonNull(apiObject, "apiObject is required") }); } /** * Renders this chart to a set of Kubernetes JSON resources. *

* @return array of resource manifests */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.NotNull java.util.List toJson() { return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.call(this, "toJson", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class)))); } /** * Labels applied to all resources in this chart. *

* This is an immutable copy. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.NotNull java.util.Map getLabels() { return java.util.Collections.unmodifiableMap(software.amazon.jsii.Kernel.get(this, "labels", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)))); } /** * The default namespace for all objects in this chart. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public @org.jetbrains.annotations.Nullable java.lang.String getNamespace() { return software.amazon.jsii.Kernel.get(this, "namespace", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * A fluent builder for {@link org.cdk8s.Chart}. */ @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 This parameter is required. * @param id 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 org.cdk8s.ChartProps.Builder props; private Builder(final software.constructs.Construct scope, final java.lang.String id) { this.scope = scope; this.id = id; } /** * Labels to apply to all resources in this chart. *

* Default: - no common labels *

* @return {@code this} * @param labels Labels to apply to all resources in this chart. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder labels(final java.util.Map labels) { this.props().labels(labels); return this; } /** * The default namespace for all objects defined in this chart (directly or indirectly). *

* This namespace will only apply to objects that don't have a * namespace explicitly defined for them. *

* Default: - no namespace is synthesized (usually this implies "default") *

* @return {@code this} * @param namespace The default namespace for all objects defined in this chart (directly or indirectly). This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder namespace(final java.lang.String namespace) { this.props().namespace(namespace); return this; } /** * @returns a newly built instance of {@link org.cdk8s.Chart}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override public org.cdk8s.Chart build() { return new org.cdk8s.Chart( this.scope, this.id, this.props != null ? this.props.build() : null ); } private org.cdk8s.ChartProps.Builder props() { if (this.props == null) { this.props = new org.cdk8s.ChartProps.Builder(); } return this.props; } } }