{
  "id": "/cassandra/{{cassandra.cluster-name}}",
  "cmd": "$(pwd)/jre*/bin/java $JAVA_OPTS -classpath cassandra-mesos-framework.jar io.mesosphere.mesos.frameworks.cassandra.framework.Main",
  "instances": {{cassandra.framework.instances}},
  "cpus": {{cassandra.framework.cpus}},
  "mem": {{cassandra.framework.mem}},
  "uris": [
    "{{resource.assets.uris.cassandra-mesos-tar-gz}}",
    "{{resource.assets.uris.jre-linux-tar-gz}}"
  ],
  "ports": [
    0
  ],
  "healthChecks": [
    {
      "gracePeriodSeconds": 120,
      "intervalSeconds": 15,
      "maxConsecutiveFailures": 0,
      "path": "/health/cluster",
      "portIndex": 0,
      "protocol": "HTTP",
      "timeoutSeconds": 5
    },
    {
      "gracePeriodSeconds": 120,
      "intervalSeconds": 30,
      "maxConsecutiveFailures": 3,
      "path": "/health/process",
      "portIndex": 0,
      "protocol": "HTTP",
      "timeoutSeconds": 5
    }
  ],
  "labels": {
    "DCOS_PACKAGE_FRAMEWORK_NAME": "cassandra.{{cassandra.cluster-name}}"
  },
  "env": {
    "MESOS_ZK": "{{mesos.master}}"
    ,"JAVA_OPTS": "-Xms256m -Xmx256m"
    ,"CASSANDRA_CLUSTER_NAME": "{{cassandra.cluster-name}}"
    ,"CASSANDRA_NODE_COUNT": "{{cassandra.node-count}}"
    ,"CASSANDRA_SEED_COUNT": "{{cassandra.seed-count}}"
    ,"CASSANDRA_RESOURCE_CPU_CORES": "{{cassandra.resources.cpus}}"
    ,"CASSANDRA_RESOURCE_MEM_MB": "{{cassandra.resources.mem}}"
    ,"CASSANDRA_RESOURCE_DISK_MB": "{{cassandra.resources.disk}}"
    ,"CASSANDRA_FAILOVER_TIMEOUT_SECONDS": "{{cassandra.framework.failover-timeout-seconds}}"
    ,"CASSANDRA_DATA_DIRECTORY": "{{cassandra.data-directory}}"
    ,"CASSANDRA_HEALTH_CHECK_INTERVAL_SECONDS": "{{cassandra.health-check-interval-seconds}}"
    ,"CASSANDRA_ZK_TIMEOUT_MS": "{{cassandra.zk-timeout-ms}}"
    ,"CASSANDRA_BOOTSTRAP_GRACE_TIME_SECONDS": "{{cassandra.bootstrap-grace-time-seconds}}"
    ,"CASSANDRA_FRAMEWORK_MESOS_ROLE": "{{cassandra.framework.role}}"
    ,"CASSANDRA_DEFAULT_DC": "{{cassandra.dc.default-dc}}"
    ,"CASSANDRA_DEFAULT_RACK": "{{cassandra.dc.default-rack}}"
    ,"MESOS_AUTHENTICATE": "{{cassandra.framework.authentication.enabled}}"
{{#cassandra.dc.external-dcs}}
    ,"CASSANDRA_EXTERNAL_DC_{{name}}": "{{url}}"
{{/cassandra.dc.external-dcs}}
{{#cassandra.zk}} {{! if the full cassandra zk url has been specified use it }}
    ,"CASSANDRA_ZK": "{{cassandra.zk}}"
{{/cassandra.zk}}
{{^cassandra.zk}} {{! else, create a url based on convention and cluster name }}
    ,"CASSANDRA_ZK": "zk://master.mesos:2181/cassandra-mesos/{{cassandra.cluster-name}}"
{{/cassandra.zk}}
{{#cassandra.resource.heap-mb}}
,"CASSANDRA_RESOURCE_HEAP_MB": "{{cassandra.resource.heap-mb}}"
{{/cassandra.resource.heap-mb}}
{{#cassandra.framework.authentication.principal}}
    ,"DEFAULT_PRINCIPAL": "{{cassandra.framework.authentication.principal}}"
{{/cassandra.framework.authentication.principal}}
{{#cassandra.framework.authentication.secret}}
    ,"DEFAULT_SECRET": "{{cassandra.framework.authentication.secret}}"
{{/cassandra.framework.authentication.secret}}
  }
}
