Contact Us 1-800-596-4880

REST API Reference: Clusters

About This Document

This document, as well as the rest of the documents that make up the Mule Management Console REST API Reference Guide, are a technical reference only. This document does not provide contextual information such as instructions, use cases or scenarios. To understand this document, you should be familiar with MULE ESB, Clusters and the REST API.

Assumptions:

Host

localhost

Port

8080

Deployed app

mmc.war

User/Password

admin/admin

For a detailed description of the format used in this document, consult Content Organization and Conventions.

/api/clusters

POST

CREATE

Creates a new Cluster.

Request

JSON

{
  "name":"My Cluster",
  "version":"3.4.0",
  "nodes":
    [
      "local$68eded4b-efda-4703-b292-62c6aee30a8b",
      "local$97226216-c3bf-4bed-a544-878a9e64b74f"
    ]
}
Key Type Summary Child of

name

String

Name of the cluster to be created

version

String

Version of the cluster to be created. This must correspond exactly to the version of the cluster nodes

nodes

Array

List of server IDs that will be assigned to the new cluster. It is required that at least one valid Server ID is supplied

Using CURL on Windows

 curl --basic -u admin:admin -d "{\"name\":\"My Cluster\",\"version\":\"3.4.0\", \"nodes\":[\"local$194cdc5b-2253-4f35-b663-b311e4f28956\", \"local$ef85a37f-a3c1-4d1f-b8e6-8fac85d2fca7\"]}" --header "Content-Type: application/json" http://localhost:8080/mmc/api/clusters

Using CURL on Linux

 curl --basic -u admin:admin -d '{"name":"My Cluster","version":"3.4.0", "nodes":["local$194cdc5b-2253-4f35-b663-b311e4f28956", "local$ef85a37f-a3c1-4d1f-b8e6-8fac85d2fca7"]}' --header 'Content-Type: application/json' http://localhost:8080/mmc/api/clusters

Response

Json

{
  "name":"My Cluster",
  "location":"N/A",
  "id":"cf1fc78b-23a1-491e-93d1-6cc2819c4724",
  "version":"3.4.0",
  "status":"0 of 2 nodes online",
  "pausedServices":-1,
  "stoppedServices":-1,
  "nodeServerIds":
    ["local$194cdc5b-2253-4f35-b663-b311e4f28956","local$ef85a37f-a3c1-4d1f-b8e6-8fac85d2fca7"],
  "deployments":[],
  "clusterStatus":"WAITING_FOR_RESTART",
  "nodesUpCount":0,
  "lastRestarted":1346957925451,
  "runningServices":-1,
  "totalServices":-1,
  "groupIds":[]
}
Key Type Summary Child of

name

String

Name of the created cluster

location

String

Reserved for future usage. Default value: "N/A"

id

String

The ID of the newly created Cluster

version

String

Version of the created cluster

status

String

Displays the total number of nodes and how many of them are online

pausedServices

Integer

Number of paused services on the Cluster

stoppedServices

Integer

Number of stopped services on the Cluster

nodeServerIds

List

List of Server IDs that are the nodes on the Cluster

deployments

List

List of Cluster’s deployment IDs. When newly created, this list should be empty

clusterStatus

String

Status of the Cluster (e.g. STOPPED, WAITING_FOR_RESTART, OK)

nodesUpCount

Integer

Number of online nodes

lastRestarted

Integer

Last restart time since epoch

runningServices

Integer

Number of running services on the Cluster

totalServices

Integer

Total number of services on the Cluster

groupIds

List

List group IDs that this Cluster belongs to

Common Return codes

201

The Cluster was created successfully

400

At least one node is not responding/ Malformed Url exception/ Cluster Node Exception/ Some nodes weren’t found/ Access Exception/
Policies do not allow adding that cluster/ Nodes to add must be supplied/ A cluster version must be supplied/ A cluster name must be supplied

409

A cluster with that name already exists

MMC version

From 3.2.2

GET

LIST ALL

Lists all managed Clusters.

Request

SYNTAX

Using CURL

 curl --basic -u admin:admin http://localhost:8080/mmc/api/clusters

Response

JSON

{
  "total":1,
  "data":
    [
      {
        "name":"My Cluster",
        "location":"N/A",
        "id":"cf1fc78b-23a1-491e-93d1-6cc2819c4724",
        "version":"3.4.0","status":"2 of 2 nodes online",
        "pausedServices":0,
        "stoppedServices":0,
        "nodeServerIds":
          ["local$194cdc5b-2253-4f35-b663-b311e4f28956","local$ef85a37f-a3c1-4d1f-b8e6-8fac85d2fca7"],
        "deployments":[],
        "clusterStatus":"OK",
        "nodesUpCount":2,
        "lastRestarted":1346957925451,
        "runningServices":0,
        "totalServices":0,
        "groupIds":[]
      }
    ]
}
Key Type Summary Child of

total

Integer

Number of managed clusters

data

List

List of managed Cluster details

name

String

Name of the created cluster

data

location

String

Reserved for future usage. Default value: "N/A"

data

id

String

The ID of the newly created Cluster

data

version

String

Version of the created cluster

data

status

String

Displays the total number of nodes and how many of them are online

data

pausedServices

Integer

Number of paused services on the Cluster

data

stoppedServices

Integer

Number of stopped services on the Cluster

data

nodeServerIds

List

List of Server IDs that are the nodes on the Cluster

data

deployments

List

List of Cluster’s deployment IDs. When newly created, this list should be empty

data

clusterStatus

String

Status of the Cluster (e.g. STOPPED, WAITING_FOR_RESTART, OK)

data

nodesUpCount

Integer

Number of online nodes

data

lastRestarted

Integer

Last restart time since epoch

data

runningServices

Integer

Number of running services on the Cluster

data

totalServices

Integer

Total number of services on the Cluster

data

groupIds

List

List of group IDs that this Cluster belongs to

data

Common Return codes

200

The operation was successful

400

Unauthorized user/ Server Down

MMC version

From

3.2.2

/api/clusters/{clusterId}

GET

LIST

Lists details for specific Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a cluster

Using CURL

curl --basic -u admin:admin http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724

Response

H5. JSON

{
        "name":"My Cluster",
        "location":"N/A",
        "id":"cf1fc78b-23a1-491e-93d1-6cc2819c4724",
        "version":"3.4.0","status":"2 of 2 nodes online",
        "pausedServices":0,
        "stoppedServices":0,
        "nodeServerIds":
          ["local$194cdc5b-2253-4f35-b663-b311e4f28956","local$ef85a37f-a3c1-4d1f-b8e6-8fac85d2fca7"],
        "deployments":[],
        "clusterStatus":"OK",
        "nodesUpCount":2,
        "lastRestarted":1346957925451,
        "runningServices":0,
        "totalServices":0,
        "groupIds":[]
      }
Key Type Summary Child of

name

String

Name of the created cluster

location

String

Reserved for future usage. Default value: "N/A"

id

String

The ID of the newly created Cluster

version

String

Version of the created cluster

status

String

Displays the total number of nodes and how many of them are online

pausedServices

Integer

Number of paused services on the Cluster

stoppedServices

Integer

Number of stopped services on the Cluster

nodeServerIds

List

List of Server IDs that are the nodes on the Cluster

deployments

List

List of Cluster’s deployment IDs. When newly created, this list should be empty

clusterStatus

String

Status of the Cluster (e.g. STOPPED, WAITING_FOR_RESTART, OK)

nodesUpCount

Integer

Number of online nodes

lastRestarted

Integer

Last restart time since epoch

runningServices

Integer

Number of running services on the Cluster

totalServices

Integer

Total number of services on the Cluster

groupIds

List

List of group IDs that this Cluster belongs to

Common Return codes

200

The operation was successful

401

Unauthorized user

404

At least one node in the cluster is not responding/ A cluster with that ID or Name was not found/

500

Cluster is down/ Error while listing details for the Cluster

MMC version

From

3.2.2

/api/clusters/{clusterId}/status

GET

STATUS

Lists node status for specific Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a cluster

Using CURL

 curl --basic -u admin:admin http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/status

Response

2 of 2 nodes online

Common Return codes

200

The operation was successful

MMC version

From

3.2.2

DELETE

DISBAND

Disbands a specific Server.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

Id of the cluster to be disbanded. Invoke LIST ALL to obtain it.

After disbanding all nodes return to standalone mode. See server API.

Using CURL

 curl --basic -u admin:admin -X DELETE http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724

Response

200 ok

Common Return codes

JSON

200

The operation was successful

500

Access Exception/ Some nodes weren’t found/ Cluster node exception

MMC version

From

3.2.2

/api/clusters/{clusterId}/restart

POST

PERFORM RESTART

Restarts a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

Using CURL

 curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/restart

Response

JSON

200

Common Return codes

200

The operation was successful

401

Unauthorized user

404

A cluster with that ID or Name was not found

500

Error while restarting the Cluster

MMC version

From

3.2.2

/api/clusters/{clusterId}/stop

POST

PERFORM STOP

Stops a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

Using CURL

 curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/stop

Response

JSON

200

Common Return codes

200

The operation was successful

401

Unauthorized user

404

A cluster with that ID or Name was not found

500

Error while stopping the Cluster

MMC version

From

3.2.2

/api/clusters/{clusterId}/addnodes

POST

ADD NODES

Adds a node to a cluster.

Request

JSON

{
  "nodes":
    [
       "local$30018f69-2772-428f-b13d-5a0644a7ca51",
       "local$473e6e0f-0151-445f-81a0-4065297620b6"
    ]
}
Key Type Summary Child of

nodes

array

IDs of the nodes to add

Using CURL

 curl --basic -u admin:admin -d '{"nodes":"local$30018f69-2772-428f-b13d-5a0644a7ca51", "local$473e6e0f-0151-445f-81a0-4065297620b6"}' --header 'Content-Type: application/json' http://localhost:8080/api/clusters/0662f078-6b9b-461d-bce1-48996a59a5d8/addnodes

Response

JSON

200 OK

Common Return codes

200

The operation was successful

400

Error

500

Internal error while adding the node

MMC version

From

3.4

/api/clusters/{clusterId}/removenodes

POST

REMOVE NODES

Removes a node from a cluster.

Request

JSON

{
  "nodes":
    [
       "local$30018f69-2772-428f-b13d-5a0644a7ca51",
       "local$473e6e0f-0151-445f-81a0-4065297620b6"
    ]
}
Key Type Summary Child of

nodes

array

IDs of the nodes to remove

Using CURL

 curl --basic -u admin:admin -d '{"nodes":"local$30018f69-2772-428f-b13d-5a0644a7ca51", "local$473e6e0f-0151-445f-81a0-4065297620b6"}' --header 'Content-Type: application/json' http://localhost:8080/api/clusters/0662f078-6b9b-461d-bce1-48996a59a5d8/removenodes

Response

JSON

200 ok

Common Return codes

200

The operation was successful

400

Error

500

Internal error while removing the node

MMC version

From

3.4

Mule Applications

/api/clusters/{clusterId}/applications

GET

LIST ALL MULE APPS

Lists all Mule applications currently deployed successfully on a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a cluster

Using CURL

 curl --basic -u admin:admin http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/applications

Response

JSON

{
  "total":1,
  "data":
    [
      {
        "name":"mule-example-hello",
        "status":"STARTED",
        "nodesRunning":"[Mule@172.16.20.41:7777,Mule@172.16.20.42:7777]"
      }
    ]
}
Key Type Summary Child of

total

Integer

Number of deployed applications on Cluster

data

List

List of deployed applications on Cluster

name

String

Name of the deployed application

data

status

String

Status of the application (i.e. INITIALISED, STARTED, STOPPED or DISPOSED)

data

Common Return codes

200

The operation was successful

MMC version

From

3.2.2

/api/clusters/{clusterId}/applications/{applicationName}/start

POST

PERFORM START MULE APP

Starts an application from a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

applicationName

String

Name of the application to be started

Using CURL

curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/applications/mule-example-hello/start

Response

JSON

{
  "total":1,
  "data":
    [
      "mule-example-hello"
    ]
}

Key

Type

Summary

Child of

total

Integer

Number of started applications

data

List

List of started applications

Common Return codes

200

The operation was successful

400

At least one application name must be supplied

MMC version

From

3.2.2

/api/clusters/{clusterId}/applications/{applicationName}/restart

POST

PERFORM RESTART MULE APP

Restarts an application from a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

applicationName

String

Name of the application to be started

Using CURL

 curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/applications/mule-example-hello/restart

Response

JSON

{
  "total":1,
  "data":
    [
      "mule-example-hello"
    ]
}
Key Type Summary Child of

total

Integer

Number of started applications

data

List

List of started applications

Common Return codes

200

The operation was successful

400

At least one application name must be supplied

MMC version

From

3.2.2

/api/clusters/{clusterId}/applications/{applicationName}/stop

POST

PERFORM STOP MULE APP

Stops an application from a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

applicationName

String

Name of the application to be started

Using CURL

 curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/applications/mule-example-hello/stop

Response

JSON

{
  "total":1,
  "data":
    [
      "mule-example-hello"
    ]
}
Key Type Summary Child of

total

Integer

Number of started applications

data

List

List of started applications

Common Return codes

200

The operation was successful

400

At least one application name must be supplied

MMC version

From

3.2.2

Cluster Flows

/api/clusters/{clusterId}/flows

GET

LIST ALL FLOWS

Lists all available flows belonging to Mule applications currently deployed successfully on a Cluster.

Request

SYNTAX

GET http://localhost:8080/mmc/api/clusters/{clusterId}/flows[/?refreshStats=TRUE|FALSE]
Key Type Summary Child of

clusterId

String

ID of a cluster

refreshStats

Boolean

(Optional) Forces refresh of cluster stats

Using CURL

curl --basic -u admin:admin http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/flows

Response

JSON

{
  "total":4,
  "data":
    [
      {
        "id":"cf1fc78b-23a1-491e-93d1-6cc2819c4724/ChitChat",
        "type":"flow",
        "status":"STOPPED",
        "asyncEventsReceived":0,
        "executionErrors":0,
        "fatalErrors":0,
        "inboundEndpoints":["vm://chitchatter"],
        "syncEventsReceived":0,
        "totalEventsReceived":0,
        "serverId":"cf1fc78b-23a1-491e-93d1-6cc2819c4724",
        "auditStatus":"DISABLED",
        "flowId":
          {
            "name":"ChitChat",
            "fullName":"ChitChat [mule-example-hello]",
            "application":"mule-example-hello",
            "definedInApplication":true
          },
        "favorite":false,
        "processedEvents":0,
        "totalProcessingTime":0,
        "maxProcessingTime":0,
        "minProcessingTime":0,
        "averageProcessingTime":-1
      },
      {...
      }
    ]
}
Key Type Summary Child of

total

Integer

Number of available flows detected on the specified Cluster

data

Array

List of available flows detected on the specified Cluster

id

String

ID of the flow

data

type

String

The type of the flow (e.g. a service or a simple flow)

data

status

String

Status of the flow (i.e. RUNNING, STOPPING, PAUSED, STOPPED)

data

asyncEventsReceived

Integer

Number of asynchronous events received

data

executionErrors

Integer

Number of execution errors

data

fatalErrors

Integer

Number of fatal errors

data

inboundEndpoints

Array

List of all inbound endpoints belonging to the flow. Information about inbound endpoint includes protocol, host and port (if applicable), or flow name. Example: vm://greeter

data

syncEventsReceived

Integer

Number of synchronous events received

data

totalEventsReceived

Integer

The total number of messages received by the flow

data

serverId

String

ID of a Cluster

data

auditStatus

String

If audit status permits, the agent audits each call to the message. Default value: "DISABLED". Possible values: "CAPTURING", "PAUSED", "DISABLED", "FULL"

data

flowId

Array

Details that make a flow unique

data

name

String

Flow name. When used as part a url, if there are spaces present, these are replaced by "%20"

flowId

fullName

String

Full name of the flow

flowId

application

String

The name of the application using the flow

flowId

definedInApplication

Boolean

If false, then flow is executed as part of an embedded Mule instance

flowId

favorite

Boolean

True if the flow is identified as favorite flow

data

processedEvents

Integer

Number of messages processed by the flow

data

totalProcessingTime

Integer

The total amount of time in seconds that the flow takes to process all messages

data

maxProcessingTime

Integer

The maximum time in seconds that the flow takes to process a message

data

minProcessingTime

Integer

The minimum time in seconds that the flow takes to process a message

data

averageProcessingTime

Integer

The average amount of time in seconds that the flow takes to process a message

data

Common Return codes

200

The operation was successful

404

The specified server is currently down

500

Error while listing flows

MMC version

From

3.2.2

/api/clusters/{clusterId}/{flowName}/{applicationName}/start

POST

PERFORM FLOW START

Restarts a flow of an application on a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

flowName

String

Name of the flow

applicationName

String

Name of the application to which the flow belongs to

Using CURL

 curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/flows/ChitChat/mule-example-hello/start

Response

The flow started successfully

Common Return codes

200

The operation was successful

500

Error while starting the flow

MMC version

From

3.2.2

/api/clusters/{clusterId}/{flowName}/{applicationName}/pause

POST

PERFORM FLOW PAUSE

Pauses a flow of an application on a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

flowName

String

Name of the flow

applicationName

String

Name of the application to which the flow belongs to

Using CURL

 curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/flows/ChitChat/mule-example-hello/pause

Response

JSON

The flow paused successfully

Common Return codes

200

The operation was successful

500

Error while pausing the flow

MMC version

From

3.2.2

/api/clusters/{clusterId}/{flowName}/{applicationName}/stop

POST

PERFORM FLOW STOP

Stops a flow of an application on a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

flowName

String

Name of the flow

applicationName

String

Name of the application to which the flow belongs to

Using CURL

 curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/flows/ChitChat/mule-example-hello/stop

Response

JSON

The flow stopped successfully

Common Return codes

200

The operation was successful

500

Error while stopping the flow

MMC version

From

3.2.2

Cluster Flow Endpoints

/api/clusters/{clusterId}/flows/{flowName}/{applicationName}/endpoints

GET

LIST ALL FLOW ENDPOINTS

Lists all Flow Endpoints from a Mule application on a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a cluster

flowName

String

Name of the Flow

applicationName

String

Name of the application

Using CURL

 curl --basic -u admin:admin http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/flows/ChitChat/mule-example-hello/endpoints

Response

JSON

{
  "total":1,
  "data":
    [
      {
        "address":"chitchatter",
        "id":"endpoint.vm.chitchatter",
        "type":"VM",
        "status":"started",
        "connector":"connector.VM.mule.default",
        "routedMessages":0,
        "synchronous":true,
        "filtered":false,
        "tx":false
      }
    ]
}
Key Type Summary Child of

total

Integer

Number of endpoints detected

data

List

List of endpoints details

address

String

Address of the endpoint (e.g. "system.out", http://localhost:8888, etc)

data

id

String

Endpoint ID

data

type

String

Endpoint type (e.g. VM)

data

status

String

Status of the endpoint (e.g. started, stopped)

data

connector

String

Connector name

data

routedMessages

Integer

Number of routed messages

data

synchronous

Boolean

True if the endpoint is synchronous

data

filtered

Boolean

True if the endpoint is filtered

data

tx

Boolean

True if the endpoint handles transactions

data

Common Return codes

200

The operation was successful

404

The specified flow doesn’t exist

500

Error while getting endpoints

MMC version

From

3.2.2

/api/clusters/{clusterId}/flows/{flowName}/{applicationName}/endpoints/{endpointId}/start

POST

PERFORM FLOW ENDPOINT START

Starts a flow endpoint belonging to an application on a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

flowName

String

Name of the flow

applicationName

String

Name of the application to which the flow belongs to

endpointId

String

ID of the endpoint

Using CURL

 curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/flows/ChitChat/mule-example-hello/endpoints/endpoint.vm.chitchatter/start

Response

JSON

[
  "endpoint.vm.chitchatter"
]

Common Return codes

200

The operation was successful

404

The flow does not exist

500

Error while starting the endpoint

MMC version

From

3.2.2

/api/clusters/{clusterId}/flows/{flowName}/{applicationName}/endpoints/{endpointId}/stop

POST

PERFORM FLOW ENDPOINT STOP

Stops a flow endpoint belonging to an application on a Cluster.

Request

SYNTAX

Key Type Summary Child of

clusterId

String

ID of a managed cluster

flowName

String

Name of the flow

applicationName

String

Name of the application to which the flow belongs to

endpointId

String

ID of the endpoint

Using CURL

curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/flows/ChitChat/mule-example-hello/endpoints/endpoint.vm.chitchatter/stop

Response

JSON

[
  "endpoint.vm.chitchatter"
]

Common Return codes

200

The operation was successful

404

The flow does not exist

500

Error while starting the endpoint

MMC version

From

3.2.2