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.
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:
- Clone the repository.
- Go to the repository directory.
- Run
make
.
Binaries or URL:
- Copy the URL or download the binary for your platform from the latest release page.
- Call
cf install-plugin
with either the copied URL or the downloaded binary:
cf install-plugin [URL|binary]
To install the plugin from the repository of the Cloud Foundry Community, 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:
Managing analytic’s 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:
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:
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.