I'm trying to download media files from Cloud Storage through an HTTP endpoint. In AWS there is an option to create an "S3 API endpoint" service to download without Internet using the HTTP endpoint.
Does anyone know of anything similar in GCP?
I'm trying to download media files from Cloud Storage through an HTTP endpoint. In AWS there is an option to create an "S3 API endpoint" service to download without Internet using the HTTP endpoint.
Does anyone know of anything similar in GCP?
to download without internet using HTTP endpoint.
I'm not quite sure what you mean by downloading files without using the Internet.
Cloud Storage provides a JSON API that can be used to make HTTP requests from your application for accessing and manipulating Cloud Storage projects in a programmatic way.
To download object files from GCS buckets:
Get an authorization access token from the OAuth 2.0 Playground. Configure the playground to use your own OAuth credentials.
Use cURL to call the JSON API with a GET Object request:
curl -X GET \
-H "Authorization: Bearer [OAUTH2_TOKEN]" \
-o "[SAVE_TO_LOCATION]" \
"https://storage.googleapis.com/storage/v1/b/[BUCKET_NAME]/o/[OBJECT_NAME]?alt=media"
WHERE:
[OAUTH2_TOKEN]
is the access token you generated in Step 1.[SAVE_TO_LOCATION]
is the path to the location where you want to save your object. For example, Desktop/dog.png.[BUCKET_NAME]
is the name of the bucket containing the object you are downloading. For example, my-bucket.[OBJECT_NAME]
is the name of object you are downloading. For example, pets/dog.png. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.