Was this helpful?
Google Drive Queue
Note:  For general information about Queue Steps, see Queue Step.
Google Drive is a personal cloud storage service from Google that allows you to store and synchronize digital content across computers, laptops and mobile devices, including Android-powered tablets and smart phone devices. Once permissions are granted by the owner of a Google Drive account, the component facilitates uploading or downloading files to the account.
Google Drive Queue Property Descriptions
Property
Description
Token Folder
Local directory that will be used to store an OAuth token after the owner of the Google Drive account has granted the requested permissions to the component.
Click Browse and select a folder. You can also right-click and use the Paste Macro option to specify the token folder.
After specifying this folder, you must test the connection and obtain a valid token for connecting to Google Drive. For the steps, see Obtaining Valid Token for Connecting to Google Drive.
The connection is successful if a valid token file is created in the Token Folder.
Test Connect Timeout
Maximum amount of time in seconds before "Test Connection" will time out.
The default value is: 60
Delete Uploaded Files When Finished
When set to TRUE, all the uploaded files are automatically deleted after the process completes.
The default value is: FALSE
Obtaining Valid Token for Connecting to Google Drive
The Test Connection option helps you to obtain a valid token for connecting to Google drive.
To test the connection and obtain a valid token, perform the following:
1. In the Google Drive queue component properties, in the Token Folder, specify a path. This is the folder where the granted OAuth token file will be created. For example, C:\Temp.
2. Click Test Connection.
The Google Sign in page opens with the following message:
Choose an account to continue to Actian DataConnect
3. Select your Google or Gmail account that you want to connect with Actian DataConnect.
The Grant Actian DataConnect permission dialog is displayed asking for permission to view, edit, create, and delete all of your Google Drive files.
4. Click Allow.
The following message is displayed:
View and manage metadata of files in your Google Drive files
5. Click Allow.
The following message is displayed:
Confirm your choices
6. Click Allow.
The following message is displayed:
Received verification code
7. Click OK and then click Save.
The Google Drive Queue component is ready to use.
8. Open file explorer and go to the folder that you had specified as the Token Folder. You will see a new file called StoredCredential is created. This is the granted token file for your Google Drive account.
Supported Actions
Action
Description
Connect
Establishes a connection to the authorized Google Drive account.
Disconnect
Disconnects from the authorized Google Drive account.
GetMessage
Downloads a file from the authorized Google Drive account to either a DJMessage or a local file.
PutMessage
Uploads a file to the authorized Google Drive account from a DJMessage or local file.
Note:  The PutMessage action is not supported on AIX.
Supported Action Parameters
Action
Parameter
Description
GetMessage
Message
Name of a DJMessage to which the file downloaded file will be written if a local file was not specified.
PutMessage
Message
Name of a DJMessage from which data will be uploaded if a local file was not specified.
Note:  The PutMessage action is not supported on AIX.
 
Supported Action Properties
Action
Property
Description
GetMessage
Google Drive File
Name of the file to retrieve from Google Drive.
You can specify the full path to the file if it is a folder within one or more directories. For example, if the accounts.txt file is within the data directory, which is in a another directory called company, then the path to the file is company/data/accounts.txt.
Local File
Click Browse and specify a local file, to which the downloaded Google Drive file will be written. Leave blank to write the downloaded content to this step's DJMessage.
Bytes Limit
Number of bytes to download from the selected Google drive file. This is useful for sampling. Leave this blank if you want to download the entire object.
Delete File After Retrieval
When set to TRUE, then after successfully downloading the file, delete the file from Google drive. The default value is FALSE.
PutMessage
Note:  The PutMessage action is not supported on AIX.
Google Drive File
Name of the Google Drive file to be written. This can be overridden through the DJMessage property DriveFile.
Local File
Click Browse and specify the local file that will be copied to the specified Google Drive file. Leave it blank if you want to upload the content of the DJMessage body.
MIME Type
Specify the MIME type of the content that will be uploaded to Google Drive. This is a useful option if the content is being uploaded from the body of a DJMessage. It can be overridden through the DJMessage property MimeType.
Note:  MIME Type will automatically be determined when uploading from a local file.
A limited list of MIME types is available for selection. However, you can specify any MIME type supported by Google Drive. The available MIME Types are:
text/xml
text/html
text/plain
application/json
application/xml
application/octet-stream
Replace Existing File
When set to TRUE, the existing file is replaced on Google Drive. The default value is FALSE.
Override Queue Properties
You can override the values provided for the object name and local file name in the PutMessage action using the following DJMessage properties:
DriveFile: This header property can be set in the DJMessage argument to the PutMessage action. If provided, it overrides any value that is set in the Google Drive File option.
LocalFile: This header property can be set in the DJMessage argument to the PutMessage action. If provided, it overrides the value set in the Local File option. If both are missing, then the uploaded data is read from the DJMessage body.
MimeType: This header property can be set in the DJMessage argument to the PutMessage action. If provided, it overrides the value set in the MIME Type option.
ReplaceFile: This header property can be set in the DJMessage argument to the PutMessage action. If provided, it overrides the value set in the Replace Existing File option.
Note:  The PutMessage action is not supported on AIX.
Errors
The following table describes the error codes generated for the Google Drive Queue component.
 
Action
Code
Description
Connect
ERR_OK
Connect completed successfully without any errors
ERR_OPENERR
Connect failed. Typically associated with LT_ERROR log level.
Disconnect
ERR_OK
Disconnect completed successfully.
ERR_CLOSERR
Associated with warning-level log message. Disconnect action is called after the component is already disconnected.
ERR_DELETERR
If the component is configured to delete uploaded files from Google Drive during connect, then this error code is generated when one or more files that are deleted resulted in error. This is associated with warning-level log message.
GetMessage
ERR_OK
File retrieved and saved (to file or DJMessage) without any errors.
ERR_BADOPTIONVALUE
Google Drive file name is not set. This is associated with error-level log message.
ERR_READERR
Local file or referenced file already exists. This is associated with error-level log message.
ERR_DELETERR
Error in copying response content to the provided DJMessage. This is associated with error-level log message.
Too many errors generated by the Google Drive SDK produces this error. The error code will include a message appropriate to the error.
PutMessage
ERR_OK
File uploaded to the Google Drive account without any errors.
ERR_BADOPTIONVALUE
Google Drive file name property must be set. This is associated with error-level log entry
ERR_WRITERR
Error copying data from DJMessage.
Google-generated error occurred when sending or writing data to the remote Google Drive account. A number of messages can be generated and all these messages are associated with error-level log entry.
Last modified date: 12/03/2024