0

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?

vvv
  • 1
  • 1
  • After instance launched, trying to connect Google Cloud Storage to download files\objects from storage to my instance without internet. I know in AWS we have "s3 api endpoint" it's possible. But, I'm looking for similar server in GCP – vvv Jan 23 '20 at 06:47

1 Answers1

0

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:

  1. Get an authorization access token from the OAuth 2.0 Playground. Configure the playground to use your own OAuth credentials.

  2. 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.
sllopis
  • 2,292
  • 1
  • 8
  • 13
  • Thank you! Let me try to explore more as you suggested. – vvv Jan 13 '20 at 12:03
  • After instance launched, trying to connect Google Cloud Storage to download files\objects from storage to my instance without internet. I know in AWS we have "s3 api endpoint" it's possible. But, I'm looking for similar server in GCP. – vvv Jan 23 '20 at 06:46