in 11_realtime/make_predictions.py [0:0]
def setup(self):
from google.cloud import aiplatform
endpoint_name = 'flights-ch11'
endpoints = aiplatform.Endpoint.list(
filter='display_name="{}"'.format(endpoint_name),
order_by='create_time desc'
)
if len(endpoints) == 0:
raise EnvironmentError("No endpoint named {}".format(endpoint_name))
logging.info("Found endpoint {}".format(endpoints[0]))
self.endpoint = endpoints[0]