Blog

Introducing Cloud Foundry CLI Plugin for Managing Predix Analytics Catalog

Stas Turlo

cloud-foundry-cli-plugin-for-managing-predix-analytics-catalog

Analytics Catalog is a service in GE Predix that provides a repository for hosting and exposing analytic assets. Today, we’re introducing a Cloud Foundry command-line interface (CF CLI) plugin that enables you to access Predix Analytics Catalog features via the CLI.

Using this plugin, you can upload and test your Predix analytics services. For instance, one can add “an analytic” to the catalog, delete it, test it in a Cloud Foundry environment, and download an analytic’s artifact through the CF CLI.

 

Installation

Building from code sources:

  1. Clone the https://github.com/Altoros/cf-predix-analytics-plugin repository.
  2. Go to the repository directory.
  3. Run make.

Binaries or URL:

  1. Copy the URL or download the binary for your platform from the latest release page.
  2. Call cf install-plugin with either the copied URL or the downloaded binary:
cf install-plugin [URL|binary]

To install the plugin from the Cloud Foundry Community repository, run the following commands:

cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org/
cf install-plugin cf-predix-analytics-plugin -r CF-Community

 

Managing analytics

To manage analytics, the plugin provides the following commands:


cf analytics Displays the list of analytics.
cf create-analytic <Analytic name> <path to executable> [-version version] [-author] [-description description] [-taxonomy taxonomy location] [-language (Python|Java|Matlab)] [-metadata custom analytic metadata] Adds an analytic to the catalog.
cf delete-analytic <Analytic name> Deletes the specified analytic.
cf validate-analytic <Analytic name> <input file path> Validates the analytic.
cf deploy-analytic <Analytic name> [-memory mb] [-diskQuota mb] [-instances n] Deploys the analytic.
cf run-analytic <Analytic name> <input file path> Runs the analytic.
cf analytic-logs Gets the recent analytic logs.

Here are some of the commands in action:

cf-cli-plugin-for-predix-analytics-catalog

 

Managing analytics artifacts

To manage the artifacts of an analytic catalog entry, the plugin provides the following commands:


cf analytic-artifacts <Analytic name> Lists the analytic artifacts.
cf get-analytic-artifact <Analytic name> <file name> Downloads the specified analytic artifact.
cf add-analytic-artifact <Analytic name> <file path> -type <artifact type> [-description description] Uploads the specified file as an analytic artifact.
cf delete-analytic-artifact <Analytic name> <file name> Deletes the specified analytic artifact.

For example:

cf-cli-plugin-managing-predix-analytics-artifacts

 

Managing analytics taxonomy

To manage the taxonomy, the plugin provides the following commands:


cf taxonomy Retrieves the full taxonomy structure.
cf add-taxonomy taxonomy/to/add Adds a taxonomy to the catalog.

For instance:

cf-cli-plugin-managing-predix-analytics-taxonomy

The plugin also provides the analytics-curl command that allows you to execute requests to the targeted Analytics Catalog API endpoint.

cf-cli-plugin-predix-analytics-catalog

For the source code of the solution, visit the plugin’s repository.

If you have any questions about working with it, just let me know. You may also find us at Booth #17 during the Cloud Foundry Summit Europe (Sep 26–28) to discuss this plugin in detail. There, we’re demonstrating a prototype of a greenhouse management system, an RFID-based baggage-tracking system, a cold-chain app, and other IoT solutions based on Cloud Foundry and Predix.

 

Related reading

 

About the author

Stas Turlo is a software engineer at Altoros. He has 10+ years of experience in reverse engineering, object-oriented programming, cloud computing, and data analysis. His expertise includes reconstructing algorithms, file formats, and structures of binary data. Using Golang and Ruby as his primary tools, Stas is also proficient in Python, C / C++, and C#. You can find Stas on GitHub.


For the next parts of this series, subscribe to our blog or follow @altoros.

Get new posts right in your inbox!

No Comments

Benchmarks and Research

Subscribe to new posts

Get new posts right in your inbox!