Versions Compared

Key

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

...

Client Python Interface

The functionality provided by ecflow_client is also available via the Client Server API.
The python interface uses the same algorithm for determining the host and port,
and allows the host and port to be set explicitly. See class ecflow.Client
This is shown by the following python example:
#!/usr/bin/env python2.7
import ecflow
   
try:
    # When no arguments specified uses ECF_NODE and/or ECF_PORT,
    # otherwise defaults to localhost:3141
    ci = ecflow.Client()
    ci.ping()

    # Explicitly set host and port using the same client
    # For alternative argument list see ecflow.Client.set_host_port() 
    ci.set_host_port("machineX:4141")
    ci.ping()
        
    # Create a new client, Explicitly setting host and port.
    # For alternative argument list see ecflow.Client
    ci = ecflow.Client("oetzi:3444")  
    ci.ping()  
           
except RuntimeError as e:
    print "ping failed: " + str(e); 

What to do

If your ecflow_server was started with ecfecflow_start.sh and you want to use the shell
interface, then set ECF_NODE and ECF_PORT environment variables.
It should be noted that, if the server was started with ecf ecflow_start.sh script
then the default “localhost:3141” will be incorrect. If the server was started
on your local machine, use netstat to determine the port number.

 

Code Block
languagebash
 netstat -lnptu
Horizontal Navigation Bar
Button Group

Button Hyperlink
titlePrevious
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/Checking+job+creation
Button Hyperlink
titleUp
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/Tutorial
Button Hyperlink
titleNext
typestandard
urlhttps://software.ecmwf.int/wiki/display/ECFLOW/Load+the+file

 

...