Step 2: Create a Service on IBM Cloud

A five-minute lab to create an use IBM Cloud

Creating services on IBM Cloud is easy, and we have over a hundred different types of services you can create. To see the full list, visit https://cloud.ibm.com/catalog (or visit https://cloud.ibm.com/catalog/labs if you'd like to see our experimental 🧪 features!)

For today's lab, we'll create and run a Visual Recognition service within five minutes.

Step 2a: Create a Service through the Dashboard

First, let's find the Visual Recognition service inside the IBM Cloud resource list. We'll search for visual:

Click on Visual Recognition.

On the service creation page, make sure the Lite plan is selected, and click the blue Create button:

This service is free, but it will be removed after 30 days of inactivity.

Step 2b: Retrieve your Credentials

Now, let's retrieve our service credentials so that we can classify an image. Click on Service Credentials on the left hand menu:

At the bottom of the page, click View Credentials

Take note of the apikey and url parameters; we will use them in step 2d.

Step 2c: Start the Cloud Shell

Now that you've created your service, let's ping it using a separate environment. Although we could do it from our local machine, IBM has a great tool for us called the Cloud Shell.

In the upper right hand corner of your IBM Cloud Dashboard, you'll see a small terminal icon:

This is your IBM Cloud Shell. We'll be able to use this shell to ping our newly-created service.

Step 2d: Call your Service

This is the command we'll execute in the cloud shell to test it. We'll replace {apikey} and {url} with the parameters from our IBM Cloud Visual Recognition service, and {image_url} with a publicly-available image that we'd like to analyze.

curl -u "apikey:{apikey}" "{url}/v3/classify?url={image_url}&version=2020-01-01"

Execute this command, and we'll get a JSON response showing the default classifier's analysis of the image. Good job, you've created and called an IBM Watson service!

Last updated