Disclaimer
Your use of this download is governed by Stonebranch’s Terms of Use, which are available at https://www.stonebranch.com/integration-hub/Terms-and-Privacy/Terms-of-Use/
Overview
This Universal Extension is an interface to Rclone that provides the capability to manage and synchronize files from across different cloud storages, as well as local or distributed file systems. Rclone, is the open source command line program, that is utilized to accomplish all the actions supported in this Extension.
Version Information
Template Name | Extension Name | Extension Version |
---|---|---|
Cloud Data Transfer | ue-cloud-dt | 2.0.1 |
Refer to Cloud Data Transfer for version history information.
Software Requirements
This integration requires a Universal Agent, a Python runtime to execute the Universal Task, and a Rclone executable.
Software Requirements for Universal Template and Universal Task
Requires Python 3.7.0 or higher. Tested with the Universal Agent bundled Python distribution.
Software Requirements for Universal Agent
Both Windows and Linux agents are supported.
- Universal Agent for Windows x64 Version 7.2.0.0 and later with python options installed.
- Universal Agent for Linux Version 7.2.0.0 and later with python options installed.
Software Requirements for Universal Controller
Universal Controller Version 7.2.0.0 and later.
Software Requirements for Rclone
Rclone needs to be installed on the same server where the Universal Agent is installed. Rclone binary should be stored on a location where Universal Agent has access and permissions to execute it.
Network and Connectivity Requirements
Universal Agent should be able to establish connection with:
- The remote storages that are provided as input for the Universal Task.
- The Universal Controller host. This is required only in case Refresh Storage Credentials field is used.
Key Features
This Universal Extension is an interface for Rclone and as an interface it supports the following key features:
- Actions
- Copy, move, synchronize data between two storages.
- Copy a URL's content and to cloud or local destination without saving it in temporary storage.
- List data on a storage, including listing with details or in JSON format for machine parsing.
- Create objects on a storage.
- Delete objects from a storage.
- Features:
- Fast transfers for objects stored in the same region.
- Preserves always timestamps and verifies checksums.
- Supports encryption, caching, compression, chunking.
- Dynamic token updates for OneDrive Business cloud storage, observing the OneDrive business refresh token flow.
- Support for dry runs. Allows users to execute a Universal Task without making any permanent changes on the target storage.
- Advanced filtering capability for files or objects to be listed or transferred.
- Option to mark the Universal Task as Failed when no files have been transferred.
- List of overwrite options for existing data.
- Additional customized options.
- Output
- Progress of the selected Action is visible, during Universal Task Instance execution.
- Text or JSON formatted output.
Integrated Storage Systems
Rclone is integrated with multiple storage systems (an overview can be found here). This Universal Extension has been tested against the following Storage Systems.
- Amazon S3
- Google Cloud Storage
- Microsoft OneDrive Business
- Local file system (Linux, Windows)
- HTTP(S) URL
This integration should work properly against other Storage Systems, as long as the integration interface (see chapter Configure Universal Task) and functionalities listed in this document fulfil the needs of the Storage System.
For functionalities required for specific Storage Systems, users and customers are encouraged to open a Feature Request in our Customer Support Portal.
Import Universal Template
To use the Universal Template, you first should perform the following steps.
This Universal Task requires the Resolvable Credentials feature. Check that the Resolvable Credentials Permitted system property has been set to true.
To import the Universal Template into your Controller, follow the instructions here.
When the files have been imported successfully, refresh the Universal Templates list; the Universal Template will appear on the list.
Modifications of this integration, applied by users or customers, before or after import, might affect the supportability of this integration. For more information refer to Integration Modifications.
Configure Universal Task
To configure a new Universal Task, there are two steps required:
- Create required Resolvable Credentials. Required as Input Fields on the Universal Task Configuration.
- Create a new Script of type Data, for the Configuration File and populate it according to the following section of Setup Rclone Configuration File. Required as Input Fields on the Universal Task Configuration.
- Create a new task, and enter the task-specific details that were created in the Universal Template.
Setup Rclone Configuration File
The configuration file is following the INI format, and contains all required parameters and credentials to connect to a Storage System. All configuration options per Storage System can be found in the respective "Config Rclone documentation" here.
It is advised that account credentials, tokens, or any other essential information to be passed as an encrypted Resolvable Credential field. To set a value with the respective Credential field, please make sure to use the appropriate Credential function inside the configuration file.
'Runtime Password' Credentials field supports values with up to 512 characters.
Hard coded values can be provided in the script file, as well. However, it is not advised for security reasons.
It is recommended to configure a storage system section, one to one with the Credential fields in this Universal Extension (please refer to the Input Fields section below).
For local file system Storages, no credentials are required in the configuration file. The selected action will be executed with the Credentials that are provided in the "Agent Details" of the Universal Task. If no Credentials are provided for the used Agent, then the same user that runs ubroker daemon will be used.
Script Type should be Data, and option Resolve UAC Variables should be enabled.
The indicative Configuration File below, contains the basic connection parameters (flags):
[ue_aws_s3]
type = s3
provider = AWS
access_key_id = ${_credentialUser('${ops_ue_cloud_dt_storage_credentials}')}
secret_access_key = ${_credentialPwd('${ops_ue_cloud_dt_storage_credentials}')}
region = us-east-2
[ue_aws_s3_source]
type = s3
provider = AWS
access_key_id = ${_credentialUser('${ops_ue_cloud_dt_source_credentials}')}
secret_access_key = ${_credentialPwd('${ops_ue_cloud_dt_source_credentials}')}
region = us-east-2
acl = bucket-owner-full-control
role_arn = arn:aws:iam::<account_id>:role/<role policy>
[ue_aws_s3_target]
type = s3
provider = AWS
env_auth = false
access_key_id = ${_credentialUser('${ops_ue_cloud_dt_target_credentials}')}
secret_access_key = ${_credentialPwd('${ops_ue_cloud_dt_target_credentials}')}
region = us-east-2
[google_cloud_storage]
type = google cloud storage
service_account_file = ${_credentialPwd('${ops_ue_cloud_dt_storage_credentials}')}
object_acl = bucketOwnerFullControl
project_number = johnprojectno
location = europe-west3
[google_cloud_storage_source]
type = google cloud storage
service_account_file = ${_credentialPwd('${ops_ue_cloud_dt_source_credentials}')}
object_acl = bucketOwnerFullControl
project_number = johnprojectno
location = europe-west3
[google_cloud_storage_target]
type = google cloud storage
service_account_file = ${_credentialPwd('${ops_ue_cloud_dt_target_credentials}')}
object_acl = bucketOwnerFullControl
project_number = johnprojectno
location = europe-west3
[one_drive]
type = onedrive
token = ${_credentialToken('${ops_ue_cloud_dt_storage_credentials}')}
drive_id = ${_credentialUser('${ops_ue_cloud_dt_storage_credentials}')}
drive_type = business
auth_url = https://login.microsoftonline.com/<tenant id>/oauth2/v2.0/authorize
token_url = https://login.microsoftonline.com/<tenant id>/oauth2/v2.0/token
[one_drive_source]
type = onedrive
token = ${_credentialToken('${ops_ue_cloud_dt_source_credentials}')}
drive_id = ${_credentialUser('${ops_ue_cloud_dt_source_credentials}')}
drive_type = business
[one_drive_target]
type = onedrive
token = ${_credentialToken('${ops_ue_cloud_dt_target_credentials}')}
drive_id = ${_credentialUser('${ops_ue_cloud_dt_target_credentials}')}
drive_type = business
[linux_source]
type = local
[linux_target]
type = local
[windows_source]
type = local
[windows_target]
type = local
Input Fields
Fields Dependencies
This Universal Extension support Actions which can be categorized as follows:
Category | Actions | Dependent Required Fields |
---|---|---|
Single storage action |
|
|
Two storages action |
|
|
Fields Description
The input fields for this Universal Extension are described below.
Field | Input type | Default value | Type | Description |
---|---|---|---|---|
Action | Required | Copy Objects | Choice | Action to be performed. Available actions:
|
Configuration File | Required | - | Script | Rclone Configuration file, that contains all required parameters to connect to the Storage System, Source Storage and Target Storage. It is indicated to provide an extension suffix as part of the file name. Example: rclone.conf |
Storage System | Optional | - | Dynamic Choice Field | Remote or Local storage to execute the selected Action. Execute the Dynamic Choice Field and retrieve all the available Storages from Configuration File. Required when one of the Single storage actions is selected. |
Source Storage | Optional | - | Dynamic Choice Field | Remote or Local source storage, where transfer Action is initiated. Execute the Dynamic Choice Field and retrieve automatically all the available Storages from Configuration File. Required when one of the Two storage actions is selected. |
Target Storage | Optional | - | Dynamic Choice Field | Remote or Local target storage, where transferred data is stored. Execute the Dynamic Choice Field and retrieve automatically all the available Storages from Configuration File. Required when one of the Two storage actions is selected. |
Storage Credentials | Optional | - | Credential | Credentials needed to connect to the selected Storage System. Required when one of the Single storage actions is selected. For Storage System of type local , the standard Agent's Credentials field should be provided. |
Source Credentials | Optional | - | Credential | Credentials needed to connect to the selected Source Storage. Required when one of the Two storage actions is selected. For Storage System of type local , the standard Agent's Credentials field should be provided. |
Target Credentials | Optional | - | Credential | Credentials needed to connect to the selected Target Storage. Required when one of the Two storage actions is selected. For Storage System of type local , the standard Agent's Credentials field should be provided. |
Filepath | Optional | - | Text | File or directory path from where to retrieve data for the selected Action. Required when one of the Single storage actions is selected. |
Source Filepath | Optional | - | Text | File or directory path from where to retrieve data for the selected Action. Required when one of the Two storage actions is selected. |
Target Filepath | Optional | - | Text | File or directory path where transferred data to will be stored for the selected Action. Required when one of the Two storage actions is selected. |
Update Credentials | Optional | False | Boolean | This field needs to be used when Rclone executable updates Fields on its Configuration File during execution, that need to be stored as Credential Fields on the Universal Controller. For example: when OneDrive Storage type is used. In this case, the existing configured token is exchanged by Rclone with a new one to establish the connection. This new token should be stored on Universal Controller for the next task execution. Please read Rclone limitations on OneDrive token refresh here. This field is used in conjunction with fields Controller URL, Controller Credentials, Refresh Storage Credentials. |
Controller URL | Optional | - | Text | Controller URL where Storage Credentials, Source Credentials, Target Credentials are stored. Required when Update Credentials is checked. |
Controller Credentials | Optional | - | Credentials | Controller user's credentials, used for logging and updating Storage Credentials, Source Credentials, Target Credentials will be updated. The Credentials definition should be as follows:
Required when Update Credentials is checked. |
Refresh Storage Credentials | Optional | - | Array | This Array field is available when Update Credentials is set to True and used as a mapping table that indicates which field from the Configuration File of Rclone is used to update which Credential entry field on Universal Controller. Populate this array with the following format:
Note: Refresh of Storage/Source/Target Credentials is performed via Controller's REST API. See Network and Connectivity Requirements |
Use Filter | Optional | -- None -- | Choice | The filter type that is applied on the Action. Available options:
Optional for all, but list type Actions. |
Filter | Optional | - | Text | Filter as regular expression that is applied on the Action. Required when Use Filter is checked. |
Overwrite Options | Optional | Do Not Overwrite | Choice | Options for overwriting files in the Target Storage. Available options:
Optional when one of the Two storage actions is selected. |
Recursion Depth | Optional | 1 | Integer | Recursion depth that is applied. Default value 1 means that no recursion will be applied. Note: Use this option with caution when one of the following Actions are selected, as this might result in doing actions on unnecessary files/cloud objects. For more information on Recursion Depth you can refer to the official Rclone documentation:
|
Error On No File Transfer | Optional | False | Boolean | When enabled and when no files are transferred, a failure exit code with value equal to 21 is raised. Optional when one of the Two storage actions is selected. |
Dry-Run | Optional | False | Boolean | When enabled, performs a trial run with no permanent changes of the selected Action. Note: It is recommended to execute a Dry-Run as a test prior to the final task configuration when the following Actions are used:
|
Additional Options | Optional | - | Text | Space separated Rclone options that applied to the selected Action. |
Log Format | Optional | Text | Choice | Option for STDERR logging format. Available options:
|
Task Examples
Configuration File Script
Transfer between Cloud Storages and Refresh Storage Credentials
In the following example, the Credentials field "Token" used in "one_drive_target" of "token" field inside Configuration File will be updated with the refreshed token.
Listing Cloud Storage
Synchronize local file system to Cloud Storage
Task Output
Output Only Fields
The output fields for this Universal Extension are described below.
Field | Type | Description |
---|---|---|
Progress | Large Text | Live progress information of the transferred files. |
Exit Codes
The exit codes for this Universal Extension are described below.
Exit Code | Status Classification Code | Status Classification Description | Status Description |
---|---|---|---|
0 | SUCCESS | Successful Execution | SUCCESS: Successful Task execution |
1 | FAIL | Failed Execution |
|
21 | FAIL | Failed Execution | FAIL: No Files were transferred. |
22 | FAIL | Failed Execution | FAIL: Cloud Data Transfer task executed successfully but updating Credentials failed. |
Extension Output
In the context of a workflow, subsequent tasks can rely on the information provided by this integration as Extension Output.
Attribute changed
is populated as follows:
Case Scenario | Result |
---|---|
Action is other than List, executed successfully and is not Dry-Run. | true |
Action executed successfully, and is Dry-Run. | false |
Action returned exit code 21. | false |
Αction executed with failure. | false |
The Extension output contains attribute result
. Attribute result
contains the following sub-attributes:
Attribute | Type | Description |
---|---|---|
cmd | string | The Rclone generated and executed command based on the input fields. |
rc | number | The Rclone native return code. More information about Rclone exit codes can be found here. |
An example of the Extension Output for a "Copy Objects" Action is presented below.
{
"exit_code": 0,
"status_description": "SUCCESS: Cloud Data Transfer task executed successfully. ",
"changed": true,
"invocation": {_
"extension": "ue-cloud-dt",
"version": "1.0.0",
"fields": {
"action": "Copy Objects",
"configuration_file": "rclone.conf",
"log_level": "DEBUG",
"storage_system": null,
"storage_credentials_name": null,
"source_storage": "ue_aws_s3_source",
"source_credentials_name": "ue-aws-s3",
"target_storage": "one_drive_target",
"target_credentials_name": "rclone_one_drive",
"update_credentials": true,
"controller_url": "http://localhost:8080/uc",
"controller_credentials_name": "uc_user",
"refresh_storage_credentials": [
{
"\"one_drive_target\".\"token\"": "\"rclone_one_drive\".\"Token\""
}
],
"filepath": null,
"source_filepath": "john-bucket",
"target_filepath": "john-drive",
"use_filter": "Include",
"filter": "*.py",
"additional_options": [],
"overwrite_options": "Do Not Overwrite",
"recursion_depth": 1,
"error_on_no_file_transfer": false,
"dry_run": true,
"log_format": "Text",
}
},
"result": {
"cmd": "rclone --config=//var/opt/universal/tmp/b4a333c4-497e-425c-8ce3-f8c5bdad9150.con --log-level=DEBUG --use-json-log --max-depth=1 --dry-run --progress --no-traverse --ignore-existing copy ue_aws_s3_source:john-bucket one_drive_target:john-drive --include *.py",
"rc": 0
}
}
STDOUT and STDERR
STDOUT and STDERR populated content can be changed in future versions of this extension without notice. Backward compatibility is not guaranteed.
STDOUT/STDERR of Rclone is redirected to Task STDOUT/STDERR respectively and propagated during task execution. This is particularly useful for long-lasting data transfers. Retrieve Output
while Task Instance is Running and press Refresh
to get the latest STDOUT/STDERR.
Integration Modifications
Modifications applied by users or customers, before or after import, might affect the supportability of this integration. The following modifications are discouraged to retain the support level as applied for this integration.
- Python code modifications should not be done.
- Template Modifications
- General Section
- "Name", "Extension", "Variable Prefix", "Icon" should not be changed.
- Universal Template Details Section
- "Template Type", "Agent Type", "Send Extension Variables", "Always Cancel on Force Finish" should not be changed.
- Result Processing Defaults Section
- Success and Failure Exit codes should not be changed.
- Success and Failure Output processing should not be changed.
- Fields Restriction Section
- Default configured values should not be changed.
- General Section
Users and customers are encouraged to report defects, or feature requests at Stonebranch Support Desk.
Document References
This document references the following documents.
Document Link | Description |
---|---|
Universal Templates | User documentation for creating Universal Templates in the Universal Controller user interface. |
Universal Tasks | User documentation for creating Universal Tasks in the Universal Controller user interface. |
Rclone | Rclone official documentation. |
Rclone Install | Installation instructions. |
Rclone Downloads | Download links for Linux, Windows, MacOS. |
Rclone Storage Systems configuration | Configuration file details. |
Rclone Exit Codes | Rclone exit codes list. |
Changelog
ue-cloud-dt-2.0.1 (2023-07-28)
Fixes
Fixed
: Retrieving STDOUT/STDERR might block a Task Instance in Running status (#33732).
ue-cloud-dt-2.0.0 (2022-10-26)
Deprecations and Breaking Changes
Breaking Change
: Universal Template Name rename.
This version of Universal Extension, will have no effect on existing tasks created with Universal Template Cloud Data Transfer and extension archive ue-cloud-ft-1.0.0. Future updates on this integration will take place on top of ue-cloud-dt-2.0.0.
ue-cloud-ft-1.0.0 (2022-09-02)
Added
: Initial version (#28787)