Alert.png The wiki is deprecated and due to be decommissioned by the end of September 2022.
The content is being migrated to other supports, new updates will be ignored and lost.
If needed you can get in touch with EGI SDIS team using operations @ egi.eu.

EGI Federated Cloud jOCCI APIs

From EGIWiki
Jump to navigation Jump to search
Overview For users For resource providers Infrastructure status Site-specific configuration Architecture




EGI Federated Cloud jOCCI APIs

Introduction

The wiki is intended for programmers who work in/with scientific communities and want to port or develop new tools and services (PaaS solutions, Orchestrators, etc.) for scientific user communities on top of the EGI Federated Cloud.

Before to start

This wiki assumes that you have:

  • Obtained a trusted X.509 digital certificate,
  • Subscribed the fedcloud.egi.eu VO. If you are member of another VO that has access to cloud resources, you may use that VO
  • Created a valid proxy certificate starting from your X.509 digital certificate

If you do NOT have a personal X.509 digital certificate, please follow the instructions reported in this documentation: how to get access the EGI Federated Cloud infrastructure.

The EGI FedCloud Clients image is a VM image based on Ubuntu 14.04 LTS which includes:

  1. voms clients with the fedcloud.egi.eu (and other cloud VOs) preconfigured,
  2. rOCCI-cli tool,
  3. additional libraries,
  4. Java SDK 7+,
  5. Maven compiler.

Source codes & Java Docs

jOCCI-api is a Java library implementing transport functions for rendered OCCI (Open Cloud Computing Interface) queries. It is built on top of jOCCI-core and currently provides HTTP transport functionality with set of authentication methods and basic requesting interface to easily communicate with OCCI servers. Official jOCCI APIs can be found on GitHub repositories and on Maven central.

The repository with Java exercises to use the EGI Federated Cloud infrastructure with jOCCI APIs can be found on github

Java Docs are available at:

  • egi-fctf.github.io/jOCCI-core/apidocs/index.html
  • egi-fctf.github.io/jOCCI-api/apidocs/index.html

Installing source codes

Download from github the repository with the source codes and instructions to interact with the EGI FedCloud infrastructure with jOCCI APIs

]$ git clone https://github.com/EGI-FCTF/di4r-training
Cloning into 'di4r-training'...
remote: Counting objects: 595, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 595 (delta 8), reused 0 (delta 0), pack-reused 545
Receiving objects: 100% (595/595), 4.14 MiB | 1.25 MiB/s, done.
Resolving deltas: 100% (233/233), done.
]$ tree -L 1 di4r-training/
di4r-training/
|-- Api-VOMS-CANL
|-- LICENSE
|-- README.md
|-- checkIP
|-- jEGIAppDB
|-- jOCCI-attach-resources
|-- jOCCI-create-resources
|-- jOCCI-delete-resources
|-- jOCCI-describe-resources
|-- jOCCI-dump-model
|-- jOCCI-list-resources
`-- pyEGIAppDB
10 directories, 2 files

Exercise 1 - Querying the EGI Application Database

Introduction

In this exercise REST technology will be used to get the list of certified cloud providers from the EGI Application Database. The API is located at http://appdb-pi.egi.eu and it allows information retrieval and modification from third party applications without having to reside on the rich user interface of the AppDB portal.

  1. The base URI of the REST API is http://appdb-pi.egi.eu/rest/1.0/
  2. Requests must be followed by at least a resource name which may be followed by one or more sub-resource names separated by slashes, as in the examples given bellow:
  • Get the list of scientific applications from the EGI AppDB:

- http://appdb-pi.egi.eu/rest/1.0/applications/

  • Get the list of available cloud providers:

- http://appdb-pi.egi.eu/rest/1.0/va_providers/

  • Get info about the provider having ID=8253G0:

- http://appdb-pi.egi.eu/rest/1.0/va_providers/8253G0

Usage

  • Access the maven project
]$ cd di4r-training/jEGIAppDB/
  • Edit the source code in `src/main/java/it/infn/ct/jEGIAppDB.java` to use your preferred VO: