def ingest_data()

in getting_started/utils/lookout_equipment_utils.py [0:0]


    def ingest_data(self, bucket, prefix):
        """
        Ingest data from an S3 location into the dataset
        
        PARAMS
        ======
            bucket: string
                Bucket name where the data to ingest are located
                
            prefix: string
                Actual location inside the aforementioned bucket
        
        RETURNS
        =======
            start_data_ingestion_job_response: string
                Response of the start ingestion job API call
        """
        # Configure the input location:
        ingestion_input_config = dict()
        ingestion_input_config['S3InputConfiguration'] = dict([
            ('Bucket', bucket),
            ('Prefix', prefix)
        ])

        # Start data ingestion:
        start_data_ingestion_job_response = self.client.start_data_ingestion_job(
            DatasetName=self.dataset_name,
            RoleArn=self.role_arn, 
            IngestionInputConfiguration=ingestion_input_config,
            ClientToken=uuid.uuid4().hex
        )
        
        return start_data_ingestion_job_response