Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Servers

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, Mule Servers 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.


         
      
1
/api/servers

POST

PAIR/REGISTER

Pairs a new Server.

JSON

Key Type Summary Child of

name

String

The name of the newly registered server

agentUrl

String

The URL to the location of the Mule Management Console agent on the local or remote server

groupIds

Array

IDs of existing Server Groups that the newly registered server will belong to

*Using CURL on Windows()


    
            
         
1
 curl --basic -u admin:admin -d "{ \"name\" : \"Test\", \"agentUrl\" : \"http://localhost:7777/mmc-support\", \"groupIds\":[\"0bc8932b-8463-46cd-9a1f-77060756c5c0\"] }" --header "Content-Type: application/json" http://localhost:8080/mmc/api/servers

Using CURL on Linux


    
            
         
1
 curl --basic -u admin:admin -d '{ "name" : "Test", "agentUrl" : "http://localhost:7777/mmc-support", "groupIds":["0bc8932b-8463-46cd-9a1f-77060756c5c0"] }' --header 'Content-Type: application/json' http://localhost:8080/mmc/api/servers

JSON


    
            
         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
  "name":"Test",
  "id":"local$f151c1cb-634a-4da5-baba-806ee4a09464",
  "version":"3.3.0",
  "groups":
    [
      {
        "name":"Production",
        "href":"http://localhost:8080/mmc/api/serverGroups/0bc8932b-8463-46cd-9a1f-77060756c5c0"
      }
    ],
  "status":"OK",
  "href":"http://localhost:8080/mmc/api/servers/local$f151c1cb-634a-4da5-baba-806ee4a09464",
  "runningServices":-1,
  "hostIp":"172.16.20.131",
  "agentUrl":"https://localhost:7777/mmc-support",
  "muleServerId":"00_mmc-agent",
  "started":"Thu Aug 16 12:18:39 ART 2012",
  "agents":
    [
      {
        "name":"mmc-support",
        "description":"Mule ESB Enterprise Support (0.0.0.0:7777)"
      },
      {
        "name":"_muleClusterSupportAgent",
        "description":"Clustering Agent"
      },
      {
        "name":"jmx-agent",
        "description":"JMX Agent"
      }
    ],
  "pausedServices":-1,
  "stoppedServices":-1
}
Key Type Summary Child of

name

String

The name of the newly registered server

id

String

The ID of the newly registered server

version

String

Version of the server (e.g. "3.3.0")

groups

Array

Server Groups that the newly registered server belongs to

name

String

Name of the Server Groups that the newly registered server belongs to

groups

href

String

Full link to the Server Groups that the newly registered server belongs to

groups

status

String

Status of the Server (e.g. UNKNOWN, STOPPED, WAITING_FOR_RESTART, STARTING, OK, WARN, ERROR)

href

String

Full link to the resource

runningServices

Integer

Number of running services on the Server

hostIp

String

IP of the host where the Mule instance is running

agentUrl

String

Agent URL. When paired, HTTPS protocol is used instead of plain HTTP

muleServerId

String

Name of the Agent

started

String

Time-date plus timezone from which the server was started

agents

Array

List of running Agents on the Mule instance

name

String

Name of the running Agent

agents

description

String

Description of the purpose of the running Agent

agents

pausedServices

Integer

Number of paused services on the Server

stoppedServices

Integer

Number of stopped services on the server

201

Server successfully paired/registered

400

Policies do not allow adding the specified server/ Invalid Agent URL/ Name must be supplied/ Server URL must be supplied/ A server with that name already exists

409

Could not pair server/ Server is already paired

500

Error while pairing the Server

From

3.2.2

GET LIST ALL

Lists all available Servers.

SYNTAX

Key Type Summary Child of

serverGroupId

String

(Optional) ID of a Server Group. If specified, only servers belonging to that Server Group are displayed. If not specified, results are not filtered

*Using CURL()


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

JSON


    
            
         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  "total":1,
  "data":
    [
      {
        "name":"Test",
        "id":"local$a89eb3d0-68b9-44a0-9f6b-712b0895f469",
        "version":"3.3.0",
        "groups":
          [
            {
              "name":"Production",
              "href":"http://localhost:8080/mmc/api/serverGroups/0bc8932b-8463-46cd-9a1f-77060756c5c0"
            }
          ],
        "status":"OK",
        "href":"http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469",
        "runningServices":4,"hostIp":"172.16.20.131",
        "agentUrl":"https://localhost:7777/mmc-support",
        "muleServerId":"00_mmc-agent",
        "started":"Thu Aug 16 12:18:39 ART 2012",
        "agents":
          [
            {
              "name":"mmc-support",
              "description":"Mule ESB Enterprise Support (0.0.0.0:7777)"
            },
            {
              "name":"_muleClusterSupportAgent",
              "description":"Clustering Agent"
            },
            {
              "name":"jmx-agent",
              "description":"JMX Agent"
            }
          ],
        "pausedServices":0,
        "stoppedServices":0
      }
    ]
}
Key Type Summary Child of

total

Integer

Number of available registered servers

data

Array

Available servers details

name

String

The name of the newly registered server

data

id

String

The ID of the newly registered server

data

version

String

Version of the server

data

groups

Array

Server Groups that the newly registered server belongs to

data

name

String

Name of the Server Groups that the newly registered server belongs to

groups

status

String

Status of the Server (e.g. OK, STOPPED)

href

String

Full link to the Server Groups that the newly registered server belongs to

groups

runningServices

Integer

IntegerNumber of running services on the Server

data

hostIp

String

IP of the host where the Mule instance is running

data

agentUrl

String

Agent URL. When paired, the HTTPS protocol is used instead of plain HTTP

data

muleServerId

String

Name of the Agent

data

started

String

Time-date plus timezone from which the server was started

data

agents

Array

List of running Agents on the Mule instance

data

name

String

Name of the running Agent

agents

description

String

Description of the running Agent purpose

agents

pausedServices

Integer

Number of paused services on the Server

data

stoppedServices

Integer

Number of stopped services on the server

data

200

The operation was successful

401

Unauthorized user

404

A server group with that ID was not found

From

3.2.2


         
      
1
/api/server/\{serverId}
GET LIST

Lists details for a specific Server.

SYNTAX

Key Type Summary Child of

serverId

String

ID of the server to be listed. Invoke LIST ALL to obtain it

Using CURL on Windows


    
            
         
1
 curl --basic -u admin:admin http://localhost:8080/mmc/api/servers/local$97e3c184-09ed-423e-a5a5-9b94713a9e36

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin 'http://localhost:8080/mmc/api/servers/local$97e3c184-09ed-423e-a5a5-9b94713a9e36'

JSON

Key Type Summary Child of

name

String

The name of the newly registered server

id

String

The ID of the newly registered server

version

String

Version of the server

groups

Array

Server Groups that the newly registered server belongs to

name

String

Name of the Server Groups that the newly registered server belongs to

groups

href

String

Full link to the Server Groups that the newly registered server belongs to

groups

status

String

Status of the Server (e.g. OK, STOPPED)

href

String

Full link to the Server Groups that the newly registered server belongs to

groups

runningServices

Integer

Number of running services on the Server

hostIp

String

IP of the host where the Mule instance is running

agentUrl

String

Agent URL. When paired, the HTTPS protocol is used instead of plain HTTP

muleServerId

String

Name of the Agent

started

String

Time-date plus timezone from which the server was started

agents

Array

List of running Agents on the Mule instance

name

String

Name of the running Agent

agents

description

String

Description of the running Agent purpose

agents

pausedServices

Integer

Number of paused services on the Server

stoppedServices

Integer

Number of stopped services on the server

401

Unauthorized user

404

A server with that ID was not found

From

3.2.2

DELETE UNPAIR/UNREGISTER

Unpairs/unregister a specific Server.

SYNTAX

Key Type Summary Child of

serverId

String

Id of the server to be unpaired/unregistered. Invoke LIST ALL to obtain it

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin -X DELETE http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin -X DELETE 'http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469'

JSON


    
            
         
1
200 OK

200

The operation was successful

401

Unauthorized user

404

A Server with that ID was not found

500

Error while unregistering the server

From

3.2.2


         
      
1
/api/servers/\{serverId}
PUT UPDATE

Updates a specific Server.

JSON


    
            
         
1
2
3
4
5
6
7
{
  "name": "New Server Name",
  "groups":
    [
      "local$1b8ee6e2-043c-403c-b404-af3aa74d6f92", "local$1b8ee6e5-047c-403c-b404-af3aa74d6f59"
    ]
}
Key Type Summary Child of

name

String

New name for the Server

groups

Array

List of Server Groups that the Server will belong to

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin -X PUT -d "{ \"name\" : \"New Server Name\", \"groups\":[{\"href\":\"0bc8932b-8463-46cd-9a1f-77060756c5c0\"}]}" --header "Content-Type: application/json" http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin -X PUT -d '{"name" : "New Server Name", "groups":[{"href":"0bc8932b-8463-46cd-9a1f-77060756c5c0"}]}' --header 'Content-Type: application/json' 'http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469'

JSON


    
            
         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
  "name":"New Server Name",
  "id":"local$a89eb3d0-68b9-44a0-9f6b-712b0895f469",
  "version":"3.3.0",
  "groups":
    [
      {
        "name":"Production",
        "href":"http://localhost:8080/mmc/api/serverGroups/0bc8932b-8463-46cd-9a1f-77060756c5c0"
      }
    ],
  "status":"OK",
  "href":"http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469",
  "runningServices":4,
  "hostIp":"172.16.20.131",
  "agentUrl":"https://localhost:7777/mmc-support",
  "muleServerId":"00_mmc-agent",
  "started":"Thu Aug 16 12:18:39 ART 2012",
  "agents":
    [
      {
        "name":"mmc-support",
        "description":"Mule ESB Enterprise Support (0.0.0.0:7777)"
      },
      {
        "name":"_muleClusterSupportAgent",
        "description":"Clustering Agent"
      },
      {
        "name":"jmx-agent",
        "description":"JMX Agent"
      }
    ],
  "pausedServices":0,
  "stoppedServices":0
}
Key Type Summary Child of

name

String

The name of the newly registered server

id

String

The ID of the newly registered server

version

String

Version of the server

groups

Array

Server Groups that the newly registered server belongs to

name

String

Name of the Server Groups that the newly registered server belongs to

groups

status

String

Status of the Server (e.g. OK, STOPPED)

href

String

Full link to the Server Groups that the newly registered server belongs to

groups

runningServices

Integer

Number of running services on the Server

hostIp

String

IP of the host where the Mule instance is running

agentUrl

String

Agent URL. When paired, the HTTPS protocol is used instead of plain HTTP

muleServerId

String

Name of the Agent

started

String

Time-date plus timezone from which the server was started

agents

Array

List of running Agents on the Mule instance

name

String

Name of the running Agent

agents

description

String

Description of the running Agent purpose

agents

pausedServices

Integer

Number of paused services on the Server

stoppedServices

Integer

Number of stopped services on the server

200

The operation was successful

401

Unauthorized user

404

A Server with that ID was not found

500

Error while updating server

From

3.2.2


         
      
1
/api/servers/\{serverId}/applications
GET LIST APPLICATIONS

Lists all available deployed applications on a specific Server.

SYNTAX


    
            
         
1
GET http://localhost:8080/mmc/api/servers/{serverId}/applications
Key Type Summary Child of

serverId

String

ID of a Server

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469/applications

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin 'http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469/applications'

JSON


    
            
         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  "total":3,
  "data":[
    {
      "name":"mule-example-hello",
      "status":"STARTED",
      "configResources": ["mule-config.xml"],
      "appProperties":
        {
          "app.home":"C:\\mule-enterprise-standalone\\apps\\mule-example-hello",
          "app.name":"mule-example-hello"
        },
      "redeploymentEnabled":true,
      "parentFirstClassLoader":false
    },
    {
      "name":"00_mmc-agent",
      "status":"STARTED",
      "configResources":["mule-config.xml"],
      "appProperties":
        {
          "app.home":"C:\\mule-enterprise-standalone\\apps\\00_mmc-agent",
          "app.name":"00_mmc-agent"
        },
      "redeploymentEnabled":false,
      "parentFirstClassLoader":false
    },
    {
      "name":"default",
      "status":"STARTED",
      "configResources":["mule-config.xml"],
      "appProperties":
        {
          "app.home":"C:\\mule-enterprise-standalone\\apps\\default",
          "app.name":"default"
        },
      "redeploymentEnabled":true,
      "parentFirstClassLoader":false
    }
  ]
}
Key Type Summary Child of

total

Integer

Number of applications currently deployed

data

Array

List of deployed applications

name

String

Name of the application

data

status

String

Status of the deployed application

data

configResources

Array

List of files specifying flow(s) configuration

data

appProperties

Array

Properties of the deployed application

data

app.home

String

Fully qualified path to the application

appProperties

app.name

String

Application name

appProperties

redeploymentEnabled

Boolean

If true, application can be redeployed

data

parentFirstClassLoader

Boolean

[DEPRECATED]

data

200

The operation was successful

From

3.2.2


         
      
1
/api/servers/\{serverId}/restart
POST PERFORM RESTART

Restarts a Server.

SYNTAX


    
            
         
1
POST http://localhost:8080/mmc/api/servers/{serverId}/restart
Key Type Summary Child of

serverId

String

ID of a registered server

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469/restart

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin 'http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469/restart'

JSON


    
            
         
1
200 OK

200

The operation was successful

500

Internal server error

From

3.2.2


         
      
1
/api/servers/\{serverId}/stop
POST PERFORM STOP

Stops a Server.

SYNTAX


    
            
         
1
POST http://localhost:8080/mmc/api/servers/{serverId}/stop
Key Type Summary Child of

serverId

String

ID of a registered server

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469/stop

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin 'http://localhost:8080/mmc/api/servers/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469/stop'

JSON


    
            
         
1
200 OK

200

The operation was successful

500

Internal server error

From

3.2.2

Server Files


         
      
1
/api/server/\{serverId}/files
GET LIST FILES

Lists files on a specific Server.

SYNTAX


    
            
         
1
GET http://localhost:8080/mmc/api/servers/{serverId}/files
Key Type Summary Child of

serverId

String

ID of the server to be listed. Invoke LIST ALL to obtain it

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin http://localhost:8080/mmc/api/servers/local$97e3c184-09ed-423e-a5a5-9b94713a9e36/files

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin 'http://localhost:8080/mmc/api/servers/local$97e3c184-09ed-423e-a5a5-9b94713a9e36/files'

JSON


    
            
         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  "total":12,
  "data":
    [
      {
        "name":".mule",
        "size":4096,
        "absolutePath":"C:\\mule-enterprise-standalone\\.mule",
        "directory":true,
        "lastModified":1345835067600,
        "friendlySize":"",
        "userCanExecute":true,
        "userCanRead":true,
        "userCanWrite":true,
        "friendlyName":".mule/"
      },
    "..."
      {
        "name":"README.txt",
        "size":4559,
        "absolutePath":"C:\\mule-enterprise-standalone\\README.txt",
        "directory":false,
        "lastModified":1339032294000,
        "friendlySize":"4 KB",
        "userCanExecute":true,
        "userCanRead":true,
        "userCanWrite":true,
        "friendlyName":"README.txt"
      }
    ]
}
Key Type Summary Child of

total

Integer

Number of applications currently deployed

data

Array

List of deployed applications

name

String

Name of the application

data

size

Integer

Size of the file in bytes

 — 

absolutePath

String

Absolute path of the file/folder

 — 

directory

Boolean

True if the entry is a directory

 — 

lastModifed

Long

Last modified time since epoch

 — 

friendlySize

String

Human readable size of the file

 — 

userCanExecute

Boolean

True if User can execute the file

 — 

userCanRead

Boolean

True if User can read the file

 — 

friendlyName

String

Friendly name of the file

 — 

200

The operation was successful

404

The location does not exist

405

Unauthorized user

From

3.2.2


         
      
1
/api/server/\{serverId}/files/\{relative path to file}
GET LIST FILE

Get a specific file from a specific Server.

SYNTAX


    
            
         
1
GET http://localhost:8080/mmc/api/servers/{serverId}/files/{relativePathToFile}[?metadata=true]
Key Type Summary Child of

serverId

String

ID of the server to be listed. Invoke LIST ALL to obtain it

relativePathToFile

String

Relative path to a specific file from the root folder of the server

metadata

Boolean

(Optional) If false, file is returned, if true, high level file description is returned. Default value is false.

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/files/bin/mule

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin 'http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/files/bin/mule'

JSON


    
            
         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Metadata=false
[Actual file]
 
Metadata=true:
{
  "name":"mule",
  "size":20237,
  "absolutePath":"C:\\mule-enterprise-standalone\\bin\\mule",
  "directory":false,
  "lastModified":1345598472000,
  "friendlySize":"19 KB",
  "userCanExecute":true,
  "userCanRead":true,
  "userCanWrite":true,
  "friendlyName":"mule"
}
Key Type Summary Child of

name

String

Name of the file

size

Long

Syze of the file in bytes

absolutePath

String

Absolute path of the file

directory

Boolean

True if the entry is a directory

lastModified

Long

Last modified time since epoch

friendlySize

String

Human readable size of the file

userCanExecute

Boolean

True if User can execute the file

userCanRead

Boolean

True if User can read the file

userCanWrite

Boolean

True if User can write the file

friendlyName

String

Friendly name of the file

200

The operation was successful

404

The location does not exist

From

3.2.2


         
      
1
/api/server/\{serverId}/files/\{relative path to file to be created}
POST CREATE REMOTE FILE

Creates a new file in the specified server and folder.
The source of the new file can be an existing file, or inline content.
EOL from the source is converted to the native representation of the platform where the agent is running.

SYNTAX


    
            
         
1
POST http://localhost:8080/mmc/api/server/{serverId}/files/{relative path to file to be created}
Key Type Summary Child of

serverId

String

ID of a registered server

relative path to file to be created

String

Eg. myLog/myUser/myFile.txt

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin -v --header "Content-Type:application/octet-stream" --data-binary "@test.xml" http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/files/logs/fileOnLogsFolder.txt

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin -v --header 'Content-Type:application/octet-stream' --data-binary '@test.xml' 'http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/files/logs/fileOnLogsFolder.txt'
  • "test.xml" is the source file in the example. You can provide full path or file name. In the last case, the file should be placed at the same folder than the one containing the curl executable.

  • "@" is mandatory when specifying the source file is you want to copy the file contents. If "@"is not specified, then the new file being created will have the inline content itself as source (e.g. test.xml in this case).

  • "fileOnLogsFolder.txt" in the example is the file to be created on the specified folder.

JSON


    
            
         
1
200 OK

200

The operation was successful

500

Internal error

From

3.2.2

PUT UPDATE/REPLACE REMOTE FILE

Replaces a target file with the provided source file (or inline content) on the specified server and folder.

EOL from source is converted to a native representation of the platform where the agent is running.

SYNTAX


    
            
         
1
PUT http://localhost:8080/mmc/api/server/{serverId}/files/{relative path to file to be replaced}
Key Type Summary Child of

serverId

String

ID of a registered server

relative path to file to be replaced

String

Eg. myLog/myUser/myFile.txt

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin -X PUT --header "Content-Type:application/octet-stream" --data-binary "@test.xml" http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/files/logs/fileOnLogsFolder.txt

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin -X PUT --header 'Content-Type:application/octet-stream' --data-binary '@test.xml' 'http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/files/logs/fileOnLogsFolder.txt'
  • "test.xml" is the source file in the example. You can provide full path or file name. In the last case, the file should be placed at the same folder than the one containing the curl executable.

  • "@" is mandatory when specifying the source file is you want to copy the file contents. If "@"is not specified, then the new file being created will have the inline content itself as source (e.g. test.xml in this case).

  • In the example above, "fileOnLogsFolder.txt" is the file to be replaced on the specified folder.

JSON


    
            
         
1
200 OK

200

The operation was successful

404

File not found

405

Unauthorized user

500

Could not upload file

From

3.2.2

DELETE DELETE REMOTE FILE

Deletes a target file on the specified server and folder.

SYNTAX


    
            
         
1
DELETE http://localhost:8080/mmc/api/server/{serverId}/files/{relative path to file to be deleted}
Key Type Summary Child of

serverId

String

ID of a registered server

relative path to file to be deleted

String

Eg. myLog/myUser/myFile.txt

*Using CURL on Windows*

    
            
         
1
curl --basic -u admin:admin -X DELETE http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/files/logs/fileOnLogsFolder.txt

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin -X DELETE 'http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/files/logs/fileOnLogsFolder.txt'
  • "fileOnLogsFolder.txt" in the example is the file to be deleted on the specified folder.

JSON


    
            
         
1
200 OK

200

The operation was successful

From

3.2.2

Server Flows


         
      
1
/api/server/\{serverId}/flows
GET LIST FLOWS

Lists available flows on a specific Server.

SYNTAX


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

serverId

String

ID of the server to be listed. Invoke LIST ALL to obtain it

refreshStats

Boolean

(Optional) If true, forces stats refresh

Using CURL on Windows


    
            
         
1
 curl --basic -u admin:admin http://localhost:8080/mmc/api/servers/local$97e3c184-09ed-423e-a5a5-9b94713a9e36/flows

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin 'http://localhost:8080/mmc/api/servers/local$97e3c184-09ed-423e-a5a5-9b94713a9e36/flows'

JSON


    
            
         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
  "total":4,
  "data":
    [
      {
        "id":"local$35443304-3a90-43f3-a26e-df3eaf03936e/Hello World",
        "type":"flow",
        "status":"RUNNING",
        "serverId":"local$35443304-3a90-43f3-a26e-df3eaf03936e",
        "auditStatus":"DISABLED",
        "flowId":
          {
            "name":"Hello World",
            "fullName":"Hello World [mule-example-hello]",
            "application":"mule-example-hello",
            "definedInApplication":true
          },
        "asyncEventsReceived":0,
        "executionErrors":0,
        "fatalErrors":0,
        "inboundEndpoints":
          [
            "+http://localhost:8888+","servlet://name","vm://greeter"
          ],
        "syncEventsReceived":0,
        "totalEventsReceived":0,
        "averageProcessingTime":0,
        "minProcessingTime":0,
        "maxProcessingTime":0,
        "totalProcessingTime":0,
        "processedEvents":0,
        "favorite":false
      },
      "..."
    ]
}
Key Type Summary Child of

total

Integer

Number of available flows detected on the specified Server

data

Array

List of available flows detected on the specified Server

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

serverId

String

ID of the Server where the flow runs

data

auditStatus

String

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

data

flowId

List

Details that make a flow unique

data

name

String

Flow name. When used as part of a URL, any spaces present 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 embeded Mule instance

flowId

asyncEventsReceived

Integer

The number of asynchronous events received

data

executionErrors

Integer

The number of execution errors

data

fatalErrors

Integer

The 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

The number of synchronous events that were received

data

totalEventsReceived

Integer

The total number of messages received by the flow

data

averageProcessingTime

Integer

The average amount of 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

maxProcessingTime

Integer

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

data

totalProcessingTime

Integer

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

data

processedEvents

Integer

The number of messages processed by the flow

data

favorite

Boolean

True if identified as favorite flow

data

200

The operation was successful

404

The specified server is currently down

500

Error while listing flows

From

3.2.2


         
      
1
/api/server/\{serverId}/flows/\{flowName}/\{applicationName}/start
POST PERFORM FLOW START

Starts a specific flow.

SYNTAX


    
            
         
1
POST http://localhost:8080/mmc/api/servers/{serverId}/flows/{flowName}/{applicationName}/start
Key Type Summary Child of

serverId

String

ID of the server to be listed. Invoke LIST ALL to obtain it

flowName

String

Name of the flow whose endpoints will be determined

applicationName

String

Application Name to which the flow belongs to

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/start

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin -X POST 'http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/start'

JSON


    
            
         
1
The flow started successfully

If flow is already started, the following message is returned:


         
                 
              
1
{"message":"Error while starting flow"}

200

The operation was successful

404

Flow doesn’t exist

500

Error while starting flow

From

3.2.2


         
      
1
/api/server/\{serverId}/flows/\{flowName}/\{applicationName}/stop
POST PERFORM FLOW STOP

Stops a specific flow.

SYNTAX


    
            
         
1
POST http://localhost:8080/mmc/api/servers/{serverId}/flows/{flowName}/{applicationName}/stop
Key Type Summary Child of

serverId

String

ID of the server to be listed. Invoke LIST ALL to obtain it

flowName

String

Name of the flow whose endpoints will be determined

applicationName

String

Application Name to which the flow belongs to

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/stop

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin -X POST 'http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/stop'

JSON


    
            
         
1
The flow stopped succesfully

If flow is already stopped the following message is returned:


         
                 
              
1
{"message":"Error while starting flow"}

200

The operation was successful

404

Flow doesn’t exist

500

Error while stopping flow

From

3.2.2

Server Flows Endpoints


         
      
1
/api/server/\{serverId}/\{flowName}/\{applicationName}/endpoints
GET LIST FLOWS ENDPOINTS

Lists available endpoints belonging to specific flows.

SYNTAX


    
            
         
1
GET http://localhost:8080/mmc/api/servers/{serverId}/flows/{flowName}/{applicationName}/endpoints
Key Type Summary Child of

serverId

String

ID of the server to be listed. Invoke LIST ALL to obtain it

flowName

String

Name of the flow from which is desired to determine its endpoints

applicationName

String

Application Name to which the flow belongs to

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/endpoints

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin 'http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/endpoints'
If flow name contain spaces, replace them by "%20" when typing the URL to locate the resource.

JSON


    
            
         
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  "total":3,
  "data":
    [
      {
        "address":"+http://localhost:8888+",
        "id":"endpoint.http.localhost.8888",
        "type":"http",
        "status":"started",
        "connector":"connector.http.mule.default",
        "filtered":false,
        "routedMessages":0,
        "synchronous":true,
        "tx":false
      },
      {
        "address":"name",
        "id":"endpoint.servlet.name",
        "type":"servlet",
        "status":"started",
        "connector":"connector.servlet.mule.default",
        "filtered":false,
        "routedMessages":0,
        "synchronous":true,
        "tx":false
      },
      {
        "address":"greeter",
        "id":"endpoint.vm.greeter",
        "type":"VM",
        "status":"started",
        "connector":"connector.VM.mule.default",
        "filtered":false,
        "routedMessages":0,
        "synchronous":true,
        "tx":false
      }
    ]
}
Key Type Summary Child of

total

Integer

Number of endpoint detected

data

List

List of endpoint details

address

String

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

data

id

String

ID of the endpoint

data

type

String

Type of the endpoint (e.g. VM)

data

status

String

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

data

connector

String

Connector name

data

filtered

Boolean

True if the endpoint is filtered

data

routedMessages

Integer

Number of routed messages

data

synchronous

Boolean

True if the endpoint is synchronous

data

tx

Boolean

True if the endpoint handles transactions

data

200

The operation was successful

404

The specified flow does not exist

500

Error while getting endpoints

From

3.2.2


         
      
1
/api/server/\{serverId}/flows/\{flowName}/\{applicationName}/endpoints/\{endpointId}/start
POST PERFORM FLOW ENDPOINT START

Starts a specific endpoint.

SYNTAX


    
            
         
1
POST http://localhost:8080/mmc/api/servers/{serverId}/flows/{flowName}/{applicationName}/endpoints/{endpointId}/start
Key Type Summary Child of

serverId

String

ID of a registered server

flowName

String

Name of the flow that the endpoint belongs to

applicationName

String

Name of the application using the flow

endpointId

String

ID of the endpoint

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/endpoints/endpoint.http.localhost.8888/start

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin -X POST 'http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/endpoints/endpoint.http.localhost.8888/start'

JSON


    
            
         
1
2
3
[
  "endpoint.http.localhost.8888"
]

200

The operation was successful

404

Flow doesn’t exist

409

No valid endpoint names specified

500

Error while starting endpoints

From

3.2.2


         
      
1
/api/server/\{serverId}/flows/\{flowName}/\{applicationName}/endpoints/\{endpointId}/stop
POST PERFORM FLOW ENDPOINT STOP

Stops a specific endpoint.

SYNTAX


    
            
         
1
POST http://localhost:8080/mmc/api/servers/{serverId}/flows/{flowName}/{applicationName}/endpoints/{endpointId}/stop
Key Type Summary Child of

serverId

String

ID of a registered server

flowName

String

Name of the flow that the endpoint belongs to

applicationName

String

Name of the application using the flow

endpointId

String

ID of the endpoint

Using CURL on Windows


    
            
         
1
curl --basic -u admin:admin -X POST http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/endpoints/endpoint.http.localhost.8888/stop

Using CURL on Linux


    
            
         
1
curl --basic -u admin:admin -X POST 'http://localhost:8080/mmc/api/servers/local$24600824-af33-4394-8e39-93f9fcf4faae/flows/Hello%20World/mule-example-hello/endpoints/endpoint.http.localhost.8888/stop'

JSON


    
            
         
1
2
3
[
  "endpoint.http.localhost.8888"
]

200

The operation was successful

404

Flow doesn’t exist

409

No valid endpoints names specified

500

Error while stopping endpoints

From

3.2.2