POST
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.
Index of Operations:
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
CREATE |
Creates a new Cluster.
Json
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 agent in 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\":\"1.0a\", \"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":"1.0a", "nodes":["local$194cdc5b-2253-4f35-b663-b311e4f28956", "local$ef85a37f-a3c1-4d1f-b8e6-8fac85d2fca7"]}' --header 'Content-Type: application/json' http://localhost:8080/mmc/api/clusters
Json
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 |
— |
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/ |
409 |
A cluster with that name already exists |
From 3.2.2 |
---|
GET |
LIST ALL |
Lists all managed Clusters.
JSON
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 |
200 |
The operation was successful |
400 |
Unauthorized user/ Server Down |
From |
3.2.2 |
/api/clusters/{clusterId}
GET |
LIST |
Lists details for specific Cluster.
Using CURL
curl --basic -u admin:admin http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724
H5. JSON
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 |
— |
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 |
From |
3.2.2 |
/api/clusters/{clusterId}/status
GET |
STATUS |
Lists node status for specific Cluster.
Using CURL
curl --basic -u admin:admin http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/status
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
JSON
200 |
The operation was successful |
500 |
Access Exception/ Some nodes weren’t found/ Cluster node exception |
From |
3.2.2 |
/api/clusters/{clusterId}/restart
POST |
PERFORM RESTART |
Restarts a Cluster.
Using CURL
curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/restart
JSON
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 |
From |
3.2.2 |
/api/clusters/{clusterId}/stop
POST |
PERFORM STOP |
Stops a Cluster.
Mule Applications
/api/clusters/{clusterId}/applications
GET |
LIST ALL MULE APPS |
Lists all Mule applications currently deployed successfully on a Cluster.
Using CURL
curl --basic -u admin:admin http://localhost:8080/mmc/api/clusters/cf1fc78b-23a1-491e-93d1-6cc2819c4724/applications
JSON
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 |
200 |
The operation was successful |
From |
3.2.2 |
/api/clusters/{clusterId}/applications/{applicationName}/start
POST |
PERFORM START MULE APP |
Starts an application from a Cluster.
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
JSON
Key
Type
Summary
Child of
total
Integer
Number of started applications
data
List
List of started applications
200 |
The operation was successful |
400 |
At least one application name must be supplied |
From |
3.2.2 |
/api/clusters/{clusterId}/applications/{applicationName}/restart
POST |
PERFORM RESTART MULE APP |
Restarts an application from a Cluster.
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
JSON
Key
Type
Summary
Child of
total
Integer
Number of started applications
data
List
List of restarted applications
200 |
The operation was successful |
400 |
At least one application name must be supplied |
From |
3.2.2 |
/api/clusters/{clusterId}/applications/{applicationName}/stop
POST |
PERFORM STOP MULE APP |
Stops an application from a Cluster.
SYNTAX
Key | Type | Summary | Child of |
---|---|---|---|
clusterId |
String |
ID of a managed cluster |
— |
applicationName |
String |
Name of the application to be started |
— |
Cluster Flows
/api/clusters/{clusterId}/flows
GET |
LIST ALL FLOWS |
Lists all available flows belonging to Mule applications currently deployed successfully on a Cluster.
SYNTAX
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
JSON
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 |
200 |
The operation was successful |
404 |
The specified server is currently down |
500 |
Error while listing flows |
From |
3.2.2 |
/api/clusters/{clusterId}/{flowName}/{applicationName}/start
POST |
PERFORM FLOW START |
Restarts a flow of an application on a Cluster.
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
JSON
200 |
The operation was successful |
500 |
Error while starting the flow |
From |
3.2.2 |
/api/clusters/{clusterId}/{flowName}/{applicationName}/pause
POST |
PERFORM FLOW PAUSE |
Pauses a flow of an application on a Cluster.
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
JSON
200 |
The operation was successful |
500 |
Error while pausing the flow |
From |
3.2.2 |
/api/clusters/{clusterId}/{flowName}/{applicationName}/stop
POST |
PERFORM FLOW STOP |
Stops a flow of an application on a Cluster.
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 |
— |
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.
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
JSON
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 |
200 |
The operation was successful |
404 |
The specified flow doesn’t exist |
500 |
Error while getting endpoints |
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.
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
JSON
200 |
The operation was successful |
404 |
The flow does not exist |
500 |
Error while starting the endpoint |
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.
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 |
— |