Use the IBM® Bluemix® utility
command-line integration tool to configure your on-premise Liberty server to use Bluemix
Watson™ services.
Before you begin
Before you configure your
Liberty server to any
Bluemix service, you must create an account.
See
Sign up
for IBM
Bluemix to create your
Bluemix account.
About this task
Configure your Liberty server to use Watson services. Your application must
use the Watson Developer Cloud Java™ SDK to access the Watson service. For more information, see
Watson Developer Cloud Java SDK services. For more information about Watson, see Watson services.
Procedure
- Log in using the bluemixUtility login command. After you initially log in,
you do not have to complete this step again.
- Run the bluemixUtility marketplace command to list details about all the Bluemix services that can be used with the
command-line utility. See the following example of the Personality Insights description:
Service: personality_insights
Description: The Watson Personality Insights derives insights from transactional and social media data to identify psychological traits
Documentation: https://www.ibm.com/watson/developercloud/personality-insights.html
Plans: tiered, premium
Note: If you already created an instance, skip to step 4. You can also create an instance from the
Bluemix dashboard.
Run the bluemixUtility createService [options]
serviceType
servicePlan
serviceName command to create an instance of the service that you want
to use. You can choose a unique serviceName for your service instance. The following example creates an instance of the Personality Insights service:
bluemixUtility createService personality_insights premium myWatsonService
- Optional: Run the bluemixUtility listServices command to view
the Name, Type, and Plan of all the service instances that you created. See the following
example:
myWatsonService personality_insights premium
- Run the bluemixUtility import myWatsonService command to import the
configuration.
- Accept the license terms and conditions of the necessary libraries that are needed to access
the service.
- After the configuration is successfully imported, complete any additional steps to use the
imported configuration in your application, such as adding a classloader reference to the library.
The classloader element must be added to each application that is using the service. The classloader
reference ID is different from each unique Watson service. For example, you must add the following classloader reference to your application to use the Watson Java SDK libraries.
<application id="myWatsonApp">
<classloader commonLibraryRef="personality_insights-library"/>
</application>
- Optional: Run the bluemixUtility listImports command to view the
service configurations that you imported.
The following IBM Bluemix service configurations have been imported:
myWatsonService
- Run the bluemixUtility bind [options]
serverName
serviceName to bind the configuration to a Liberty server. See the following example and description of a service listed:
bluemixUtility bind defaultServer myWatsonService
Checking if features required for the myWatsonService are installed.
All required features are installed.
The myWatsonService is now bound to defaultServer server.
Results
You can now use
Watson
services with your
Liberty server.