---
schema_version: "1"
id: 643ccef741f816be39fbbbd263efb9bf6b876d703cbda60a50313e3a05e48d15
title: Deploy the American Flights API to CloudHub 2.0
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/anypoint-code-builder/tut-flights-deploy-api.md
canonical_url: https://docs.mulesoft.com/anypoint-code-builder/tut-flights-deploy-api
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0f348fc9cbd45057d112c4d66448802d98bb4a024a5c729d74382b648273c13e
description: MuleSoft Documentation Site
latest: true
---
---
product: Anypoint Code Builder
version: master
---

# Deploy the American Flights API to CloudHub 2.0

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

After implementing, debugging, and testing your API locally, you’re ready to deploy it to CloudHub
2.0. CloudHub 2.0 is MuleSoft’s cloud-based integration platform that lets you deploy, manage, and
scale your Mule applications without managing infrastructure.

In this section, you deploy your American Flights API to CloudHub 2.0. You configure it in API
Manager, apply a security policy, and monitor its performance using Runtime Manager in the pages
that follow.

CloudHub 2.0 provides a fully managed, containerized deployment environment for your Mule
applications. Deploying from Anypoint Code Builder is a streamlined process that packages your
application and deploys it directly to the cloud.

See [Deploying Mule Apps to CloudHub and CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps) for more information
about CloudHub and CloudHub 2.0 deployment concepts.

## Prerequisites for Deployment

Before deploying to CloudHub 2.0, verify that you have:

- A CloudHub 2.0 account with available vCores (virtual cores) for deployment.

- Runtime Manager permissions to read, create, and delete applications.

- An application that passes all MUnit tests.

- An application that runs successfully in debug mode locally.

## Configure Deployment Settings and Deploy Your Project

The first time you deploy an application to CloudHub 2.0, Anypoint Code Builder creates a deployment
settings file. After modifying the deployment settings, deploy your project with those settings.

1.  In the project explorer, Right-click the American Flights project XML file and select **Mule >
    Deploy Mule Project to CloudHub**.

2.  If prompted, sign in to Anypoint Platform.

3.  Select **CloudHub 2.0**.

4.  Select a deployment target, for example: Cloudhub-US-East-1 - Shared Space.

5.  Select an environment, for example: **Sandbox**.

    If there’s no deployment settings file for the project, Code Builder creates one.

6.  Edit the deployment configuration file and provide the following information:

    <table><colgroup><col> <col></colgroup><thead><tr><th>Field Name</th><th>Field Value</th></tr></thead><tbody><tr><td><div><div><p><strong>applicationName</strong></p></div></div></td><td><div><div><p>Enter a unique name for your deployment (for example, <code>american-flights-api-yourname</code>). This name must be unique across all CloudHub deployments.</p></div></div></td></tr><tr><td><div><div><p><strong>runtime</strong></p></div></div></td><td><div><div><p>Confirm the Mule runtime version (the latest compatible version is selected by default).</p></div></div></td></tr><tr><td><div><div><p><strong>replicas</strong></p></div></div></td><td><div><div><p><code>1</code>. The number of replica instances to deploy.</p></div></div></td></tr><tr><td><div><div><p><strong>replicaSize</strong></p></div></div></td><td><div><div><p><code>0.1</code>. The compute capacity (vCores) allocated to each replica.</p></div></div></td></tr><tr><td><div><div><p><strong>deploymentModel</strong></p></div></div></td><td><div><div><p>Leave the default value: <code>rolling</code>.</p></div></div></td></tr></tbody></table>

7.  Click **Deploy** in the notification pop-up.

    If the notification is no longer visible, restart the deployment from the first step.

8.  Select the Mule version to use for the deployment.

9.  If prompted to select an asset version, leave the default value and press Enter.

> [!NOTE] Worker size and count affect your CloudHub 2.0 costs. For this tutorial, use 0.1 vCores
> with 1 worker, which are the minimum allowed values.

The deployment process starts and usually takes from two to five minutes. After this period, look
for an ACB notification with a message similar to this:
`The 'american-flights-api-implementation' project was published to the 'Sandbox' environment in CloudHub 2.0 'Cloudhub-US-East-1 - Shared Space'. The deployment is now processing. Monitor its progress in Runtime Manager.`

## Monitor the Deployment Process

After initiating the deployment, open Runtime Manager to monitor the status.

1.  In the notification that shows after deployment starts, click **Open Runtime Manager** and then
    click **Open**.

    Alternatively, if you missed the notification, open [Runtime Manager](https://docs.mulesoft.com/runtime-manager/) and
    search for your application name. Then, click the application name to open its status page.

2.  Confirm the **Application status** is **Running**.

    If the application is still deploying and shows status **Not Running**, wait a few minutes for
    the process to finish.

## Verify Your Deployed Application

Once deployed, verify that your API is accessible and functioning correctly.

1.  In Runtime Manager, copy the application URL from the **Public endpoint** value.

    The URL is similar to this:
    `[https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e1.cloudhub.io](https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e1.cloudhub.io)`

2.  In your REST client, test the deployed API by making a GET request to your endpoint and adding
    `/api/flights` to the URL. For example:

    ```command
    GET https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e2.cloudhub.io/api/flights
    ```

    Replace the URL from the example with your actual endpoint URL.

3.  Verify that you receive a `200 OK` response with the flight data.

4.  Test additional endpoints:

    ```command
    GET https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e2.cloudhub.io/api/flights/AA123
    ```

> [!TIP] Save your application URL for use in the next sections where you configure API Manager and
> apply policies.

[Test the American Flights API with MUnit](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-munit-test-api)
[Manage, Secure, and Monitor the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-manage-secure-monitor-api)
