Enterprise Integration Zone is brought to you in partnership with:

Nahuel is an electrical engineer turned Software Developer who loves OOD and Java. In his spare time he enjoys clay sculpting, reading novels, and even a bit of carpentry. Nahuel is a DZone MVB and is not an employee of DZone and has posted 2 posts at DZone. You can read more from them at their website. View Full User Profile

The Mule Enterprise Console REST API

02.26.2013
| 2150 views |
  • submit to reddit
When building Mule architectures a company will often need to run several instances of Mule ESB: Some on QA, some on staging, and on production, perhaps some instances running locally and some others in another continent. Managing Clusters of Mule Servers, keeping track of what application is running where, and knowing what is the health of those instances at a glance, or even being warned when something wrong happens… That is Mule Enterprise Console job!

So you can use the UI to manage all your geographically distributed instances, but what about automation?

Yes UI is good, but…

  • You would like to integrate this with your headless continuous build so as soon as you have a new binary, that binary is automatically deployed into QA environment
  • You would like to make sure that binaries deployed on production are the ones built by your continuous build solution, so assert that by  running  against it your security algorithm and then you deploy it
  • You would like to create a  made of your existing Mule instances. And then, be able to deploy applications and manage them and their flows programmatically
  • You would like to be able to control which versions of the applications are deployed. In fact you would like to monitor that and do some polling by the way of your system, that knows how to manage scripting.
  • You would like to deploy some applications to a set of servers and clusters (ie. Server Group) and let the system manage the complexity of deploying apps into each of the member of the Server Group. But wait! For security reasons application is on the server, no FTP allowed, neither a UI.

These tasks, among others, can be performed using Console’s REST API.

Introducing the REST API

The REST API has an important concept here, representations of resources (eg. servers, clusters, security groups), each of which can be identified using an URI.

Once you have a resource identified you can operate over it using a limited set of instructions (ie HTTP verbs). In this phase of the project, all resources are represented using JSON (JavaScript Object Notation) representation, which has parsers in almost any language, and is human readable too.

Quick summary of Operations

  • Register new Mule Servers and manage existing ones, including restarting/stopping  servers, as well as managing files remotely and even managing flows and their endpoints belonging to deployed applications
  • Manage Server Groups, so you have a single point of and you can forget about you geographically distributed environments
  • Manage User Groups and, in particular, the permissions assigned to them
  • Create or remove a Cluster and get information about a cluster, as well as start, stop, and restart applications on it
  • Find, upload, and delete applications inside the Repository, so and application and its different versions will be available when doing a deploy or redeploy
  • Deploy, undeploy, create, update, and delete Deployments inside a Server or Cluster

For further information, and usage examples, you can take a look at the Console’s REST Reference Guide.

Published at DZone with permission of Nahuel Dalla Vecchia, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)