in utils/lookout_equipment_utils.py [0:0]
def create(self, wait=True):
"""
Create an inference scheduler for a trained Lookout for Equipment model
"""
# Update the creation request:
self.create_request.update({'ClientToken': uuid.uuid4().hex})
# Create the scheduler:
try:
create_scheduler_response = self.client.create_inference_scheduler(
**self.create_request
)
# Polling scheduler creation status:
if wait:
self._poll_event(create_scheduler_response['Status'], 'PENDING')
except Exception as e:
error_code = e.response['Error']['Code']
# If the scheduler already exists:
if (error_code == 'ConflictException'):
print(('This scheduler already exists. Try changing its name'
'and retry or try to start it.'))
else:
raise e