DataStax OpsCenter Documentation

Managing Clusters

You can manage clusters using these HTTP methods:

Cluster Management Methods URL
List configuration information for all clusters. GET /cluster-configs
List configuration information for a cluster. GET /cluster-configs/{cluster_id}
Add a new cluster to OpsCenter. POST /cluster-configs
Update a cluster configuration. PUT /cluster-configs/{cluster_id}
Remove a cluster. DELETE /cluster-configs/{cluster_id}

HTTP Methods

GET /cluster-configs

Retrieve a list of all configured clusters.

Returns a dictionary of cluster id (key), ClusterConfig objects (value). Each cluster configuration includes a seed_hosts entry (required).

ClusterConfig
{
  <section-name>: {
    <prop-name>: <prop-value>,
      ...
  },
    ...
}

Example:

curl
  http://127.0.0.1:8888/cluster-configs
  -X GET

Output:

{
  "Test_Cluster": {
    "cassandra": {
    "agents": {
      "use_ssl": "false"
    },
      "seed_hosts": "localhost"
    },
    "cassandra_metrics": {},
    "jmx": {
      "port": 7199
    }
  },
    "Test_Cluster2": {
      "cassandra" {
        "seed_hosts": "2.3.4.5, 2.3.4.6",
        "api_port": 9160
      },
      "cassandra_metrics": {},
      "jmx": {
        "port": 7199,
        "username": "jmx_user",
        "password": "jmx_pass"
      }
  }
}
GET /cluster-configs/{cluster_id}

Retrieve the configuration for a single cluster.

Path arguments:cluster_id -- The key, which identifies a single cluster to fetch, in the dictionary returned by GET /cluster-configs.

Returns a ClusterConfig.

Example:

curl
  http://127.0.0.1:8888/cluster-configs/Test_Cluster
  -X GET

Output:

{
  "agents": {},
  "cassandra": {
    "seed_hosts": "1.2.3.4, 1.2.3.5"
  },
  "cassandra_metrics": {},
  "jmx": {
    "port": 7199
  }
}
POST /cluster-configs

Add a new cluster for OpsCenter monitoring and administration.

Body :A configuration in the format of ClusterConfig. A seed hosts entry is required.
Responses:201 -- Cluster was added successfully

Returns the ID of the new cluster.

Example:

curl
  http://127.0.0.1:8888/cluster-configs
  -X POST
  -d
  '{
      "cassandra": {
        "seed_hosts": "localhost"
      },
      "cassandra_metrics": {},
      "jmx": {
        "port": "7199"
      }
  }'

Output:

"Test_Cluster"
PUT /cluster-configs/{cluster_id}

Update a cluster configuration.

Path arguments:cluster_id -- The key, which identifies the cluster to be updated, in the dictionary returned by GET /cluster-configs.
Body :A configuration in the same format as ClusterConfig. A seed hosts entry is required.
Responses:204 -- Cluster updated successfully

Example:

curl
  http://127.0.0.1:8888/cluster-configs/Test_Cluster
  -X PUT
  -d
  '{
      "cassandra": {
        "seed_hosts": "localhost"
      },
      "jmx": {
        "port": "7199"
      }
  }'
DELETE /cluster-configs/{cluster_id}

Remove a cluster.

Path arguments:cluster_id -- The key, which identifies the cluster to be removed, in the dictionary returned by GET /cluster-configs.
Responses:204 -- Cluster removed successfully

Example:

curl
  http://127.0.0.1:8888/cluster-configs/Test_Cluster
  -X DELETE