1. Home
  2. Command Line Client
  3. Cloud FastPath Command Line Client

Cloud FastPath Command Line Client

About the CFP Command Line Client

The CFP Command Line Client enables you to run CFP operations in a command line interface outside of the API using Python, and you can use Javascript as well.

Installing CFP Command Line Client

1: If tar is not installed, download Github for Windows (GOW) or equivalent.

2: We support Python 3. If Python is not installed, download and install it.  Python is available as a free download at https://www.python.org/downloads/. Install for all users in the default C:/Python directory. Note that the system version of Python on MacOS will not work with cfpclient. CFPclient requires TLS 1.2 for the API and this is not available on MacOS.

3: Ensure that the Python request module is installed:

C:\Users\tvabuild>c:\Python27\Scripts\pip install requests future

4: Download the CFP Command Line Client. Unpack the tarball and run it:

C:\Users\tvabuild\Downloads>tar xvfz cfp_cli-91030.tar.gz
...
C:\Users\tvabuild\Downloads>cd cfp_cli-91030
C:\Users\tvabuild\Downloads\cfp_cli-91030>python cfp config
CFP Hostname [www.cloudfastpath.com]:
...

5: After you have successfully started the cfp config, it will prompt you for a CFP Hostname.  Enter the root domain for your Cloud FastPath registration, which is usually www.cloudfastpath.com.

6: At the CFP Username and Password prompts, enter your Cloud FastPath username and password.

7: At the CFP Rest API version [v1] prompt, enter v1.

8: At the CFP CA Certificate prompt, enter None.

9: Your configuration is complete.

CFP Command Line Client Commands

A listing of CFP commands is available by entering:
python cfp help
NOTE:  Do not run these commands on a runtime, active system unless you are fully familiar with them or are instructed to do so by Tervela Technical Support.

General Information

When you run python cfp help, it will list several subcommands:

SUBCOMMAND DESCRIPTION
accounts CFP commands for account management
config CFP tool configuration management (arguments > environment > config file ~/.cfp-config).  This file primarily contains the hostname, client ID and other information you entered when you started your CFP Command Line session.
events Events are the messages that report to the Event Log, primarily during running jobs.
files Files commands are primarily useful for account mapping – such as downloading a mapping file from a job instance prior to the current one.
gateways Gateways are the actual connections established between POPs, represented by the green lines between the POP circles in the CFP dashboard.  Most POPs have two gateways, one inbound and one outbound.
jobhistory Job History provides a way to access the many statistics that can be extracted from CFP data transfer jobs.
jobs CFP commands for job management.  Jobs are what CFP uses to specify data transfers.
jobsched The Job Scheduler enables users to start jobs on time or event.  The CFP jobsched commands enable you to list details about the configuration and operation of the Job Scheduler.
keys CFP Key management commands
nodes CFP commands for node management. Every Job has a data source and target, and each source or target is a node. That node contains a system plus additional information, such as a filename, database table name, or tokens for the data transfer.
pops CFP commands for Point-of-Presence (POP) management. POPs are the objects in CFP that represent the servers involved in data transfers.
schemas CFP commands for retrieving object models/schemas.  Schemas are primarily used for support purposes only.
systems Systems represent the adapters that connect to your sources and targets.  Systems commands enable you to list these systems, view and edit their statuses.

You may run help on any subcommand by entering:
python cfp help <subcommand>
Example: to get help on the options available for POPs you would enter:
python cfp help pops
Generally, syntax for commands follows the pattern:
python cfp [subcommand] [argument1] [argument2]
Example:  to get the details on a specific gateway that has an id of 53ea39aec1e9c613b16beb80, you would enter the following command:
python cfp gateways --get --id 53ea39aec1e9c613b16beb80 --details
Use the --list argument to find IDs for CFP subcommands; additional information on the --list argument is immediately below.

Finding IDs with the --list command

The Command Line Client accesses POPs, Systems, Jobs and Nodes by their unique IDs.  You can list the IDs for any of these subcommands by using the –list command.  To list all of your systems, for example, you would enter python cfp systems --list to generate a table of all systems in your CFP installation, along with the IDs of the system’s parent POPs:

Invoking CFP Tasks

You can invoke many of the CFP tasks that can be done in the API, such as POP, System and Job creation, modification, and deletion.  Most transactions are run by the object’s ID number.

Example:  to run a job whose ID is 53c68eacbc1ea508fc39ef98, you would enter:
python cfp jobs --start --id 53c68eacbc1ea508fc39ef98
If you go back into the CFP API, the Events Log in the dashboard will list a record of the job starting.

Editing Cloud FastPath Configuration From the Command Line Client

You can also use the Command Line Client to add or edit fields in CFP elements such as Systems and Jobs. Use the example below as a template for your configuration.

NOTE: Error checking for bad configuration is limited in the Command Line Client. Incorrect parameters may lead to unexpected results in the graphical user interface (GUI) and elsewhere.

Example: Here is what the configuration looks like in the CFP GUI for an Amazon S3 system:

We’ll edit the Bucket field for this system, which is circled above, from the command line. First, find the system’s ID as described above on this page. In this example, the ID for our S3 system is 543d1c0bbc1ea573ae3e9b74. The next step is to find out the name that CFP uses for the bucket field. We’ll print out the system’s full configuration with this command:
python cfp systems --id 543d1c0bbc1ea573ae3e9b74 --get --details
You’ll get the full schema for the S3 system:

You’ll see the system’s field names and their values listed.

NOTE: The information printed out in the fields section of the system’s configuration (the third item in the list, below access_keyand name) is meta data for the system, which can be ignored for this exercise. The location of the bucket field is circled.

Looking at this schema, the name of the Bucket field is bucket and its value is bn_bucket2. To change this field to bn_bucket3, enter:
python cfp systems --id 543d1c0bbc1ea573ae3e9b74 --update --fields "bucket"="bn_bucket3"
You will receive notification that your system has been updated successfully.

Updated on April 15, 2020

Related Articles