Docs‎ > ‎Install Live API Creator‎ > ‎

Install on Cloud Foundry

You can install CA Live API Creator (LAC) on Cloud Foundry and run it as a cloud-based service.

Verify Prerequisites

  • You have the Cloud Foundry command line installed, and you are logged into Cloud Foundry.
  • You have a copy of the APICreator.war file. This file is set up for installation in a Cloud Foundry environment.
  • You have the MySQL version you require depends on the version of MySQL that is available in your particular Cloud Foundry installation. For more information, see the "Appendix: Add the MySQL JDBC Driver to the WAR File" section.

    The WAR file contains the required JDBC drivers to access databases other than MySQL and Postgres, unless they are provided by Cloud Foundry. This depends on your Cloud Foundry setup.

Create a MySQL Service

LAC requires a MySQL database to store its settings.

From the Cloud Foundry command line, issue the following command:
cf create-service p-mysql 100mb-dev CALiveAPICreator_admin
  • The service provider p-mysql should be the same for most users.
  • The plan (in this example, 100mb-dev) can vary depending on a number of factors (You can see what services are available to you, and under which plan, by issuing the cf marketplace command)
  • The name of the MySQL service must be CALiveAPICreator_admin.

Create a Cloud Foundry App 

In the same directory as the WAR file, create a manifest.yml text file. The following code sample illustrates a simple example:
- name: ca-live-api-creator
  memory: 512M
  instances: 1
  path: CALiveAPICreator-
    - CALiveAPICreator_admin
The following are the most basic deployment options of Cloud Foundry:
  • name is the name of LAC in Cloud Foundry. In this example, ca-live-api-creator is the name.
    Do not use underscores in this name as that can cause problems.
  • memory is the amount of memory dedicated to Live API Creator: 512M should be fine for small installations.
  • instances is the number of Cloud Foundry servers that will run Live API Creator.
  • path is the path to the LAC WAR file (the exact file name will of course depend on the version of LAC).
  • services is the name of the MySQL service that will be used by Live API Creator to store its metadata. The name of the service must be CALiveAPICreator_admin.

Deploy Live API Creator

  1. From the directory containing the WAR file and the manifest.yml file, execute the following command:
    cf push
    Messages detailing the deployment appear. Because this is a new application which has not yet been bound to the MySQL service, error messages about this may appear. Ignore them for now.
    LAC is created.
    1. Bind LAC to the MySQL service:
      cf bind ca-live-api-creator CALiveAPICreator_admin
      cf restage ca-live-api-creator
      1. Verify that no error messages appear.
      2. Verify that LAC is up by viewing the log:
        cf logs --recent ca-live-api-creator
        1. Check the log for error messages or messages that are shown in red.

        Run Live API Creator

        Get the URL to your newly deployed LAC. You can use this URL in your browser.

        Execute the following command:
        cf apps

        The following response is expected:
        Getting apps in org ACME / space dev as jdoe...

        name                  requested state   instances   memory   disk   urls   
        ca-live-api-creator   started           1/1         512M     1G

        Appendix: Add the MySQL JDBC Driver to the WAR File

        If you are experiencing problems getting LAC to work properly, you may have an incompatible version of the MySQL/MariaDB JDBC driver installed. You can override the driver that Cloud Foundry provides by installing the MySQL/MariaDB JDBC driver that is included in the WAR file. The MySQL version you require depends on the version of MySQL that is available in your particular Cloud Foundry installation. If you are unsure, try without, and if it fails, add the MySQL/MariaDB JDBC driver to the WAR file.

        Complete the following steps from a Unix command line (OSX/Linux), in a directory containing the WAR file.
        Note: The name of the WAR file varies depending on the version.
        1. Create a directory called WEB-INF and a subdirectory called lib:
          mkdir WEB-INF
          mkdir WEB-INF/lib
        2. Get a copy of the MySQL JDBC driver and unzip and untar the downloaded JAR file. The mysql-connector-java-5.1.38-bin.jar file is available from MySQL.
        3. Put the JAR file into the WEB-INF/lib directory and execute:
          jar uvf CALiveAPICreator- WEB-INF

          Your WAR file now contains the JDBC driver.
        4. Verify that your WAR file contains the MySQL JDBC driver by executing the following command:
          jar tvf CALiveAPICreator-2.1.xx.2288_EBS.war |grep mysql-connector

          The following output is expected:
          983914 Wed Dec 02 09:02:04 PST 2015 WEB-INF/lib/mysql-connector-java-5.1.38-bin.jar
        You can follow the same procedure for other JDBC drivers.