Skip to content

Commit 36d327d

Browse files
docs: gcp bulkGet, copy, rename, move docs (#4662)
Signed-off-by: nelson.parente <[email protected]> Co-authored-by: Mark Fussell <[email protected]>
1 parent 68f1be7 commit 36d327d

File tree

1 file changed

+124
-1
lines changed
  • daprdocs/content/en/reference/components-reference/supported-bindings

1 file changed

+124
-1
lines changed

daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ This component supports **output binding** with the following operations:
7777

7878
- `create` : [Create file](#create-file)
7979
- `get` : [Get file](#get-file)
80+
- `bulkGet` : [Bulk get objects](#bulk-get-objects)
8081
- `delete` : [Delete file](#delete-file)
8182
- `list`: [List file](#list-files)
83+
- `copy`: [Copy file](#copy-files)
84+
- `move`: [Move file](#move-files)
85+
- `rename`: [Rename file](#rename-files)
86+
8287

8388
### Create file
8489

@@ -211,6 +216,72 @@ The metadata parameters are:
211216

212217
The response body contains the value stored in the object.
213218

219+
### Bulk get objects
220+
221+
To perform a bulk get operation that retrieves all bucket files at once, invoke the GCP bucket binding with a `POST` method and the following JSON body:
222+
223+
```json
224+
{
225+
"operation": "bulkGet",
226+
}
227+
```
228+
229+
The metadata parameters are:
230+
231+
- `encodeBase64` - (optional) configuration to encode base64 file content before return the content for all files
232+
233+
#### Example
234+
235+
{{< tabs Windows Linux >}}
236+
237+
{{% codetab %}}
238+
```bash
239+
curl -d '{ \"operation\": \"bulkget\"}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
240+
```
241+
{{% /codetab %}}
242+
243+
{{% codetab %}}
244+
```bash
245+
curl -d '{ "operation": "bulkget"}' \
246+
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
247+
```
248+
{{% /codetab %}}
249+
250+
{{< /tabs >}}
251+
252+
#### Response
253+
254+
The response body contains an array of objects, where each object represents a file in the bucket with the following structure:
255+
256+
```json
257+
[
258+
{
259+
"name": "file1.txt",
260+
"data": "content of file1",
261+
"attrs": {
262+
"bucket": "mybucket",
263+
"name": "file1.txt",
264+
"size": 1234,
265+
...
266+
}
267+
},
268+
{
269+
"name": "file2.txt",
270+
"data": "content of file2",
271+
"attrs": {
272+
"bucket": "mybucket",
273+
"name": "file2.txt",
274+
"size": 5678,
275+
...
276+
}
277+
}
278+
]
279+
```
280+
281+
Each object in the array contains:
282+
- `name`: The name of the file
283+
- `data`: The content of the file
284+
- `attrs`: Object attributes from GCP Storage including metadata like creation time, size, content type, etc.
214285

215286
### Delete object
216287

@@ -257,7 +328,7 @@ An HTTP 204 (No Content) and empty body will be retuned if successful.
257328

258329
### List objects
259330

260-
To perform a list object operation, invoke the S3 binding with a `POST` method and the following JSON body:
331+
To perform a list object operation, invoke the GCP bucket binding with a `POST` method and the following JSON body:
261332

262333
```json
263334
{
@@ -316,6 +387,58 @@ The list of objects will be returned as JSON array in the following form:
316387
}
317388
]
318389
```
390+
391+
### Copy objects
392+
393+
To perform a copy object operation, invoke the GCP bucket binding with a `POST` method and the following JSON body:
394+
395+
```json
396+
{
397+
"operation": "copy",
398+
"metadata": {
399+
"destinationBucket": "destination-bucket-name",
400+
}
401+
}
402+
```
403+
404+
The metadata parameters are:
405+
406+
- `destinationBucket` - the name of the destination bucket (required)
407+
408+
### Move objects
409+
410+
To perform a move object operation, invoke the GCP bucket binding with a `POST` method and the following JSON body:
411+
412+
```json
413+
{
414+
"operation": "move",
415+
"metadata": {
416+
"destinationBucket": "destination-bucket-name",
417+
}
418+
}
419+
```
420+
421+
The metadata parameters are:
422+
423+
- `destinationBucket` - the name of the destination bucket (required)
424+
425+
### Rename objects
426+
427+
To perform a rename object operation, invoke the GCP bucket binding with a `POST` method and the following JSON body:
428+
429+
```json
430+
{
431+
"operation": "rename",
432+
"metadata": {
433+
"newName": "object-new-name",
434+
}
435+
}
436+
```
437+
438+
The metadata parameters are:
439+
440+
- `newName` - the new name of the object (required)
441+
319442
## Related links
320443

321444
- [Basic schema for a Dapr component]({{< ref component-schema >}})

0 commit comments

Comments
 (0)