Package org.cdk8s
Class Yaml
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- org.cdk8s.Yaml
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.78.1 (build 878761e)", date="2023-03-21T00:22:58.184Z") @Stability(Stable) public class Yaml extends software.amazon.jsii.JsiiObject
YAML utilities.
-
-
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
-
-
-
-
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 `---`.
-
-