Please find below the REST APIs to enable and disable Model-Serving
Below are the examples in Python
You need to use the token to interact with Rest API
token = "dxxxxxx"
instance = "https://<workspacexxx>.cloud.databricks.com"
headers = {'Authorization': f'Bearer {token}'}
Enable Model Serving
import requests
url = f'https://{instance}/api/2.0/mlflow/endpoints/enable'
requests.post(url, headers=headers, json={"registered_model_name": "<model name>"})
Disable Model serving
url = f'https://{instance}/api/2.0/mlflow/endpoints/disable'
r = requests.post(url, headers=headers, json={"registered_model_name": "<model name>"})
r.json()