NIFI-10523 - Improved Google Drive processor documentations.

This closes #6430.

Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
This commit is contained in:
Tamas Palfy 2022-09-19 17:01:18 +02:00 committed by Peter Turcsanyi
parent f14f940389
commit 1d9e119084
No known key found for this signature in database
GPG Key ID: 55A813F1C3E553DC
4 changed files with 120 additions and 4 deletions

View File

@ -49,7 +49,8 @@ import java.util.Set;
@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
@Tags({"google", "drive", "storage", "fetch"})
@CapabilityDescription("Fetches files from a Google Drive Folder. Designed to be used in tandem with ListGoogleDrive.")
@CapabilityDescription("Fetches files from a Google Drive Folder. Designed to be used in tandem with ListGoogleDrive. " +
"For how to setup access to Google Drive please see additional details.")
@SeeAlso({ListGoogleDrive.class})
@WritesAttributes({
@WritesAttribute(attribute = FetchGoogleDrive.ERROR_CODE_ATTRIBUTE, description = "The error code returned by Google Drive when the fetch of a file fails"),

View File

@ -71,7 +71,8 @@ import java.util.concurrent.TimeUnit;
"Each listed file may result in one flowfile, the metadata being written as flowfile attributes. " +
"Or - in case the 'Record Writer' property is set - the entire result is written as records to a single flowfile. " +
"This Processor is designed to run on Primary Node only in a cluster. If the primary node changes, the new Primary Node will pick up where the " +
"previous node left off without duplicating all of the data.")
"previous node left off without duplicating all of the data. " +
"For how to setup access to Google Drive please see additional details.")
@SeeAlso({FetchGoogleDrive.class})
@InputRequirement(Requirement.INPUT_FORBIDDEN)
@WritesAttributes({@WritesAttribute(attribute = GoogleDriveFileInfo.ID, description = "The id of the file"),
@ -89,9 +90,10 @@ public class ListGoogleDrive extends AbstractListProcessor<GoogleDriveFileInfo>
public static final PropertyDescriptor FOLDER_ID = new PropertyDescriptor.Builder()
.name("folder-id")
.displayName("Folder ID")
.description("The ID of the folder from which to pull list of files. Needs to be shared with a Service Account." +
.description("The ID of the folder from which to pull list of files." +
" For how to setup access to Google Drive and obtain Folder ID please see additional details." +
" WARNING: Unauthorized access to the folder is treated as if the folder was empty." +
" This results in the processor not creating result flowfiles. No additional error message is provided.")
" This results in the processor not creating outgoing FlowFiles. No additional error message is provided.")
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
.required(true)

View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<meta charset="utf-8"/>
<title>FetchGoogleDrive</title>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>
<h1>Accessing Google Drive from NiFi</h1>
<p>
This processor uses Google Cloud credentials for authentication to access Google Drive.
The following steps are required to prepare the Google Cloud and Google Drive accounts for the processors:
</p>
<ol>
<li><b>Enable Google Drive API in Google Cloud</b>
<ul>
<li>Follow instructions at <a href="https://developers.google.com/workspace/guides/enable-apis">
https://developers.google.com/workspace/guides/enable-apis</a> and search for 'Google Drive API'.
</li>
</ul>
</li>
<li><b>Grant access to Google Drive folder</b>
<ul>
<li>In Google Cloud Console navigate to IAM & Admin -> Service Accounts.</li>
<li>Take a note of the email of the service account you are going to use.</li>
<li>Navigate to the folder to be listed in Google Drive.</li>
<li>Right-click on the Folder -> Share.</li>
<li>Enter the service account email.</li>
</ul>
</li>
</ol>
</body>
</html>

View File

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<meta charset="utf-8"/>
<title>ListGoogleDrive</title>
<link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"/>
</head>
<body>
<h1>Accessing Google Drive from NiFi</h1>
<p>
This processor uses Google Cloud credentials for authentication to access Google Drive.
The following steps are required to prepare the Google Cloud and Google Drive accounts for the processors:
</p>
<ol>
<li><b>Enable Google Drive API in Google Cloud</b>
<ul>
<li>Follow instructions at <a href="https://developers.google.com/workspace/guides/enable-apis">
https://developers.google.com/workspace/guides/enable-apis</a> and search for 'Google Drive API'.
</li>
</ul>
</li>
<li><b>Grant access to Google Drive folder</b>
<ul>
<li>In Google Cloud Console navigate to IAM & Admin -> Service Accounts.</li>
<li>Take a note of the email of the service account you are going to use.</li>
<li>Navigate to the folder to be listed in Google Drive.</li>
<li>Right-click on the Folder -> Share.</li>
<li>Enter the service account email.</li>
</ul>
</li>
<li><b>Find Folder ID</b>
<ul>
<li>Navigate to the folder to be listed in Google Drive and enter it. The URL in your browser will include the ID at the end of
the URL.
For example, if the URL were <code>https://drive.google.com/drive/folders/1trTraPVCnX5_TNwO8d9P_bz278xWOmGm</code>, the
Folder ID would be <code>1trTraPVCnX5_TNwO8d9P_bz278xWOmGm</code>
</li>
</ul>
</li>
<li><b>Set Folder ID in 'Folder ID' property</b>
</li>
</ol>
</body>
</html>