Contact Free trial Login

CloudHub API

logo cloud active logo hybrid disabled logo server disabled logo pcf disabled

The CloudHub REST API enables you to programmatically access these functions of Runtime Manager:

  • Create an application on CloudHub.

  • Deploy a new version of your application.

  • Change the application properties, including the number of workers and environment variables.

  • Get statistics about your application.

  • Create CloudHub notifications.

  • Create email alerts triggered by your applications.

  • Delete your application.

For an interactive reference that includes supported resources, methods, required properties, and expected responses, see CloudHub API Portal.

The CloudHub API only manages applications deployed to the cloud-based version of Runtime Manager. To manage on-prem applications using an API, see Runtime Manager API Portal.

Getting Started and Authenticating with the API

Before getting started, familiarize yourself with operations for applications.

You can use any HTTP client with the CloudHub API. With Java, use the Jersey client or HttpClient with Jackson for JSON support.

To access the CloudHub API, first authenticate with Anypoint Platform. To authenticate, use the Access Management API. Authentication requires that you supply an access token in the Authorization header. See Authentication for information.

Your username specifies the environment to access and is in the form "user@environment". For example, if your username is "jane" and the environment is "Development", your username is jane@Development. If you don’t specify an environment, the API defaults to Production.

Data Format

Resources and methods that return or accept a type use the JSON data format. Here is an example of data received in JSON format in response to a request to get an application:

{
  "domain":"hello",
  "fullDomain":"hello.cloudhub.io",
  "workers":1,
  "hasFile":false,
  "muleVersion": "3.1.2",
  "properties": {
    "foo":"bar"
  },
  "status":"STARTED",
  "workerStatuses":[
     {
       "id":"",
       "host":"xxx.xxx.xxx.xxx",
       "port":8081,
       "status":"STARTED"
     }
   ]
}

Status Codes and Error Handling

When you call the REST APIs, the following status codes are returned:

Status Code Description

200

The operation was successful.

201

The resource (such as an application) was created.

The Location header contains the location of the resource.

404

The resource was not found.

409

When creating a resource (such as a server, server group, or deployment), a resource with that name already exists.

500

The operation was unsuccessful.

See the HTTP body for details.

When errors occur (such as a 500 status code), the HTTP response contains a JSON response with an error message:

500
Content-Type: application/json
Server: Apache-Coyote/1.1
Date: Mon, 10 Aug 2015 00:12:55 GMT

{
  message : "Some error message."
}

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.