-
Notifications
You must be signed in to change notification settings - Fork 79
/
04c_RT_Serving_Stop.py
45 lines (27 loc) · 975 Bytes
/
04c_RT_Serving_Stop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Databricks notebook source
# MAGIC %md ## Stop a model serving endpoint
# MAGIC
# MAGIC * https://docs.databricks.com/api/workspace/servingendpoints/delete
# MAGIC * [../includes/ModelServingClient]($../includes/ModelServingClient)
# COMMAND ----------
# MAGIC %md #### Setup
# COMMAND ----------
# MAGIC %run ./includes/Common
# COMMAND ----------
# MAGIC %run ../includes/ModelServingClient
# COMMAND ----------
# MAGIC %md ### Stop endpoint
# COMMAND ----------
model_serving_client.get_endpoint(_endpoint_name)
# COMMAND ----------
model_serving_client.stop_endpoint(_endpoint_name)
# COMMAND ----------
model_serving_client.get_endpoint(_endpoint_name)
# COMMAND ----------
endpoints = model_serving_client.list_endpoints()
for e in endpoints:
print(f" {e['name']} - {e['creator']}")
# COMMAND ----------
# MAGIC %md ### Next notebook
# MAGIC
# MAGIC **_Congratulations!_** You have finished your Mini MLOps Pipeline. There is no next notebook.