Skip to main content

FetchGCSObject

Description

Fetches a file from a Google Cloud Bucket. Designed to be used in tandem with ListGCSBucket.

Tags

fetch, gcs, google, google cloud, 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.
Project IDgcp-project-idGoogle Cloud Project ID

Supports Expression Language, using Environment variables.
Bucket *gcs-bucket${gcs.bucket}Bucket of the object.

Supports Expression Language, using FlowFile attributes and Environment variables.
Key *gcs-key${filename}Name of the object.

Supports Expression Language, using FlowFile attributes and Environment variables.
Object Generationgcs-generationThe generation of the Object to download. If not set, the latest generation will be downloaded.

Supports Expression Language, using FlowFile attributes and Environment variables.
Server Side Encryption Keygcs-server-side-encryption-keyAn AES256 Key (encoded in base64) which the object has been encrypted in.

Supports Expression Language, using FlowFile attributes and Environment variables.
Range Startgcs-object-range-startThe byte position at which to start reading from the object. An empty value or a value of zero will start reading at the beginning of the object.

Supports Expression Language, using FlowFile attributes and Environment variables.
Range Lengthgcs-object-range-lengthThe number of bytes to download from the object, starting from the Range Start. An empty value or a value that extends beyond the end of the object will read to the end of the object.

Supports Expression Language, using FlowFile attributes and Environment variables.
Number of retries *gcp-retry-count6How many retry attempts should be made before routing to the failure relationship.
Storage API URLstorage-api-urlOverrides the default storage URL. Configuring an alternative Storage API URL also overrides the HTTP Host header on requests as described in the Google documentation for Private Service Connections.

Supports Expression Language, using 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

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
failureFlowFiles are routed to this relationship if the Google Cloud Storage operation fails.
successFlowFiles are routed to this relationship after a successful Google Cloud Storage operation.

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
filenameThe name of the file, parsed if possible from the Content-Disposition response header
gcs.bucketBucket of the object.
gcs.cache.controlData cache control of the object.
gcs.component.countThe number of components which make up the object.
gcs.content.dispositionThe data content disposition of the object.
gcs.content.encodingThe content encoding of the object.
gcs.content.languageThe content language of the object.
gcs.crc32cThe CRC32C checksum of object's data, encoded in base64 in big-endian order.
gcs.create.timeThe creation time of the object (milliseconds)
gcs.encryption.algorithmThe algorithm used to encrypt the object.
gcs.encryption.sha256The SHA256 hash of the key used to encrypt the object
gcs.etagThe HTTP 1.1 Entity tag for the object.
gcs.generated.idThe service-generated for the object
gcs.generationThe data generation of the object.
gcs.keyName of the object.
gcs.md5The MD5 hash of the object's data encoded in base64.
gcs.media.linkThe media download link to the object.
gcs.metagenerationThe metageneration of the object.
gcs.ownerThe owner (uploader) of the object.
gcs.owner.typeThe ACL entity type of the uploader of the object.
gcs.sizeSize of the object.
gcs.update.timeThe last modification time of the object (milliseconds)
gcs.uriThe URI of the object as a string.
mime.typeThe MIME/Content-Type of the object

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 Compute Storage (GCS) bucket

Components Involved

  • ListGCSBucket
    1. The "Bucket" property should be set to the name of the GCS bucket that files reside in. 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 #{GCS_SOURCE_BUCKET}.
    2. Configure the "Project ID" property to reflect the ID of your Google Compute Cloud Project.
    3. The "GCP Credentials Provider Service" property should specify an instance of the GCPCredentialsService in order to provide credentials for accessing the bucket.
    4. The 'success' Relationship of this Processor is then connected to FetchGCSObject.
  • FetchGCSObject
    1. "Bucket" = "${gcs.bucket}"
    2. "Name" = "${filename}"
    3. 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

DeleteGCSObject, ListGCSBucket, PutGCSObject