Package org.cdk8s

Class Yaml

  • All Implemented Interfaces:
    software.amazon.jsii.JsiiSerializable

    @Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)",
               date="2024-06-27T12:14:19.461Z")
    @Stability(Stable)
    public class Yaml
    extends software.amazon.jsii.JsiiObject
    YAML utilities.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

        software.amazon.jsii.JsiiObject.InitializationMode
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Yaml​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)  
      protected Yaml​(software.amazon.jsii.JsiiObjectRef objRef)  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static String formatObjects​(List<? extends Object> docs)
      Deprecated.
      use stringify(doc[, doc, ...])
      static List<Object> load​(String urlOrFile)
      Downloads a set of YAML documents (k8s manifest for example) from a URL or a file and returns them as javascript objects.
      static void save​(String filePath, List<? extends Object> docs)
      Saves a set of objects as a multi-document YAML file.
      static String stringify​(@NotNull Object... docs)
      Stringify a document (or multiple documents) into YAML.
      static String tmp​(List<? extends Object> docs)
      Saves a set of YAML documents into a temp file (in /tmp).
      • Methods inherited from class software.amazon.jsii.JsiiObject

        jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
      • Methods inherited from interface software.amazon.jsii.JsiiSerializable

        $jsii$toJson
    • Constructor Detail

      • Yaml

        protected Yaml​(software.amazon.jsii.JsiiObjectRef objRef)
      • Yaml

        protected Yaml​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Method Detail

      • formatObjects

        @Stability(Deprecated)
        @Deprecated
        @NotNull
        public static String formatObjects​(@NotNull
                                           List<? extends Object> docs)
        Deprecated.
        use stringify(doc[, doc, ...])
        Parameters:
        docs - This parameter is required.
      • load

        @Stability(Stable)
        @NotNull
        public static List<Object> load​(@NotNull
                                        String urlOrFile)
        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.

        Parameters:
        urlOrFile - a URL of a file path to load from. This parameter is required.
        Returns:
        an array of objects, each represents a document inside the YAML
      • save

        @Stability(Stable)
        public static void save​(@NotNull
                                String filePath,
                                @NotNull
                                List<? extends Object> docs)
        Saves a set of objects as a multi-document YAML file.

        Parameters:
        filePath - The output path. This parameter is required.
        docs - The set of objects. This parameter is required.
      • stringify

        @Stability(Stable)
        @NotNull
        public static String stringify​(@NotNull
                                       @NotNull Object... docs)
        Stringify a document (or multiple documents) into YAML.

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

        Parameters:
        docs - A set of objects to convert to YAML. This parameter is required.
        Returns:
        a YAML string. Multiple docs are separated by ---.
      • tmp

        @Stability(Stable)
        @NotNull
        public static String tmp​(@NotNull
                                 List<? extends Object> docs)
        Saves a set of YAML documents into a temp file (in /tmp).

        Parameters:
        docs - the set of documents to save. This parameter is required.
        Returns:
        the path to the temporary file