Understanding the client

There are multiple ways to communicate with an ecflow_server, including using CLI (Command Line Interface) ecflow_client, programmatically via the Python API or using the GUI (Graphical User Interface) ecflow_ui.

For any kink of communication with the server, since there can be multiple servers running in parallel on the same machine, the client needs to know the machine host name and port to access the server.

This section shows how to contact the server using the CLI client and via the Python API.

To configure the client (CLI and Python API) to contact a server on the given host and port consider the following:

  • The default host:port is localhost:3141.

  • These defaults are overridden by setting the environment variables: ECF_HOST and ECF_PORT.

  • The explicitly defined options --port and --host will always be used whenever provided.

The ecflow_client is a command line tool that allows sending commands to the ecflow_server, and retrieving information about the current state of the elements that compose the suite definition.

A list of available commands, including their options, can be found by using the --help option:

ecflow_client --help

ecflow_client --help child  # to list the task (child) commands
ecflow_client --help user   # to list the user commands

ecflow_client --help init   # get details of the init (child) command
ecflow_client --help load   # get details of the load (user) command

To assess the connectivity to a server, explicitly define the --port and --host options, and use the --ping command:

Listing 7 Ping an ecFlow server using the Python API
ecflow_client --host machinex --port 4141  --ping

What to do

  1. List the available commands of ecflow_client using the --help option.

  2. Take the opportunity to learn about the different command categories (e.g. child commands, user commands).

    • Use the --help option with the ecflow_client to explore the available command categories.

  3. Take the opportunity to learn about the following commands: ping, load, replace, begin, and resume.

    • Use the --help option with the ecflow_client to explore the command descriptions.

  4. Ping the ecflow_server using the CLI ecflow_client, explicitly defining the --host and --port options.

  5. Ping the ecflow_server using the CLI ecflow_client, exporting environment variables ECF_HOST and ECF_PORT.