Nav

To Deploy a Proxy to Pivotal Cloud Foundry

If you are using Anypoint Platform for PCF, you can deploy a proxy to a Mule runtime using the Cloud Foundry command line interface (cf CLI). Before deploying a proxy, the corresponding backend API application must already be deployed on PCF.

  1. Create a parameters file, as described below.

  2. Run the following command:

    cf bind-route-service <domain_name> <service_instance> -f --hostname <hostname> --c file.json

    Using the following parameters

    Property Description

    domain_name

    The domain where you want to host your proxy application

    service_instance

    The proxy service. This services is different from the service name used when deploying your Mule application to PCF. You can have multiple instances of this proxy service in different PCF organizations and environments.

    -f (optional)

    Forces the command to avoid any message prompts.

    --hostname

    The host name of your proxy application.

    -c <file>.json

    A JSON file containing PCF properties.

    The command you run should be similar to the following example:

    $ cf bind-route-service apps.pcf.mulesoft.com api_gateway_service --hostname myapp -c <file>.json

The Proxy Service Parameters File

When deploying a proxy to PCF, the cf bind-route-service command uses a parameters file that contains information about your installation. This file contains the following:

Property Description

orgId

The Anypoint Platform organization where the proxy application is deployed.

envId

The Runtime Manager environment where the proxy application is deployed

appName

The name of the application used in Runtime Manager. This is also the name of the API in API Manager.

apiversion

The version of the API. The default value is 1.0. This parameter is optional.

hostname

The host name of your proxy application.

muleRuntimeVersion

The version of the Mule runtime where you are deploying the proxy.

repFactor (optional)

Enables you to deploy the proxy on multiple PCF instances.

The following shows an example properties file:


         
      
1
2
3
4
5
6
7
8
{
    "orgId": "e2ccc210-95a3-4740-b9cf-1f2d9e693168",
    "envId": "26ad04b9-422c-45f2-8ee0-caeb73e6c9a9",
    "appName": "proxyApp",
    "apiversion": "1.0",
    "hostname": "myapp",
    "muleRuntimeVersion": "3.8.1"
}