storj.io/minio@v0.0.0-20230509071714-0cbc90f649b1/docs/gateway/gcs.md (about) 1 # MinIO GCS Gateway [](https://slack.min.io) 2 3 MinIO GCS Gateway allows you to access Google Cloud Storage (GCS) with Amazon S3-compatible APIs 4 5 - [Run MinIO Gateway for GCS](#run-minio-gateway-for-gcs) 6 - [Test Using MinIO Browser](#test-using-minio-browser) 7 - [Test Using MinIO Client](#test-using-minio-client) 8 9 ## <a name="run-minio-gateway-for-gcs"></a>1. Run MinIO Gateway for GCS 10 11 ### 1.1 Create a Service Account key for GCS and get the Credentials File 12 1. Navigate to the [API Console Credentials page](https://console.developers.google.com/project/_/apis/credentials). 13 2. Select a project or create a new project. Note the project ID. 14 3. Select the **Create credentials** dropdown on the **Credentials** page, and click **Service account key**. 15 4. Select **New service account** from the **Service account** dropdown. 16 5. Populate the **Service account name** and **Service account ID**. 17 6. Click the dropdown for the **Role** and choose **Storage** > **Storage Admin** *(Full control of GCS resources)*. 18 7. Click the **Create** button to download a credentials file and rename it to `credentials.json`. 19 20 **Note:** For alternate ways to set up *Application Default Credentials*, see [Setting Up Authentication for Server to Server Production Applications](https://developers.google.com/identity/protocols/application-default-credentials). 21 22 ### 1.2 Run MinIO GCS Gateway Using Docker 23 ```sh 24 docker run -p 9000:9000 --name gcs-s3 \ 25 -v /path/to/credentials.json:/credentials.json \ 26 -e "GOOGLE_APPLICATION_CREDENTIALS=/credentials.json" \ 27 -e "MINIO_ROOT_USER=minioaccountname" \ 28 -e "MINIO_ROOT_PASSWORD=minioaccountkey" \ 29 minio/minio gateway gcs yourprojectid 30 ``` 31 32 ### 1.3 Run MinIO GCS Gateway Using the MinIO Binary 33 34 ```sh 35 export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json 36 export MINIO_ROOT_USER=minioaccesskey 37 export MINIO_ROOT_PASSWORD=miniosecretkey 38 minio gateway gcs yourprojectid 39 ``` 40 41 ## <a name="test-using-minio-browser"></a>2. Test Using MinIO Browser 42 43 MinIO Gateway comes with an embedded web-based object browser that outputs content to http://127.0.0.1:9000. To test that MinIO Gateway is running, open a web browser, navigate to http://127.0.0.1:9000, and ensure that the object browser is displayed. 44 45  46 47 ## <a name="test-using-minio-client"></a>3. Test Using MinIO Client 48 49 MinIO Client is a command-line tool called `mc` that provides UNIX-like commands for interacting with the server (e.g. ls, cat, cp, mirror, diff, find, etc.). `mc` supports file systems and Amazon S3-compatible cloud storage services (AWS Signature v2 and v4). 50 51 ### 3.1 Configure the Gateway using MinIO Client 52 53 Use the following command to configure the gateway: 54 55 ```sh 56 mc alias set mygcs http://gateway-ip:9000 minioaccesskey miniosecretkey 57 ``` 58 59 ### 3.2 List Containers on GCS 60 61 Use the following command to list the containers on GCS: 62 63 ```sh 64 mc ls mygcs 65 ``` 66 67 A response similar to this one should be displayed: 68 69 ``` 70 [2017-02-22 01:50:43 PST] 0B ferenginar/ 71 [2017-02-26 21:43:51 PST] 0B my-container/ 72 [2017-02-26 22:10:11 PST] 0B test-container1/ 73 ``` 74 75 ### 3.3 Known limitations 76 MinIO Gateway has the following limitations when used with GCS: 77 78 * It only supports read-only and write-only bucket policies at the bucket level; all other variations will return `API Not implemented`. 79 * The `List Multipart Uploads` and `List Object parts` commands always return empty lists. Therefore, the client must store all of the parts that it has uploaded and use that information when invoking the `_Complete Multipart Upload` command. 80 81 Other limitations: 82 83 * Bucket notification APIs are not supported. 84 85 ## <a name="explore-further"></a>4. Explore Further 86 - [`mc` command-line interface](https://docs.min.io/docs/minio-client-quickstart-guide) 87 - [`aws` command-line interface](https://docs.min.io/docs/aws-cli-with-minio) 88 - [`minio-go` Go SDK](https://docs.min.io/docs/golang-client-quickstart-guide)