storage:google:drive:read
Downloads one Google Drive file's metadata and content, using a connection resolved from the connections store.
Options
| Name | Type | Description |
|---|---|---|
connection | string | The connection id to use; empty resolves the only google-drive connection |
id | string | The drive file id to read, as returned by storage:google:drive:list |
Outputs
| Name | Type | Description |
|---|---|---|
file | File | Storage.File the file's metadata |
↳ id | string | The provider's file id |
↳ name | string | The file name |
↳ mime_type | string | The file's mime type |
↳ size | int64 | The file size in bytes |
↳ modified | string | The last modification time in RFC 3339 |
↳ folder | bool | Whether the entry is a folder |
content | string | The file contents as a UTF-8 string |
body | []byte | The file contents as raw bytes |
Example
name: Read the newest Drive report
actions:
- name: reports
component: storage:google:drive:list
vars:
query: name contains 'report'
limit: 1
- name: report
component: storage:google:drive:read
vars:
id: "{{ reports.files | first | key:'id' }}"
outputs:
name: "{{ report.file.name }}"
content: "{{ report.content }}"