API

Accessing the Configuration Database API

The GOCDB Programmatic Interface (PI) is available under /gocdbpi.

API components

The GOCDB PI has two main components:

The Read API provides programmatic access to the data. Access to some information (security/critical, personal details, otherwise sensitive information) is restricted, more details are available in the section about data protection levels.

The Write API provides limited functionality to add, update, and delete entities. Access is restricted, more details can be found in the section about authentication and authorisation.

Using the Read API

Querying

API calls can be tested in a browser or done from the command-line interface, using curl.

Below are some examples, including methods with different data protection levels.

API calls starting with https://goc.egi.eu/gocdbpi/private require the client to present a valid credential.

Extracting content

It is possible to filter content using xpath. Download information about endpoints under the EGI and FedCloud scopes as egi_fedcloud_service_endpoints.xml.

# Extracting endpoints in production
$ xpath -q -e "//SERVICE_ENDPOINT[IN_PRODUCTION='Y']/HOSTNAME/text()" \
    egi_fedcloud_service_endpoints.xml | sort | uniq

Using an X.509 client certificate to authenticate from the CLI

Querying information about a specific site using CURL, and authenticating with an X.509 client certificate.

$ curl -v --cert ~/.globus/usercert.pem --key ~/.globus/userkey.pem \
    'https://goc.egi.eu/gocdbpi/private/?method=get_site&sitename=CESGA'

Querying using python

Looking for FedCloud endpoints

See python script from cloud-info-provider repository.

Using the Write API

Examples of using the Write API can be found on the GOCDB PI site.