Start of
change

Using the IBM Spectrum Discover application catalog

Use the IBM Spectrum® Discover application catalog to search, download, or deploy applications (which are provided by IBM®, customers, or third parties) to use in IBM Spectrum Discover.

To use the commands in the examples throughout this document, you must use Secure Shell (SSH) to log in to the IBM Spectrum Discover. You also must have an authentication token that is generated from the command-line interface (CLI). (The token expires after 1 hour.) Run the following command to generate a token:
ssh moadmin@<your IP entered during mmconfigappliance>
# Enter in the password you set during the mmconfigappliance
export SD_USER=<sdadmin or another user with dataadmin privileges>
export SD_PASSWORD=<password for SD_USER above>
export OVA=images
gettoken
Note: In this example, gettoken is an alias under the moadmin user. Using an alias saves the token in an environment variable that is called TOKEN.
Note: The examples in the sections throughout this document use the aliases tcurl and tcurl_json under the moadmin user, which also uses the TOKEN environment variable.

Information about the endpoints

More information about the endpoints that are used in this document can be found at: https://www.ibm.com/support/knowledgecenter/en/SSY8AC/

Choose the version of IBM Spectrum Discover that you are running, and then go to: Table of Contents -> REST API -> Application management using APIs.

Querying the available applications

Run this command to query the available applications that are available on dockerhub:
tcurl https://${OVA}/api/application/appcatalog/publicregistry | jq
This output contains information that is gathered from the image itself (and from dockerhub).

Downloading an application image

Run the following command after you identify an application to download:
tcurl_json https://localhost/api/application/appcatalog/image/ibmcom/spectrum-discover-example-application -X POST | jq
Note: In this example, ibmcom/spectrum-discover-example-application is the repo_name used in the publicregistry command.

Running an application

After you download an application to your local docker cache, you can use it as a Kubernetes pod within IBM Spectrum Discover. Create a JSON-formatted file with the following information (the file that is created is named example.json):
{
  "repo_name": "ibmcom/spectrum-discover-example-application",
  "version": "1.2.3",
  "description": "Unique description about your use of this application",
  "application_name": "example"
}
Note: In this example:
  • The repo_name is the same repo_name that you used to download the application image.
  • The version is the same as the version from the output of the publicregistry command.
  • The description is a unique description that is based on your application use.
  • The application_name is the name that gets registered within the policyengine. The system automatically appends a -application to the end of the file name for identification.
Run the following command to start the application as a Kubernetes pod:
tcurl_json https://localhost/api/application/appcatalog/helm -d@example.json -X POST | jq

Scaling an application

An application by design processes each of the records one at a time. You can scale the number of replicas the pod is running to process records in parallel. You can scale up to 10 replicas based on the number of partitions available for the Kafka topics. Create a JSON-formatted file with the following information (the file that is created is named replicas.json):
{
  "replicas": 10
}
Then, run the following command to scale the replicas:
tcurl_json https://localhost/api/application/appcatalog/helm/interesting-anaconda-example-application -d@replicas.json -X PATCH
Note: In this example, interesting-anaconda-example-application is the combination of deployment_name and chart_name from the Running an application section.

Stopping an application

Run the following command to stop an application (no matter how many replicas you scale):
tcurl_json https://localhost/api/application/appcatalog/helm/interesting-anaconda -X DELETE | jq
Note: In this example, interesting-anaconda is the chart_name when the application was started.

Deleting an application image

Run the following command (after you stop the application) to delete the application from your local docker cache:
tcurl https://localhost/api/application/appcatalog/image/ibmcom/spectrum-discover-example-application -X DELETE | jq
End of
change