Contact Free trial Login

CloudHub REST API

logo cloud active logo hybrid disabled logo server disabled logo rtf disabled

The CloudHub REST API enables you to programmatically access the functions of Anypoint Runtime Manager, such as:

  • Manage applications:

    • Create, deploy, start, stop, list, and delete an application on CloudHub.

    • Update application metadata, including the number of workers, Mule runtime engine version, and system properties.

    • Retrieve statistics for an application or worker.

    • Retrieve application transactions and events for a transaction.

    • Check for replay data, replay the flow for a transaction, and delete replay data for an application.

    • Manage static IP addresses and release unused IP addresses associated with an application.

    • Download the Mule package file for the application.

    • Update, enable, disable, or run all or some schedules.

  • Manage logs, notifications, and alerts:

    • Add, update, or retrieve log levels for an application.

    • Download the log file for an application or instance.

    • Create, update, or retrieve a notification.

    • Mark a notification as read or unread.

    • Create, update, or delete an alert triggered by an application.

    • Retrieve an alert and alert history.

  • Manage load balancers:

    • Create, update, or delete a load balancer.

    • List load balancers in an organization.

    • Test load balancer rules and return the number of the rule applied to the input.

  • Manage VPCs and VPNs:

    • Create, update, list, and remove a VPC.

    • Create or delete a VPN connection.

  • Manage persistent queues:

    • Retrieve statistics for persistent queues.

    • Clear the entries from a persistent queue.

  • Retrieve additional information about:

    • Supported Mule versions

    • The current organization, including usage statistics

    • Workers, including thread dumps and worker regions

    • Users, including permissions

    • Available domain names

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

The CloudHub API manages only applications deployed to CloudHub, the cloud-based version of Runtime Manager. To manage on-premises applications using the API, see Runtime Manager REST Services.

Get Started and Authenticate 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. 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:

{
  "versionId": "xxxxxxxx",
  "domain": "hello",
  "fullDomain": "hello.us-e1.cloudhub.io",
  "properties": {
    "foo":"bar"
  },
  "propertiesOptions": {},
  "status": "STARTED",
  "workers": {
    "type": {
      "name": "Micro",
      "weight": 0.1,
      "cpu": "0.1 vCores",
      "memory": "500 MB memory"
    },
    "amount": 1,
    "remainingOrgWorkers": 223.7,
    "totalOrgWorkers": 1000.0
  },
  "workerStatuses": [
    {
      "id": "i-xxxxxxxx",
      "host": "xxx.xxx.xxx.xxx",
      "port": 0,
      "status": "STARTED",
      "deployedRegion": "us-east-1",
      "staticIPEnabled": false
    }
  ],
  "lastUpdateTime": 1589868960908,
  "fileName": "hello.zip",
  "muleVersion": {
    "version": "4.3.0",
    "updateId": "xxxxxxxx",
    "latestUpdateId": "xxxxxxxx",
    "endOfSupportDate": 1633737600000
  },
  ...
}

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.

429

The operation was unsuccessful due to rate limit.

  • The following endpoints have a limit of one call per second for each application:

    • v2/applications/{domain}/logs

    • v2/applications/{domain}/deployments/{deploymentId}/logs

    • v2/applications/{domain}/instances/{instanceId}/logs

  • The following endpoint has a limit of one call per minute for each application:

    • v2/applications/{domain}/instances/{instanceId}/log-file

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."
}

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub