Creating a Distribution iControl LX RPM Package

Once you have written your iControl LX extension, you need to create an RPM package to be uploaded onto a system. The supported way to do so is to copy and install the source files to a target directory. The directory is added to the list of directories known to restnoded.

Prerequisites:

  • You are a developer responsible for creating an iControl LX RPM Package

An iControl LX extension package includes the JavaScript workers and any optional custom UI configuration for the relevant workers. In addition, the iControl LX package needs to include a manifest.json file and a PLUGIN tag to define it as an iControl LX and to indicate that there is no template block. The directory structure of an iControl LX RPM package is /var/config/rest/iapps.

Creating the Distribution RPM Package

  1. Copy the source files to a /tmp directory on the target BIG-IP system.

For example:

$ scp MemoryWorker.js target_bigip_system_address:/tmp
  1. Create the RPM target directory.

RPM’s are created on the host system from JavaScript files located in the following location: /var/config/rest/iapps/<worker_name>/nodejs.

When logged into the host system, use the mkdir command to create the following directories:

mkdir /var/config/rest/iapps/MemoryWorker
mkdir /var/config/rest/iapps/MemoryWorker/nodejs
  1. Copy source files.

Copy the source MemoryWorker.js file from /tmp folder to the location on the host system:

cp /tmp/MemoryWorker.js  /var/config/rest/iapps/MemoryWorker/nodejs
  1. Create a manifest.json file and then copy it to the location on the host system:
/var/config/rest/iapps/MemoryWorker

The manifest.json file for iControl LX extension packages, is ({"tags":["PLUGIN"]}).

  1. Generate the RPM.

A built-in extension in the F5 REST Framework generates the RPMs. Issue an HTTP POST to the /mgmt/shared/iapp/build-package resource, this triggers an asynchronous execution of the RPM creation.

curl -u user:password -X POST http://<BIG-IP address>/mgmt/shared/iapp/build-package -d '{"appName": "MemoryWorker", "packageVersion": "0.1.0", "packageRelease": "0001"}'

The response includes:

{
  "step": "COMPLETE_TASK",
  "packageDirectory": "/var/config/rest/iapps/MemoryWorker",
  "appName": "MemoryWorker",
  "builtRpmPackageFilePath": "/var/config/rest/iapps/RPMS/MemoryWorker-0.1.0-0001.noarch.rpm",
  .....
  "selfLink": "https://localhost/mgmt/shared/iapp/build-package/9190e6fb-e729-480d-bc31-172c7c5940ca"
}

Note

Generating the RPM takes a few minutes, as the POST request creates a task task to provide a url in the ‘self-link’, which can be polled via GET to see if the task is completed. This pattern (Async task creation/task status polling) is used by many REST frameworks extensions.

  1. Verify that the RPM package was created.

You can verify the RPM was created by issuing a list command to the builtRpmPackageFilePath status response attribute.

ls /var/config/rest/iapps/RPMS/MemoryWorker-0.1.0-0001.noarch.rpm