How to request.get file from FILE directory using Domino API
Trying to figure out how to read data from the FILE directory in a Domino Project, through a published Model API.
I am currently using the Domino API to make a request, since any python invoked by the model API is inside an executor at runtime, and thus doesn't have direct access to the FILE directory.
This is my code:
from domino import Domino
import requests
def fetch_file(filename):
headers = {'X-Domino-Api-Key': 'my_api_key'}
request = requests.get('https://domino.my_comp_url.com/v1/projects/my_username/project_name/data/' + filename + '.json', headers=headers, verify=False)
return(request)
But this doesn't work. Domino API seems to suggest using Blobs, but I would need the Blob ID and not sure where to find that.
Comments
-
Hi @sean.mcclure,
I noticed this was still open -- from our records I believe you worked with @akshay.ambekar to resolve your model API usage questions. Indeed, by default your model can access files in the Domino project directly by path, as those files are included when the model container is built. If you still have any issues accessing files from your model APIs please let us know.
Katie
Field Data Scientist @ Domino
0
Howdy, Stranger!