Changing Python version in a deployed model with REST API
Changing Python version for an existing
deployed model with the REST API
Last updated: Nov 21, 2024
Decision Optimization REST API changing Python version in deployed model
You can update an existing Decision
Optimization model using the watsonx.ai Runtime REST API. This can be useful, for example, if in your
model you have explicitly specified a Python version that has now become deprecated.
Before you begin
Copy link to section
You will need your SPACE-ID, MODEL-ID and
DEPLOYMENT-ID to make this change. See REST API example for more
details.
About this task
Copy link to section
The following steps show you how to update an existing Decision
Optimization deployed model using the watsonx.ai Runtime REST API. The REST API example uses curl, a command line
tool and library for transferring data with URL syntax. You can download curl and read more about it
at http://curl.haxx.se.
For Windows users, use ^ instead of \ for the multi-line separator and double quotation
marks " throughout these code examples. Windows users also need to use indentation of at least one
character space in the header lines.
For clarity, some code examples in this procedure have
been placed in a json file to make the commands more readable and easier to
use.
Procedure
Copy link to section
To change Python version for an existing deployed model:
Create a revision to your Decision
Optimization model
All API requests require a version parameter that takes a date in the format
version=YYYY-MM-DD. This code example posts a model that uses the file
update_model.json. The URL will vary according to the chosen region/location for
your machine learning
service.