- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
12-02-2016 10:18 AM
Any chance that anyone out there has a quick and easy sample python script to pull from Tealium's S3 Bucket given a location/bucket string similar to below:
collect-us-east-1.tealium.com/bulk-downloader/acme_main
(I'm trying to send up omnichannel files, but am getting errors related to bucket not existing in my python/boto script.)
Solved! Go to Solution.
12-02-2016 10:45 AM
@Michael_Kim_shc quick clarification. Your question initially states "pull from" whereas the comment at the end states "send up". Can you clarify which?
I assume you mean upload. If you didn't check stackoverflow, they usually have great snippets. Here is one I found with 3 possible methods for upload so hopefully one helps:
http://stackoverflow.com/questions/15085864/how-to-upload-a-file-to-directory-in-s3-bucket-using-bot...
I have noticed in the past that it is not possible to access root on our S3 instance, so please be sure to point directly to the directory.
Also, please make sure the path is correct. It should be like:
https://<key>@s3.amazonaws.com/collect-<region>.tealium.com/bulk-downloader/<account>-<profile>
12-03-2016 09:11 PM - last edited on 12-05-2016 08:47 AM by kathleen_jo
Hey @dan_george,
I feel like I should know this easily - but i don't unfortunately.. I think my main issue is that I don't understand from the string below where the name of my bucket is, and what the value/name of my prefix is.
collect-us-east-1.tealium.com/bulk-downloader/acmeMain
(this is what is given to me in the omnichannel setup)
I've tried all the domain, "bulk-downloader" and "acmeMain" separately, and together in various other combinations - but each time i get a "bucket doesn't exist" error. It also seems that boto is trying too prepend whatever bucketname i set to the general AWS connection URL: s3.amazonaws.com
To answer you earlier question, yes - i'm trying to load files into the Tealium S3 bucket for omnichannel to parse.
thx!
12-05-2016 09:06 AM
Here is a breakdown that might be useful:
CREDS = { 'AWS' : { 'bucket' : 'collect-us-east-1.tealium', 'access_key':'AKIA...', 'secret_key':'h68hDxK...', 'prefix' : 'account/profile/', 'local_path' : '~/Downloads/' } }
***DISCLAIMER: TEALIUM IS NOT RESPONSIBLE FOR USE OF THE ATTACHED SCRIPT***
I've attached a Python script that I've used previously as a foundation to connect to S3 but this was for downloading files, not uploading. I'm sure it can easily be changed to upload, but should at least get you on the right path. I hope. Let me know if you're successful.
12-07-2016 12:17 PM - last edited on 12-07-2016 02:29 PM by kathleen_jo
Hey @dan_george,
Thanks so much! That was the info I needed, and the code snippet helped as well.
Copyright All Rights Reserved © 2008-2023