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.
The CloudHub API only manages applications deployed to the cloud-based version of Runtime Manager. To manage on-prem applications using an API,
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.
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. Learn from Mule 4 Online Training
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"
}
]
}
Cloudhub API
The Cloudhub Public API allows you to deploy and manage applications in CloudHub. You can deploy your application, manage schedules and queues within an application, and view logs pertaining to an application. You can also view memory and cpu usage and get statistics about the Mule messages sent using the application.
Overview
You can access the API through an interface provided by the Runtime Manager. The Runtime Manager UI enables access to all of the API endpoints.
The Cloudhub Public API provides a one month retention policy for statistics data. It also enforces a usage limit of 250 connections per application and 500 requests per IP address. Get more from Mulesoft Training
To access this API you must send a request with a valid token. See the Getting Started section to understand how to obtain a token and use it in this API.
To access the API you can use the curl command to make calls to the endpoint directly while supplying the access token and authorization header.
Getting Started
To start using the API, the you need to authenticate using Anypoint Access Management and select Runtime Manager after logging in. You can also access the API by including the access token obtained by authenticating via Anypoint Access Management in every request.
Example API Calls
The following example shows how to retrieve schedules for an application.
Request:
curl -X GET \
-H 'Authorization:bearer ea27ee48-43d3-4d63-a71c-e7cf3c9ff167' \
-H 'X-ANYPNT-ENV-ID:3a654a5a-dc7f-4b39-997e-55dbd9675bb7' \
-H 'X-ANYPNT-ORG-ID:f1f2a7eb-995f-456f-a295-62a9ec9285da' \
'https://anypoint.mulesoft.com/cloudhub/api/applications/stats-gath/schedules?_=1517351860955'
Response:
[
{
"id":"5a0f6f0696c73657e379c99b_vmpersistentqueue_pocFlow1_polling_vmpersistentqueue_pocFlow1_1",
"flow":"vmpersistentqueue_pocFlow1","name":"vmpersistentqueue_pocFlow1 Poll",
"href":"wss://anypoint.mulesoft.com/api/applications/stats-gath/schedules/5a0f6f0696c73657e379c99b_vmpersistentqueue_pocFlow1_polling_vmpersistentqueue_pocFlow1_1",
"lastRun":"2018-01-27T06:28:02.483Z",
"enabled":true,
"status":"IDLE",
"schedule":{"timeUnit":"seconds","period":1},
"run-href":"wss://anypoint.mulesoft.com/api/applications/stats-gath/schedules/5a0f6f0696c73657e379c99b_vmpersistentqueue_pocFlow1_polling_vmpersistentqueue_pocFlow1_1/run"
}
]
Access Management API
The Anypoint Access Management API enables you to access administrative functionality of Anypoint Platform, including:
- User Management
- Client Management
- Invitation and Signup
- Organizations and Business Groups
- Roles and Permissions
- Environments
- Entitlements
Getting Started
To begin using the Access Management API, you obtain an access token.
Support
If the Access Management API is not working, contact MuleSoft and provide information about this issue.
If possible, provide the following information to have a better understanding of the situation.
- The operation that is not working correctly and the associated request.
- Steps to reproduce the issue.
To get in-depth knowledge, enroll for a live free demo on Mulesoft online Training