builder.field("state", closed ? "stopped" : "running");
if (!closed)
builder.field("last_restart", lastRestartDate);
else if (permanentStopDate != null)
builder.field("stopped_permanently", permanentStopDate);
builder.endObject();
if (esNode != null) {
builder.startObject("node");
builder.field("id", esNode.getId());
builder.field("name", esNode.getName());
builder.endObject();