Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
Table of Contents

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 NameExtension NameExtension Version
Cloud File Transferue-cloud-ft1.0.0
Cloud Data Transferue-cloud-dt2.0.0

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.

Note
This Universal Extension has been tested with Rclone v1.58.1. It should be working with later Rclone versions, as long as these are backwards compatible.

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
Note

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.

  1. This Universal Task requires the Resolvable Credentials feature. Check that the Resolvable Credentials Permitted system property has been set to true.

  2. To import the Universal Template into your Controller, follow the instructions here.

  3. 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

  1. 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.

  2. 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.

    Note

    '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.

  3. 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).

  4. 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.

  5. Script Type should be Data, and option Resolve UAC Variables should be enabled.


The indicative Configuration File below, contains the basic connection parameters (flags):

Note
Utilize the built-in Credential Functions, in order to properly resolve the associated Universal Task Credentials.
[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:

CategoryActionsDependent Required Fields
Single storage action
  • List Objects
  • List Directories
  • List Objects With Details
  • List Objects In JSON Format
  • Create Object
  • Delete Object
  • Delete Empty Directory
  • Storage System
  • Storage Credentials
  • Filepath
Two storages action
  • Copy Objects
  • Copy And Rename
  • Copy From URL
  • Move Objects
  • Move And Rename
  • Synchronize
  • Source Storage
  • Source Credentials
  • Source Filepath
  • Target Storage
  • Target Credentials
  • Target Filepath

Fields Description

The input fields for this Universal Extension are described below.

FieldInput typeDefault valueTypeDescription
ActionRequiredCopy ObjectsChoiceAction to be performed.

Available actions:
  • Copy Objects
  • Copy And Rename
  • Copy From URL
  • Move Objects
  • Move And Rename
  • List Objects
  • List Directories
  • List Objects With Details
  • List Objects In JSON Format
  • Create Object
  • Delete Object
  • Delete Empty Directory
  • Synchronize
Configuration FileRequired-ScriptRclone Configuration file, that contains all required parameters to connect to the Storage System, Source Storage and Target Storage.
Storage SystemOptional-Dynamic Choice FieldRemote 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 StorageOptional-Dynamic Choice FieldRemote 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 StorageOptional-Dynamic Choice FieldRemote 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 CredentialsOptional-CredentialCredentials 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 CredentialsOptional-CredentialCredentials 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 CredentialsOptional-CredentialCredentials 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.
FilepathOptional-TextFile or directory path from where to retrieve data for the selected Action.

Required when one of the Single storage actions is selected.
Source FilepathOptional-TextFile or directory path from where to retrieve data for the selected Action.

Required when one of the Two storage actions is selected.
Target FilepathOptional-TextFile 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 CredentialsOptionalFalseBooleanThis 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 URLOptional-TextController URL where Storage Credentials, Source Credentials, Target Credentials are stored.

Required when Update Credentials is checked.
Controller CredentialsOptional-CredentialsController user's credentials, used for logging and updating Storage Credentials, Source Credentials, Target Credentials will be updated. The Credentials definition should be as follows:
  • User as "Runtime User".
  • User Password as "Runtime Password".
Note: The provided user should have sufficient Credential permissions.

Required when Update Credentials is checked.
Refresh Storage CredentialsOptional-ArrayThis 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:
  • Configuration File Details: "<Storage/Source/Target Storage>"."<Configuration File's field to be refreshed by Rclone>"
  • Storage Credentials Details: "<Storage/Source/Target Credentials name>"."<Storage/Source/Target Credentials field to be updated>"
The result of this action is that the Configuration file's field value, is copied to the provided Storage Credential's field. Each line of this Array is evaluated, and related mapping is performed.
Note: Refresh of Storage/Source/Target Credentials is performed via Controller's REST API. See Network and Connectivity Requirements
Use FilterOptional-- None --ChoiceThe filter type that is applied on the Action.

Available options:
  • -- None --
  • Include
  • Exclude

Optional for all, but list type Actions.
FilterOptional-TextFilter as regular expression that is applied on the Action.

Required when Use Filter is checked.
Overwrite OptionsOptionalDo Not OverwriteChoiceOptions for overwriting files in the Target Storage.

Available options:
  • Overwrite
  • Do Not Overwrite
  • Append Timestamp In Filename

Optional when one of the Two storage actions is selected.
Recursion DepthOptional1IntegerRecursion 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:
  • Copy Objects
  • Copy And Rename
  • Move Objects
  • Move And Rename
  • Delete Object
  • Delete Empty Directory
  • Synchronize
Error On No File TransferOptionalFalseBooleanWhen 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-RunOptionalFalseBooleanWhen 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:
  • Copy Objects
  • Copy And Rename
  • Move Objects
  • Move And Rename
  • Delete Object
  • Delete Empty Directory
  • Synchronize
Additional OptionsOptional-TextSpace separated Rclone options that applied to the selected Action.
Log FormatOptionalTextChoiceOption for STDERR logging format.

Available options:
  • Text
  • JSON
  • .

Task Examples

Configuration File Script

Transfer between Cloud Storages and Refresh Storage Credentials

Note

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.

FieldTypeDescription
ProgressLarge TextLive progress information of the transferred files.

Exit Codes

The exit codes for this Universal Extension are described below.

Exit CodeStatus Classification CodeStatus Classification DescriptionStatus Description
0SUCCESSSuccessful ExecutionSUCCESS: Successful Task execution
1FAILFailed Execution
  • FAIL: Unexpected error. Execute in Debug for more information.
  • FAIL: Cloud Data Transfer task exited with non-zero exit code. See STDERR for more details.
21FAILFailed ExecutionFAIL: No Files were transferred.
22FAILFailed ExecutionFAIL: 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 ScenarioResult
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:

AttributeTypeDescription
cmdstringThe Rclone generated and executed command based on the input fields.
rcnumberThe 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.

Users and customers are encouraged to report defects, or feature requests at Stonebranch Support Desk.

Document References

This document references the following documents.

Document LinkDescription
Universal TemplatesUser documentation for creating Universal Templates in the Universal Controller user interface.
Universal TasksUser documentation for creating Universal Tasks in the Universal Controller user interface.
RcloneRclone official documentation.
Rclone InstallInstallation instructions.
Rclone DownloadsDownload links for Linux, Windows, MacOS.
Rclone Storage Systems configurationConfiguration file details.
Rclone Exit CodesRclone exit codes list.

Changelog

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)