Skip to main content

EGI Command Line Interface

Project description

EGI CLI: A command line for EGI Federation

egicli is a simple command line interface for interacting with some of the services of EGI. It simplifies the discovery of endpoints and provides users with the configuration for other 3rd party tools (e.g. OpenStack clients)

We are focusing on the EGI Cloud service, but other services may be supported in the future


Python package

Just use pip (probably better on a virtualenv):

pip install egicli

Make sure that your environment has the EGI CAs properly installed and configured for python:

If you don’t have the CA certificates installed in your machine, you can get them from the UMD EGI core Trust Anchor Distribution

Once installed, get the location of the requests CA bundle with:

python -m requests.certs

If the output of that command is /etc/ssl/certs/ca-certificates.crt, you can add EGI CAs by executing:

cd /usr/local/share/ca-certificates
for f in /etc/grid-security/certificates/*.pem ; do ln -s $f $(basename $f .pem).crt; done

If the output is /etc/pki/tls/certs/ca-bundle.crt add the EGI CAs with:

cd /etc/pki/ca-trust/source/anchors
ln -s /etc/grid-security/certificates/*.pem .
update-ca-trust extract

Otherwise, you are using internal requests bundle, which can be augmented with the EGI CAs with:

cat /etc/grid-security/certificates/*.pem >> $(python -m requests.certs)


You can use the eglicli container instead of installing it locally:

docker pull egifoundation/egicli


The egicli has a --help option that should guide you through the different options. Below you can find some more information about the commands.

Some options take their default values from environment variables if defined:

  • CHECKIN_CLIENT_ID for --checkin-client-id
  • CHECKIN_CLIENT_SECRET for --checkin-client-secret
  • CHECKIN_REFRESH_TOKEN for --checkin-refresh-token
  • EGI_SITE for --site


egicli token refresh --help
Usage: egicli token refresh [OPTIONS]

  --checkin-client-id TEXT      Check-in client id  [required]
  --checkin-client-secret TEXT  Check-in client secret  [required]
  --checkin-refresh-token TEXT  Check-in client id  [required]
  --checkin-url TEXT            Check-in OIDC URL  [required]
  --list-vos / --no-list-vos    List user VOs
  --help                        Show this message and exit.

Gets a refreshed access token from Check-in. You can get the id, secret and refresh token from the Fedcloud Check-in client

If --list-vos option is specified, the entitlements related to VOs will be also displayed.

$ egicli token refresh
Field          Value
-------------  -----------------------------------------------------
access_token   eyJraWQiOiJvaWRjIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI...
token_type     Bearer
refresh_token  eyJhbGciOiJub25lIn0.eyJle5AiOjE2MDd4MTcxNTtsImp0....
expires_in     3599
scope          openid profile email
id_token       eyJraWQiOiJvaWRjIiwiYWxnIjoiUlMyNTYifQ.eyJ7dWIiO....

endpoint list

Lists the endpoints in GOCDB matching a given service type.

$ egicli endpoint list --help
Usage: egicli endpoint list [OPTIONS]

  --service-type TEXT             Service type in GOCDB
  --production / --not-producton  Production status
  --monitored / --not-monitored   Monitoring status
  --site TEXT                     Name of the site
  --help                          Show this message and exit.

List all OpenStack sites:

$ egicli endpoint list
Site                type                URL
------------------  ------------------  ------------------------------------------------
IFCA-LCG2           org.openstack.nova
IN2P3-IRES          org.openstack.nova
UA-BITP             org.openstack.nova
RECAS-BARI          org.openstack.nova
NCG-INGRID-PT       org.openstack.nova
CLOUDIFIN           org.openstack.nova
IISAS-GPUCloud      org.openstack.nova
IISAS-FedCloud      org.openstack.nova
UNIV-LILLE          org.openstack.nova
INFN-PADOVA-STACK   org.openstack.nova
CYFRONET-CLOUD      org.openstack.nova
SCAI                org.openstack.nova
CESNET-MCC          org.openstack.nova
INFN-CATANIA-STACK  org.openstack.nova
CESGA               org.openstack.nova
100IT               org.openstack.nova

List OCCI endpoints at CESGA:

$ egicli endpoint list --service-type '' --site CESGA
Site    type                             URL
------  -------------------------------  ----------------------------------------------------------------------

endpoint projects

List the projects accessible for a given endpoint

egicli endpoint projects --help
Usage: egicli endpoint projects [OPTIONS]

  --checkin-client-id TEXT      Check-in client id  [required]
  --checkin-client-secret TEXT  Check-in client secret  [required]
  --checkin-refresh-token TEXT  Check-in client id  [required]
  --checkin-url TEXT            Check-in OIDC URL  [required]
  --site TEXT                   Name of the site
  --help                        Show this message and exit.

List of projects for CESNET-MCC site:

$ egicli endpoint projects --site CESNET-MCC
id                                Name                  enabled    site
--------------------------------  --------------------  ---------  ----------
081396a827c94f3da0c922cf6d8fb7f7       True       CESNET-MCC
0aa5b696969c42988b18beda3f85b885  dteam                 True       CESNET-MCC
10b972eed97940089b234f6257d7db72  True       CESNET-MCC
24869cfe0e094f59a3110429e068eef2           True       CESNET-MCC
50fc58ed66a14106b40b9c6d7d9af86c      True       CESNET-MCC
5bc62d60bbbc49d881bc0a948da710d6       True       CESNET-MCC
d868dfd63a674d94bbd9d9b7b54443e3             True       CESNET-MCC
eae2aa7f26334104906106bca4b82ae3       True       CESNET-MCC

endpoint token

Gets a valid Keystone token for a given site and project.

$ egicli endpoint token --site CESNET-MCC --project-id 0aa5b696969c42988b18beda3f85b885
export OS_TOKEN="gAAAAABd5luMQudxBj8r5..."

endpoint env

Gets the environmet for using a given site with OpenStack cli

$ egicli endpoint env --site CESNET-MCC --project-id 0aa5b696969c42988b18beda3f85b885
# environment for CESNET-MCC
export OS_AUTH_URL=""
export OS_AUTH_TYPE="v3oidcaccesstoken"
export OS_PROTOCOL="openid"
export OS_ACCESS_TOKEN="eyJraWQiOiJ..."
export OS_PROJECT_ID="0aa5b696969c42988b18beda3f85b885"

Project details

Download files

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

Files for egicli, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size egicli-0.1.1-py3-none-any.whl (10.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size egicli-0.1.1.tar.gz (18.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page