Skip to main content

CLI for interacting with the timer API

Project description

Globus Automate Timer CLI

This is an alpha-version CLI for use with the (also in alpha) timer API, to use primarily for scheduling recurring transfer tasks through Globus Automate.

What is this Service/CLI for?

The timer service can be used to schedule recurring transfer tasks. For example, let’s say we want to have a transfer automatically run every night to back up data. We submit a job to the timer API starting tonight, and with an interval of 1 day at which it will be re-run. In that request we provide the timer service the same input we would give to the transfer action provider; that part of the request contains the information for what endpoints we transfer to and from as well as other options relevant to the transfer.

Basic Usage

Install with pip install globus-timer-cli.

To summarize, the CLI can be used for the following tasks:

  • Schedule a new recurring job: globus-timer job submit ...
  • Check the list of previously-submitted jobs: globus-timer job list
  • Check on the status of a particular job: globus-timer job status JOB_ID
  • Show help for any of the above commands with globus-timer job submit --help etc.

As an example, a complete command would look something like this:

globus-timer job submit \
    --name test-tutorial-job \
    --interval 600 \
    --action-url https://actions.automate.globus.org/transfer/transfer/run \
    --action-body '{"body": {"source_endpoint_id": "ddb59aef-6d04-11e5-ba46-22000b92c6ec", "destination_endpoint_id": "ddb59af0-6d04-11e5-ba46-22000b92c6ec", "transfer_items": [{"source_path": "/~/file1.txt", "destination_path": "/~/new_file1.txt"}]}}'

Each command should be reasonably informative as to what arguments are required, and what type of input is expected for those arguments. However, do note that the action-body depends on the schema expected for that action provider, which isn't known by the CLI. You can use the Globus Automate client to introspect the input schema for an action provider, which is what the CLI needs for the --action-body parameter.

To schedule transfers on your behalf, this CLI requires authentication through Globus Auth. The CLI should initially prompt you with a Globus Auth page to consent to this usage. Authentication information is cached in the file $HOME/.config/globus/tokens.json (so the authentication process is only needed on the first use), which should be kept secret.

How Does it Work?

Internally, the service is using an algorithm similar to the unix utility cron. The service will operate under the following guarantees:

  • A job will not run more frequently than the specified interval.
  • The time that a job starts may skew slightly depending on load (likely on the order of fractions of a second to individual seconds), but does not skew further over time. For example, suppose that your job is meant to run every 10 seconds, but the scheduler is under unusually heavy load each time, and your job runs 1 second later than scheduled. It would not be possible for the job to run at 11, 22, 33, … rather it runs at 11, 21, 31, …
  • Jobs are "soft-deleted," meaning they are removed from the scheduler but not the database, so the outputs of previous runs are still available. The results of the previous 10 runs are exposed in the API wherever the job is returned.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

globus-timer-cli-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

globus_timer_cli-0.1.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file globus-timer-cli-0.1.1.tar.gz.

File metadata

  • Download URL: globus-timer-cli-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.4.0-42-generic

File hashes

Hashes for globus-timer-cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e6fcaf83767ab9a172fa64d3e3126b9c4a86b4f0b7ac5f208f283b7898be7861
MD5 14e2b0e4235d9c305f3597e2f2c9383a
BLAKE2b-256 f271139c08e6e1d607b6f7a2e851aa01dab72cbe56179241af31b63cc6dfe924

See more details on using hashes here.

Provenance

File details

Details for the file globus_timer_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: globus_timer_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.4.0-42-generic

File hashes

Hashes for globus_timer_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7494c9baee612367860e18a0651596955e3fec38cd2d5865146db983440385da
MD5 e68db266d16c8f326947c16217470932
BLAKE2b-256 c0cd6c36da6bfd7b07ad521713b8051b54ea4efa4ac6e9ba6c85e3077b92444d

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page