我正在尝试做类似以下的事情
BootstrapConfig config = BootstrapConfig.builder().runList(runlist).attributes(new JsonBall("{ \"cassandra\" : { \"cluster_name\" : \"testing Baby\"}}")).build();
但它不工作......
我不知道如何使用 Jsonball ..
谢谢
我正在尝试做类似以下的事情
BootstrapConfig config = BootstrapConfig.builder().runList(runlist).attributes(new JsonBall("{ \"cassandra\" : { \"cluster_name\" : \"testing Baby\"}}")).build();
但它不工作......
我不知道如何使用 Jsonball ..
谢谢
代码看起来不错。由于 Chef 属性具有任意结构,因此我们无法拥有对应的 Java 属性,因此我们使用 JsonBall 对象作为任何 JSON 字符串的占位符。
但是,在生成引导配置后,您需要执行以下操作来生成引导脚本:
chefService.updateBootstrapConfigForGroup("groupname", config);
Statement bootstrap = chefService.createBootstrapScriptForGroup("groupname");
这将生成您可以传递给 ComputeService 方法的引导脚本。