Looking up the endpoint URL of a deployment
To send payload data to a model or function deployment for analysis (for example, to classify the data, or make a prediction from the data) you need to know the endpoint URL of the deployment.
There are two ways to look up the endpoint URL of a deployment:
- From the Deployments tab of your space, click a deployment name to look up the deployment ID for the endpoint URL. For details, refer to Endpoint URLs.
- Using the Watson Machine Learning Python client:
- List the deployments by calling the function
client.deployments.list()
- In the row of the desired deployment, the deployment endpoint URL is listed in the "url" column.
- List the deployments by calling the function
Best practice: using an external API gateway to provide a stable endpoint
For any REST endpoints being provided by Watson Machine Learning that are being used by other applications/processes in the enterprise, consider using an API gateway to provide a stable URL that can be tied to the Watson Machine Learning REST endpoint. An API gateway provides the ability to ensure the highest availability by using deployments across two or more Cloud Pak for Data instances. When even a single Cloud Pak for Data instance is used, the API gateway ensures that the consuming applications can continue to use the same URL in all cases, even if a deployment is accidentally deleted and needs to be recreated. Watson Machine Learning does generally provide stable URLS (that is, you can update the version of a model for an online deployment without any downtime or change to the URL) so the API gateway should only rarely need to be reconfigured (for example, if you are moving to a new Cloud Pak for Data instance or adding an additional one for increased availability).
IBM Cloud Pak for Integration includes an API gateway as part of its core functionality that is generally useful for managing API dependencies, but you can use any other API gateway to perform this function.
Parent topic: Deploying assets