GCP Storage Bucket binding spec

To setup GCP Storage Bucket binding create a component of type . See this guide on how to create and apply a binding configuration.

Warning

The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described here.

To perform a create operation, invoke the GCP Storage Bucket binding with a POST method and the following JSON body:

  1. {
  2. "operation": "create",
  3. }

Examples

Save text to a random generated UUID file
  1. curl -d '{ "operation": "create", "data": "Hello World" }' \
  2. http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
Save text to a specific file
  1. http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
Upload a file

To upload a file, pass the file contents as the data payload; you may want to encode this in e.g. Base64 for binary content.

Then you can upload it as you would normally:

  1. curl -d '{ "operation": "create", "data": "$(cat my-test-file.jpg)", "metadata": { "name": "my-test-file.jpg" } }' \
  2. http://localhost:<dapr-port>/v1.0/bindings/<binding-name>