H
H
Helplease2019-09-24 13:00:30
Python
Helplease, 2019-09-24 13:00:30

Yandex Storage - How to set the path to a file in the cloud using the Serverless Function service function?

I wrote a function in Python , in which you need to access a file that is in the Object Storage storage . I can't specify the path to the repository. How can a function access the store?
To connect to the storage, I used the boto3 library , it allows you to get remote access to the image if you run it on your computer, but is not able to get this access when called through Serverless Functions . It's about the line

s3.upload_file('panda.jpg', 'testimages', 'panda1.jpg')
here if you run it on a computer, then the function takes the file from the computer and copies it to the Yandex storage. However, the same line does not work in Serverless Functions , because it does not know where to look for the panda.jpg file in order to subsequently copy it to the storage, but this very file is located at https://storage.yandexcloud.net/testimages/origina... – the file is in the original folder in the testimages bucket .

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question