Skip to main content

VSWMC Command-Line Tools

Project description

VSWMC Command-Line Interface

Install with pip:

pip install --upgrade vswmc-cli

This will install a vswmc command on your system. The vswmc command uses an S2P OAuth access token for authentication. Obtain the token outside the CLI, for example with the OAuth 2.0 Client Credentials flow described in the SSO migration guide, then provide it with one of:

VSWMC_ACCESS_TOKEN

    Read the access token from the environment.

--token TOKEN

    Read the access token from the command line.

--token-file FILE

    Read the access token from a file.

Example token request:

curl \
  -d 'client_id=<M2M_CLIENT_ID>' \
  -d 'client_secret=<M2M_CLIENT_SECRET>' \
  -d 'grant_type=client_credentials' \
  -d 'scope=<VSWMC_RESOURCE_SERVER_CLIENT_ID>' \
  'https://sso.s2p.esa.int/realms/swe/protocol/openid-connect/token'

Example CLI usage:

export VSWMC_ACCESS_TOKEN=<ACCESS_TOKEN>
vswmc simulations list

List available simulations

vswmc simulations list

This shows the parameters that a run requires.

Start a run

vswmc run [--param-file PARAM_FILE] [--param PARAM=VALUE ...] -- SIMULATION

This command returns the ID of the new run via stdout. You can use this ID to fetch the log or fetch result files.

OPTIONS

--param-file PARAM_FILE
Read parameters from a file.
--param PARAM=VALUE ...
Set parameters.

Each simulation supports different parameters. To know what parameters you need for a particular simulation, run:

vswmc simulations describe SIMULATION

List runs

vswmc ps [--simulation SIMULATION] [-a, --all]

OPTIONS

--simulation SIMULATION
Filter on simulation.
-a, --all
List all runs (default shows only ongoing)

Copy a result file to disk

vswmc cp SRC DST

Downloads a remote result file to local disk. The source should be specified in the format RUN:FILE. The DST argument can be a local file or directory.

Fetch the logs of a run

vswmc logs RUN

List the results of a run

vswmc ls [-l] RUN

OPTIONS

-l
Print long listing

Save all results of a run

vswmc save RUN

Saves all result files of a run. The results of each individual task in this run are compressed and saved into a zip archive named after the model for that task.

Stop one or more runs

vswmc stop RUN ...

Remove one or more runs

vswmc rm RUN ...

Create a product

vswmc products create [--metadata-file FILE] [--metadata PARAM=VALUE ...] [--attach FILE ...] -- PRODUCT_TYPE

OPTIONS

--param-file PARAM_FILE
Read parameters from a file.
--param PARAM=VALUE ...
Set parameters.
--attach FILE ...
Attach product files

EXAMPLE

vswmc products create --metadata test=123 --attach ../testdata/solar_wind_boundary.dat -- MHD0.1-1

Returns the ID of the created product.

Start a run using a product as input

vswmc run --param corona=6273ce7678eeb43c60d2eb8f \
          --param grid=test_light \
          --param cmes=examples/resources/cme_list.dat \
          -- euhforia-heliosphere-standalone

The corona parameter expects a product identifier.

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

vswmc_cli-2.2.3.dev423.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vswmc_cli-2.2.3.dev423-py2.py3-none-any.whl (19.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file vswmc_cli-2.2.3.dev423.tar.gz.

File metadata

  • Download URL: vswmc_cli-2.2.3.dev423.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for vswmc_cli-2.2.3.dev423.tar.gz
Algorithm Hash digest
SHA256 4acb9796acc08e53b15c5bcbb0b4acedd4a6c9ab828d3d6aa19e10742a0b550c
MD5 1ab12d607c5fb0bd338c23c294b17532
BLAKE2b-256 6646a1c30a853b408b4cef06929472f10bfef22fb6ea78f41edbaecf96fe873d

See more details on using hashes here.

File details

Details for the file vswmc_cli-2.2.3.dev423-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for vswmc_cli-2.2.3.dev423-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ac03dce6f3080d94edf908086a766181afd4e312532a43f467a292e68e66f8e2
MD5 c8871f3e1521909c2a9bac6dfb194f1b
BLAKE2b-256 f2dd536f8105273d2adaf07f52a3d9d6200cdf7a18d3ad34257a0cf0d36dffb4

See more details on using hashes here.

Supported by

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