Introducing 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.
Building from code sources:
- Clone the https://github.com/Altoros/cf-predix-analytics-plugin repository.
- Go to the repository directory.
Binaries or URL:
- Copy the URL or download the binary for your platform from the latest release page.
cf install-pluginwith 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
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:
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.|
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.|
The plugin also provides the
analytics-curl command that allows you to execute requests to the targeted Analytics Catalog API endpoint.
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.
- Using Predix Analytics Services from a Node.js App
- Introducing a One-Click Button for Deploying to GE Predix
- Collecting Time Series Data with Predix (a Golang API Wrapper Included)
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.