Nav

CloudHub API

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

The CloudHub REST API provides a way for you to programmatically access much of the things you can do through the Runtime Manager. It allows you to:

  • Create an application on CloudHub

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

  • Deploy a new version of your application

  • Delete your application

  • Get statistics about your application

  • Create CloudHub notifications

  • Create e-mail alerts triggered by your applications

Before getting started with specific operations, be sure you’re familiar with Operations for Applications.

This API deals only with cloud deployments via the cloud-based version of the Runtime Manager. See Deployment Strategies for a better understanding of the different possible deployment scenarios. For managing on-prem applications via an API, see the Runtime Manager API Portal

Data Format

All resources or methods that return or accept a type use the JSON as the data format. As an example, here’s data you might receive, in JSON format, in response to a request to get an application:


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "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"
     }
   ]
}

Getting Started and Authenticating with the API

To use the API, you can use any HTTP client. All APIs use JSON as the data format. If you use Java, we recommend you use the Jersey client or HttpClient with Jackson for JSON support.

All APIs require HTTP basic authentication. Your username controls which environment you’re accessing and is of the form "user@enviornment". For example, if your username is jane and you have an environment called "Development", your username is jane@Development. If you don’t specify an environment, it defaults to production.

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, 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, 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 (for example, a 500 status code), the HTTP response contains a JSON response with an error message. For example:


         
      
1
2
3
4
5
6
7
8
500
Content-Type: application/json
Server: Apache-Coyote/1.1
Date: Mon, 10 Aug 2015 00:12:55 GMT
 
{
  message : "Some error message."
}

Check out the API Portal of the CloudHub API to see an interactive reference of all the supported resources, methods, required properties and expected responses.

In the link above, search among other Mule APIs for the "CloudHub" API and click on its latest version.