IBM Watson Studio provides you with the environment and tools to solve your business problems by collaboratively working with data.

This blog post is a follow-up to my previous post, “How to Access Watson Studio Assets by API.” In that article, I showed you how to retrieve an access token and access Watson Studio assets via API from the command line. 

One useful scenario is to use this method to cancel a running job scheduled from IBM Watson Studio. It’s quite common for users to schedule a job with a Python Notebook from Watson Studio. In rare cases, users are not able to delete the job from the web console, so I’m going to detail a way to delete the job via the command line.

Step-by-step instructions

  1. Get the access token by following the instructions in “How to Access Watson Studio Assets by API.”
  2. Find the asset_id of the running job from the web console. To find it, we’ll need to use the Developer Tool provided in the Google Chrome browser. To get the job-run’s asset_id, go to the Job Details page, inspect network, and search for “runs”. The asset_id can be found in the metadata field:
  3. Once you have the asset_id, use the following command to verify the details of the running job:
    project_id="<project id>"
    asset_id="<asset id>"
    curl -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H "$(cat wml_token.txt)" \
    -X GET "${end_point}/v2/assets/${asset_id}?project_id=${project_id}"

    It’s a good idea to save the command into a script for future use. Please refer to the instructions in “How to Access Watson Studio Assets by API” to get the details of an asset. Sample output:

  4. Once you’ve confirmed the job details, you can cancel the job by deleting the asset with the following command:
    curl -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H "$(cat wml_token.txt)" \
    -X DELETE "${end_point}/v2/assets/${asset_id}?project_id=${project_id}"

By now, the run job should have been cancelled.


The Watson Data API provides a comprehensive list of functions to manage the assets, and most GUI interface-based functions can also be implemented with the API command line. However, in some cases, users have to use the API to manage certain task, as demonstrated in this post.

You can also follow these guidelines to access other assets in Watson Studio, such as projects, catalogs, buckets, etc. For further information on the API, please refer to the online documentation at IBM Watson Data API.

Was this article helpful?

More from Cloud

The recipe for RAG: How cloud services enable generative AI outcomes across industries

4 min read - According to research from IBM®, about 42 percent of enterprises surveyed have AI in use in their businesses. Of all the use cases, many of us are now extremely familiar with natural language processing AI chatbots that can answer our questions and assist with tasks such as composing emails or essays. Yet even with widespread adoption of these chatbots, enterprises are still occasionally experiencing some challenges. For example, these chatbots can produce inconsistent results as they’re pulling from large data…

Rethink IT spend in the age of generative AI

3 min read - It’s the burning question for today’s CIOs: what do you spend your IT budget on? Cloud costs were already a challenge—in a recent survey, 24% estimated they wasted software spend. The explosion of generative AI makes it critical for organizations to consider frameworks like FinOps and technology business management (TBM) for visibility and accountability of all tech spend. But what does this all mean in practice? How can organizations shift to a more disciplined, value-driven approach to IT spend? What…

Announcing Dizzion Desktop as a Service for IBM Virtual Private Cloud (VPC)

2 min read - For more than four years, Dizzion and IBM Cloud® have strategically partnered to deliver incredible digital workspace experiences to our clients. We are excited to announce that Dizzion has expanded their Desktop as a Service (DaaS) offering to now support IBM Cloud Virtual Private Cloud (VPC). Powered by Frame, Dizzion’s cloud-native DaaS platform, clients can now deploy their Windows and Linux® virtual desktops and applications on IBM Cloud VPC and enjoy fast, dynamic, infrastructure provisioning and a true consumption-based model.…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters