Working With iControl LX/iApps LX RPM Packages

Once the iControl LX/iApps LX RPM package has been created, you can install it. In addition, you can uninstall a package or upgrade a package with a new build.

Installing a generated RPM package

The RPM build process placed the generated RPM in the /var/config/rest/iapps/RPMS directory on the system generating the package. You will need to copy this file to the /var/config/rest/downloads directory for the REST framework to detect it.

  1. Copy the RPM to the installation directory

If your target system is the same as your generation system, just copy the file. For a remote device, you will need to use a secure copy command. Make sure the RPM is located in the /var/config/rest/downloads directory on the target system.

cp /var/config/rest/iapps/RPMS/MemoryWorker-0.1.0-0001.noarch.rpm /var/config/rest/downloads/
-or-
scp MemoryWorker-0.1.0-0001.noarch.rpm root@{Mgmt-IP}:/var/config/rest/downloads/
  1. Installing the RPM pa

Once copied, you may now execute the ‘INSTALL’ command via the iControl REST API. This must be performed on the target system. This is accomplished by issuing a POST request to the /mgmt/shared/iapp/package-management-tasks with the INSTALL operation:

curl -u user:pass -X POST http://localhost:8100/mgmt/shared/iapp/package-management-tasks -d '{ "operation":"INSTALL","packageFilePath": "/var/config/rest/downloads/MemoryWorker-0.1.0-0001.noarch.rpm"}'

The following is an example of an expected response:

{
  "packageFilePath": "/var/config/rest/iapps/downloads/MemoryWorker-0.1.0-0001.noarch.rpm",
  "operation": "INSTALL",
  ...
  "selfLink": "https://localhost/mgmt/shared/iapp/package-management-tasks/a9646643-2639-4116-8cd8-bfe72b54209b"
}

The install task is asynchronous. The INSTALL operation creates an async task and you can check the status by using a HTTP GET request with curl on the selfLink field:

curl -k -u user:pass  https://localhost/mgmt/shared/package-management-tasks/a9646643-2639-4116-8cd8-bfe72b54209b

Repeat this process until a status of “FINISHED” is returned:

{
  "packageFilePath": "/var/config/rest/downloads/MemoryWorker-0.1.0-0001.noarch.rpm",
  "packageName": "MemoryWorker-0.1.0-0001.noarch",
  "operation": "INSTALL",
  ...
  "status": "FINISHED",
  "selfLink": "https://localhost/mgmt/shared/package-management-tasks/a9646643-2639-4116-8cd8-bfe72b54209b"
}

The new extension is operational and you can issue a REST request (e.g. via curl) to ensure it is functioning as expected.

Upgrading a package with a new build

The process for this is the same as Installing of Generated RPM” instructions. Simply repeat the steps for installation and it will overwrite any existing installation.

Uninstalling an RPM package

To uninstall an iControl LX extension package, send a request to the iControl REST framework with the UNINSTALL operation and the packageName that is to be removed.

  1. Issue a POST request to the iControl REST framework:
curl -u user:pass -X POST http://localhost:8100/mgmt/shared/iapp/package-management-tasks -d '{ "operation":"UNINSTALL","packageName": "MemoryWorker-0.1.0-0001.noarch"}'

Note

The packageName is the RPM file name (provided on install in the packageFilePath parameter) without the file path or the .rpm suffix.

Calling the UNINSTALL operation schedules an asynchronous uninstall and may cause restnoded to restart.

In a similar way to the RPM generation, extract the selfLink and poll it via a GET request, until you receive a successful (FINISHED) status.

  1. Verify that the UNINSTALL was completed by issuing a GET request:
curl -u admin:admin http://localhost:8100/mgmt/extension/mycompany/memory

You should receive a 404 response:

{
  "code": 404,
  "message": "",
  "referer": "restnoded",
  ....
}