in src/lookoutequipment/scheduler.py [0:0]
def set_parameters(self,
input_bucket,
input_prefix,
output_bucket,
output_prefix,
role_arn,
upload_frequency='PT5M',
delay_offset=None,
timezone_offset='+00:00',
component_delimiter='_',
timestamp_format='yyyyMMddHHmmss'
):
"""
Set all the attributes for the scheduler object.
Parameters:
input_bucket (string):
Bucket when the input data are located
input_prefix (string):
Location prefix for the input data
output_bucket (string):
Bucket location for the inference execution output
output_prefix (string):
Location prefix for the inference result file
role_arn (string):
Role allowing Lookout for Equipment to read and write data
from the input and output bucket locations
upload_frequency (string):
Upload frequency of the data (default: PT5M)
delay_offset (integer):
Offset in minute, ensuring the data are available when the
scheduler wakes up to run the inference (default: None)
timezone_offset (string):
Timezone offset used to match the date in the input filenames
(default: +00:00)
component_delimiter (string):
Character to use to delimit component name and timestamp in the
input filenames (default: '_')
timestamp_format (string):
Format of the timestamp to look for in the input filenames
(default: yyyyMMddHHmmss)
"""
# Configure the mandatory parameters:
self.create_request.update({'DataUploadFrequency': upload_frequency})
self.create_request.update({'RoleArn': role_arn})
# Configure the optional parameters:
if delay_offset is not None:
self.create_request.update({'DataDelayOffsetInMinutes': delay_offset})
# Setup data input configuration:
inference_input_config = dict()
inference_input_config['S3InputConfiguration'] = dict([
('Bucket', input_bucket),
('Prefix', input_prefix)
])
if timezone_offset is not None:
inference_input_config['InputTimeZoneOffset'] = timezone_offset
if component_delimiter is not None or timestamp_format is not None:
input_name_cfg = dict()
if component_delimiter is not None:
input_name_cfg['ComponentTimestampDelimiter'] = component_delimiter
if timestamp_format is not None:
input_name_cfg['TimestampFormat'] = timestamp_format
inference_input_config['InferenceInputNameConfiguration'] = input_name_cfg
self.create_request.update({
'DataInputConfiguration': inference_input_config
})
# Set up output configuration:
inference_output_config = dict()
inference_output_config['S3OutputConfiguration'] = dict([
('Bucket', output_bucket),
('Prefix', output_prefix)
])
self.create_request.update({
'DataOutputConfiguration': inference_output_config
})