MuleSoft Provides MMC Rest API's to manage the server, server files, operations on flows and operations on endpoints as shown below.
1. Register a Server
2. Get All Servers
3. Get a Server
4. Unregister a Server
5. Update a Server
6. Get All Applications
7. Restart a Server
8. Stop a Server
9. Get All Files
10. Get a File
11. Create a File
12. Update a File
13. Delete a File
14. Get All Flows
15. Start a Flow
16. Stop a Flow
17. Get All Endpoints
18. Start an Endpoint
19. Stop an Endpoint
2. Introduction
MMC Rest API provides an ability to access the server, files, operations on
flows and operations on endpoints as shown below.
1. Register a Server
2. Get All Servers
3. Get a Server
4. Unregister a Server
5. Update a Server
6. Get All Applications
3. 7. Restart a Server
8. Stop a Server
9. Get All Files
10. Get a File
11. Create a File
12. Update a File
13. Delete a File
4. 14. Get All Flows
15. Start a Flow
16. Stop a Flow
17. Get All Endpoints
18. Start an Endpoint
19. Stop an Endpoint
5. Register a Server
To register a server with MMC, need to provide server name, server agent
URL and group id of the server as shown in the below URL.
curl --basic -u username:password -d '{ "name" : "Server Name", "agentUrl" :
"http://localhost:7777/mmc-support", "groupIds":["server group id"] }' --
header 'Content-Type: application/json'
http://localhost:8585/mmc/api/servers
HTTP Method: POST
6. Get All Servers
To get all servers, need to provide the below URL.
curl --basic -u username:password http://localhost:8585/mmc/api/servers
HTTP Method: GET
7. Get a Server
To get a specific server, need to provide the server id as shown in the
below URL.
curl --basic -u username:password
'http://localhost:8585/mmc/api/servers/{serverId}'
HTTP Method: GET
8. Unregister a Server
To Unregister a specific server, need to provide the server id as shown in
the below URL.
curl --basic -u username:password -X DELETE
'http://localhost:8585/mmc/api/servers/{serverId}'
HTTP Method: DELETE
9. Update a Server
To update a specific server details, need to provide the details for the
server id as shown in the below URL.
curl --basic -u username:password -X PUT -d '{"name" : "New Server Name",
"groups":[{"href":"group id"}]}' --header 'Content-Type: application/json'
'http://localhost:8585/mmc/api/servers/{serverId}'
HTTP Method: PUT
10. Get All Applications
To get all applications on a specific server, need to provide the server id
as shown in the below URL.
curl --basic -u username:password
'http://localhost:8585/mmc/api/servers/{serverId}/applications'
HTTP Method: GET
11. Restart a Server
To restart a server, need to provide the server id as shown in the below
URL.
curl --basic -u username:password
'http://localhost:8585/mmc/api/servers/{serverId}/restart'
HTTP Method: POST
12. Stop a Server
To stop a server, need to provide the server id as shown in the below URL.
curl --basic -u username:password
'http://localhost:8585/mmc/api/servers/{serverId}/stop'
HTTP Method: POST
13. Get All Files
To get all files on a specific server, need to provide the server id as shown
in the below URL.
curl --basic -u username:password
'http://localhost:8585/mmc/api/servers/{serverId}/files'
HTTP Method: GET
14. Get a File
To get a specific file on a specific server, need to provide the relative
path of a file from root folder of server and the server id as shown in the
below URL.
curl --basic -u username:password
'http://localhost:8585/mmc/api/servers/{serverId}/files/{relativePathToFile}'
HTTP Method: GET
15. Create a File
To create a new file on a specific server, need to provide the server id
and the relative file path of a server as shown in the below URL.
curl --basic -u username:password -v --header 'Content-
Type:application/octet-stream' --data-binary '@source.xml'
'http://localhost:8585/mmc/api/servers/{serverId}/files/logs/destination.txt'
HTTP Method: POST
source.xml is a source file name. ’@’ is used to copy the contents of the
source file to destination. If it is not specified then source.xml will be the
contents for the destination file.
destination.txt is the destination file name.
16. Update a File
To replace or update a content/file in the target folder on the specified
server, need to provide the server id and relative path of the file on the
server as shown in the below URL.
curl --basic -u username:password -X PUT --header 'Content-
Type:application/octet-stream' --data-binary '@source.xml'
'http://localhost:8585/mmc/api/servers/{serverId}/files/{relativePathToFile}'
HTTP Method: PUT
17. Delete a File
To delete a file on the specified server, need to provide the server id and
relative file path of the specified server as shown in the below URL.
curl --basic -u username:password -X DELETE
'http://localhost:8585/mmc/api/servers/{serverId}/files/logs/destination.txt'
HTTP Method: DELETE
18. Get All Flows
To get all flows on a server, need to provide server id as shown in the
below URL.
curl --basic -u username:password
'http://localhost:8585/mmc/api/servers/{serverId}/flows'
HTTP Method: GET
19. Start a Flow
To start a flow on a specific server, need to provide the server id,
application name and flow name as shown in the below URL.
curl --basic -u username:password -X POST
'http://localhost:8585/mmc/api/servers/{serverId}/flows/{flowName}/{appli
cationName}/start'
HTTP Method: POST
20. Stop a Flow
To stop a flow on a specific server, need to provide the server id,
application name and flow name as shown in the below URL.
curl --basic -u username:password -X POST
'http://localhost:8585/mmc/api/servers/{serverId}/flows/{flowName}/{appli
cationName}/stop'
HTTP Method: POST
21. Get All Endpoints
To get all endpoints of a specific flow of an application on a specific
server, need to provide server id, application name and flow name as
shown in the below URL.
curl --basic -u username:password
'http://localhost:8585/mmc/api/servers/{serverId}/flows/{flowName}/{appli
cationName}/endpoints'
HTTP Method: GET
22. Start an Endpoint
To start an endpoint of a specific flow of an application on a specific
server, need to provide server id, application name, flow name and
endpoint id as shown in the below URL.
curl --basic -u username:password -X POST
'http://localhost:8585/mmc/api/servers/{serverId}/flows/{flowName}/{appli
cationName}/endpoints/{endpointId}/start'
HTTP Method: POST
23. Stop an Endpoint
To stop an endpoint of a specific flow of an application on a specific
server, need to provide server id, application name, flow name and
endpoint id as shown in the below URL.
curl --basic -u username:password -X POST
'http://localhost:8585/mmc/api/servers/{serverId}/flows/{flowName}/{appli
cationName}/endpoints/{endpointId}/stop'
HTTP Method: POST