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

org.cdk8s.Yaml 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;

/**
 * YAML utilities.
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.88.0 (build eaabd08)", date = "2023-09-04T06:16:31.566Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = org.cdk8s.$Module.class, fqn = "cdk8s.Yaml")
public class Yaml extends software.amazon.jsii.JsiiObject {

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

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

    /**
     * @deprecated use stringify(doc[, doc, ...])
     * @param docs This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
    @Deprecated
    public static @org.jetbrains.annotations.NotNull java.lang.String formatObjects(final @org.jetbrains.annotations.NotNull java.util.List docs) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Yaml.class, "formatObjects", software.amazon.jsii.NativeType.forClass(java.lang.String.class), new Object[] { java.util.Objects.requireNonNull(docs, "docs is required") });
    }

    /**
     * Downloads a set of YAML documents (k8s manifest for example) from a URL or a file and returns them as javascript objects.
     * 

* Empty documents are filtered out. *

* @return an array of objects, each represents a document inside the YAML * @param urlOrFile a URL of a file path to load from. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull java.util.List load(final @org.jetbrains.annotations.NotNull java.lang.String urlOrFile) { return java.util.Collections.unmodifiableList(software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Yaml.class, "load", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class)), new Object[] { java.util.Objects.requireNonNull(urlOrFile, "urlOrFile is required") })); } /** * Saves a set of objects as a multi-document YAML file. *

* @param filePath The output path. This parameter is required. * @param docs The set of objects. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static void save(final @org.jetbrains.annotations.NotNull java.lang.String filePath, final @org.jetbrains.annotations.NotNull java.util.List docs) { software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Yaml.class, "save", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(filePath, "filePath is required"), java.util.Objects.requireNonNull(docs, "docs is required") }); } /** * Stringify a document (or multiple documents) into YAML. *

* We convert undefined values to null, but ignore any documents that are * undefined. *

* @return a YAML string. Multiple docs are separated by ---. * @param docs A set of objects to convert to YAML. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull java.lang.String stringify(final @org.jetbrains.annotations.NotNull java.lang.Object... docs) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Yaml.class, "stringify", software.amazon.jsii.NativeType.forClass(java.lang.String.class), java.util.Arrays.stream(docs).toArray(Object[]::new)); } /** * Saves a set of YAML documents into a temp file (in /tmp). *

* @return the path to the temporary file * @param docs the set of documents to save. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static @org.jetbrains.annotations.NotNull java.lang.String tmp(final @org.jetbrains.annotations.NotNull java.util.List docs) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.Yaml.class, "tmp", software.amazon.jsii.NativeType.forClass(java.lang.String.class), new Object[] { java.util.Objects.requireNonNull(docs, "docs is required") }); } }