Skip to main content

FetchGoogleDrive

Description

Fetches files from a Google Drive Folder. Designed to be used in tandem with ListGoogleDrive. Please see Additional Details to set up access to Google Drive.

Tags

drive, fetch, google, storage

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
GCP Credentials Provider Service *gcp-credentials-provider-serviceController Service:
GCPCredentialsService

Implementations:
GCPCredentialsControllerService
The Controller Service used to obtain Google Cloud Platform credentials.
File ID *drive-file-id${drive.id}The Drive ID of the File to fetch. Please see Additional Details for information on how to obtain the Drive ID.

Supports Expression Language, using FlowFile attributes and Environment variables.
Proxy Configuration Serviceproxy-configuration-serviceController Service:
ProxyConfigurationService

Implementations:
StandardProxyConfigurationService
Specifies the Proxy Configuration Controller Service to proxy network requests. Supported proxies: HTTP + AuthN
Google Doc Export Type *Google Doc Export TypePDF
  • PDF
  • Plain Text
  • Microsoft Word
  • OpenDocument
  • Rich Text
  • Web Page (HTML)
  • EPUB
Google Documents cannot be downloaded directly from Google Drive but instead must be exported to a specified MIME Type. In the event that the incoming FlowFile's MIME Type indicates that the file is a Google Document, this property specifies the MIME Type to export the document to.
Google Spreadsheet Export Type *Google Spreadsheet Export TypeCSV (first sheet only)
  • CSV (first sheet only)
  • Microsoft Excel
  • PDF
  • TSV (first sheet only)
  • Web Page (HTML)
  • OpenDocument Spreadsheet
Google Spreadsheets cannot be downloaded directly from Google Drive but instead must be exported to a specified MIME Type. In the event that the incoming FlowFile's MIME Type indicates that the file is a Google Spreadsheet, this property specifies the MIME Type to export the spreadsheet to.
Google Presentation Export Type *Google Presentation Export TypePDF
  • PDF
  • Microsoft PowerPoint
  • Plain Text
  • OpenDocument Presentation
  • PNG (first slide only)
  • JPEG (first slide only)
  • SVG (first slide only)
Google Presentations cannot be downloaded directly from Google Drive but instead must be exported to a specified MIME Type. In the event that the incoming FlowFile's MIME Type indicates that the file is a Google Presentation, this property specifies the MIME Type to export the presentation to.
Google Drawing Export Type *Google Drawing Export TypePDF
  • PDF
  • PNG
  • JPEG
  • SVG
Google Drawings cannot be downloaded directly from Google Drive but instead must be exported to a specified MIME Type. In the event that the incoming FlowFile's MIME Type indicates that the file is a Google Drawing, this property specifies the MIME Type to export the drawing to.

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
failureA FlowFile will be routed here for each File for which fetch was attempted but failed.
successA FlowFile will be routed here for each successfully fetched File.

Reads Attributes

NameDescription
drive.idThe id of the file

Writes Attributes

NameDescription
drive.idThe id of the file
drive.sizeThe size of the file
drive.timestampThe last modified time or created time (whichever is greater) of the file. The reason for this is that the original modified date of a file is preserved when uploaded to Google Drive. 'Created time' takes the time when the upload occurs. However uploaded files can still be modified later.
error.codeThe error code returned by Google Drive
error.messageThe error message returned by Google Drive
filenameThe name of the file
mime.typeThe MIME type of the file

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component requires an incoming relationship.

Example Use Cases Involving Other Components

Multiprocessor Use Case 1

Retrieve all files in a Google Drive folder

Components Involved

  • ListGoogleDrive
    1. The "Folder ID" property should be set to the ID of the Google Drive folder that files reside in. See processor documentation / additional details for more information on how to determine a Google Drive folder's ID.
    2. If the flow being built is to be reused elsewhere, it's a good idea to parameterize this property by setting it to something like #{GOOGLE_DRIVE_FOLDER_ID}.
    3. The "GCP Credentials Provider Service" property should specify an instance of the GCPCredentialsService in order to provide credentials for accessing the folder.
    4. The 'success' Relationship of this Processor is then connected to FetchGoogleDrive.
  • FetchGoogleDrive
    1. "File ID" = "${drive.id}"
    2. The "GCP Credentials Provider Service" property should specify an instance of the GCPCredentialsService in order to provide credentials for accessing the bucket.

System Resource Considerations

This component does not specify system resource considerations.

See Also

ListGoogleDrive, PutGoogleDrive