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:
{
"operation": "create",
}
Examples
Save text to a random generated UUID file
curl -d '{ "operation": "create", "data": "Hello World" }' \
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
Save text to a specific file
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:
curl -d '{ "operation": "create", "data": "$(cat my-test-file.jpg)", "metadata": { "name": "my-test-file.jpg" } }' \
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>