Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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/

Introduction

This Universal Task and associated Task Templates provides a dynamic File Monitoring and File Transfer solution for containerized applications running in any container management solution (for example: OpenShift, Kubernetes).

Overview

For containers running a Universal Agent, or for application pods with a sidecar container running a Universal Agent, the container file system can be dynamically monitored and files automatically transferred from the container file system.

  • Dynamically creates and enables an Agent File Monitor Trigger each time specific containers are started.

  • Transfer files from the containers.

  • Cleanup Agent File Monitor Triggers each time specific containers are stopped.

Overview

File compression is a way to reduce overall file size without losing any of the primary data to make large files more manageable.

This Universal Extension provides the capability to compress and decompress a file, with or without password encryption.

Software Requirements

This solution-pack requires a Universal Agent and a Python runtime to execute the Universal Task.

Software Requirements for /wiki/spaces/UC71x/pages/5178050 and /wiki/spaces/UC71x/pages/5180675

Requires Python 3.7.

...

0 or higher. Tested with the Universal Agent bundled Python distribution

...

Python modules required:

...

.

...

Software Requirements for Universal Agent

EitherBoth Windows and Linux agents are supported:

  • Universal Agent for Windows x64 Version 7.0.0.0 and later with python options installed.

  • Universal Agent for Linux Version 7.0.0.0 and later with python options installed.

Software Requirements for Universal Controller

  • Universal Controller Version 7.0.0.0 and later

Software Requirements for the Application to be Scheduled

The requests Python module is used to make API call to a Universal Controller instance.

Solution-pack Description

Dynamic container File Monitoring and File Transfers can be achieved with this Universal Task and its associated Task Templates by simply configuring the containerized Universal Agents as Transient and ensuring that they register with a specific Agent Cluster.

Each time the Container File Monitor Universal Task runs, it lists the members of the specified Agent Cluster, and for each member Agent performs the functions detailed in the following flowchart.

Image Removed

Customers must make sure that the Universal Task is executed on a schedule that suits their requirements for how often they need to check whether new containerized Agents have been started or stopped.

This can be done by either:

...

This Universal Extension is using 7zip command line tool.

  • 7-zip or p7zip version 15.05 or newer is required to be installed in Universal Agent, tested with 7-zip 21.06 and p7zip 16.02.

Notes about 7-Zip and p7zip

Excerpt from 7-Zip readme file. There are two different ports of 7-Zip for Linux:

  1. p7zip - another port of 7-Zip for Linux, made by an independent developer. The latest version of p7zip now is 16.02, and that p7zip 16.02 is outdated now.

  2. 7-Zip for Linux/macOS - this package - it's new code with all changes from latest 7-Zip for Windows.

These two ports are not identical. Note also that some Linux specific things can be implemented better in p7zip than in new 7-Zip for Linux.

There are several main executables in 7-Zip and p7zip:

  • 7zz (7-Zip)
    Stand-alone full version of 7-Zip that supports all formats.

  • 7zzs (7-Zip)
    Stand-alone full version of 7-Zip that supports all formats (static library linking).

  • 7z (p7zip)
    7-Zip that requires 7z.so shared library, and it supports all formats via 7z.so.

  • 7za (p7zip)
    Stand-alone version of 7-Zip that supports some main formats: 7z, xz, lzma, zip, bzip2, gzip, tar, cab, ppmd and split.

7zzs is similar to 7zz, but 7zzs was compiled for static library linking, so 7zzs does not use external shared library (".so") files.

You can use 7zzs if 7zz does not work due to lack of required shared library (".so") files. The command line syntax for executables from p7zip is similar to 7zz syntax from this package.

See the 7-Zip website for more information.

Software Requirements for Universal Controller

Universal Controller Version 7.0.0.0 and later.

Key Features

This Universal Extension provides the following main features:

  • Support to compress and decompress a file with zip deflate method.

  • Support for AES-256 password encryption.

Import Universal Template

...

When the template has been imported successfully, the Universal Template will appear on the list. Refresh your Navigation Tree to see these tasks in the Automation Center Menu.

Configure Universal Task

Create a Container File Monitor Universal Task for each Agent Cluster.

Field Descriptions for Container File Monitoring Universal Task

...

Field

...

Description

...

Controller URL

...

Universal Controller URL; that is: https://localhost:8443/uc

...

Controller Credential

...

Universal Controller Credential, specified user will need the following access rights:

  • Read Access to the specified Agent Cluster

  • Ability the delete the container Agents

  • Ability to Create, Enable, Disable and Delete Agent File Monitors, File Transfer Tasks, and Agent File Monitor Triggers that are members of the Business Service specified in the Monitor Task Business Service field.

...

Monitor Task Business Service

...

Business Service required for the generated UDM File Transfer Task, Agent File Monitor Task, and Agent File Monitor Trigger definitions.

...

Agent Cluster Name

...

Agent Cluster to Monitor.

...

Container Path

...

Path on the Container to Monitor; that is /tmp/*.txt or /tmp. This value is passed to the template Agent File Monitor Task

...

Destination Agent Name

...

Destination Agent for the UD File Transfer. This value is used in the generated UDM File Transfer Task.

...

Destination Credential

...

Destination Credential for File Transfer. This value is used in the generated UDM File Transfer Task.

...

Destination Path

...

Destination Path for File Transfer. This value is used in the generated UDM File Transfer Task.

Example for Container File Monitoring Universal Tasks

...

For the new Universal Task type, create a new task and enter the task-specific details that were created in the Universal Template.

Input Fields

The input fields for this Universal Extension are described in the following table.

Field

Input type

Default value

Type

Description

Action

Required

Compress file

Choice

The action performed upon the task execution.

Available options are:

  • Compress file

  • Decompress file

Algorithm

Required

zip

Choice

The compression algorithm to be used upon the action execution.

Available option is:

  • zip

Archiver Tool

Required

7za: 7-Zip (Windows) or p7zip (Linux) - standalone

Choice

The archiver tool to be used upon the action execution.

Available options are:

  • 7za: 7-Zip (Windows) or p7zip (Linux) - standalone

  • 7z: 7-Zip (Windows) or p7zip (Linux) - full

  • 7zz: 7-Zip (Linux) - full

  • 7zzs: 7-Zip (Linux) - standalone

  • 7-zip(custom path)

Archiver Path

Optional

-

Text

Custom path and file name for the archiver tool.

Required when Archiver Tool is configured for "7-zip(custom path)".

Source file

Required

-

Text

Path and file name of the file to compress or the archive to extract.

Archive

Optional

-

Text

Path and file name of the target archive file.

Default value will be Source File with the algorithm archive suffix.

Used when Action is configured for "Compress file".

File

Optional

-

Text

The file to be extracted.

If value is empty, then default extraction of the archive content.

Used when Action is configured for "Decompress file".

Zip Compression Level

Required

5 - Normal

Choice

The level of compression.

Available options are:

  • 1 - Fastest

  • 3 - Fast

  • 5 - Normal

  • 7 - Maximum

  • 9 - Ultra

Delete Original

Required

True

Boolean

Flag to configure for whether the Source File should be deleted at the end of compression.

Used when Action is configured for "Compress file".

Overwrite

Required

False

Boolean

Flag to specify the overwrite mode during extraction.

Used when Action is configured for "Decompress file".

Encryption

Required

None

Choice

The encryption algorithm for password protection of the archive.

Available options are:

  • None

  • AES-256

Password Credentials

Optional

-

Credentials

The password to be used for the compression or decompression.

Required when Encryption is configured for "AES-256".

Additional switches

Optional

-

Text

Specifies additional parameters to be passed to the archiver tool, separated by empty spaces.

Task Examples

Compress File with AES-256 Password Encryption

Example of Universal Task for compressing file with AES-256 password encryption.


Image Added


Decompress File with 7-zip(custom path) Archiver Tool

Example of Universal Task for decompressing file with 7zip(custom path) Archiver Tool.


Image Added

Task Output

Exit Codes

The exit codes for this Universal Extension are described in the following table.

Exit Code

Status Classification Code

Status Classification Description

Status Description

0

SUCCESS

Successful Execution

SUCCESS: Successful Task execution

1

FAIL

Failed Execution

FAIL: < Error Description >

11

FAIL

Warning (Non fatal error(s)).

For example, one or more files were locked by some other application, so they were not compressed.

FAIL: Warning

12

FAIL

Fatal error

FAIL: Fatal error

17

FAIL

Command line error

FAIL: Command line error

18

FAIL

Not enough memory for operation

FAIL: Not enough memory for operation

20

DATA_VALIDATION_ERROR

Bad input fields validation

DATA_VALIDATION_ERROR: Some of the input fields cannot be validated.

See STDERR for more details

255

FAIL

User stopped the process

FAIL: User stopped the process

Extension Output

The Extension Output for this Universal Extension is described below.

Code Block
languagetext
linenumberstrue
{
    "exit_code": 0,
    "status_description": "SUCCESS: Task executed successfully.",
    "changed": true,
    "invocation": {
        "extension": "1.0.0",
        "version": "ue-util-compress",
        "fields": {
            "action": "compress",
            "algorithm": "zip",
            "zip_compression_level": 5,
            "source_file": "/tests/test_file.txt",
            "archive": "/tests/test_archive.zip",
            "file": null,
            "overwrite": false,
            "encryption": "AES256",
            "credentials": "********",
            "delete_original": true,
            "archiver_tool": "7zz",
            "archiver_path": null,
            "additional_switches": ""
        }
    },
    "result": {
        "archive": {
            "archiver": "7-Zip (z) 21.06 (x64) ",
            "size_expanded": 1073741824,
            "size_compressed": 1260173
        }
    }
}


Document References

This document references the following documents:

Name

Location

Description

Universal Templates

https://docs.stonebranch.com/confluence/display/UC71x/Universal+Templates

User documentation for creating Universal Templates in the Universal Controller user interface.

Universal Tasks

https://docs.stonebranch.com/confluence/display/UC71x/Universal+Tasks

User documentation for creating Universal Tasks in the Universal Controller user interface.

7zip Official Page

https://www.7-zip.org/download.html

User documentation for downloading 7zip command line tool.