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.

Difference between revisions of "Accounting Portal API"

From EGIWiki
Jump to navigation Jump to search
Line 101: Line 101:
|HTC disciplines overview
|HTC disciplines overview
|-
|-
|/disciplines/cloud/
|[[Accounting_Portal_API_Function_Disciplines_Cloud | <code>/disciplines/cloud/</code>]]
|Cloud disciplines overview
|Cloud disciplines overview
|-
|-

Revision as of 11:47, 29 June 2017

Introduction

The EGI Accounting Portal Data Retrieval API is a REST interface that relies on HTTP commands that share the same channel as the normal user interface. The output can be selectable from CSV (comma separated value) or JSON (JavaScript Object Notation). Both can be readily adapted to whatever internal notation the consumer uses and have support in any relevant language or execution environment.

The basic premise of the API is to append a /csv/ or /json/ to existing URLs from the portal, this makes easy to first manipulate the user interface to get the desired information and then use the URL to get a data endpoint for it. This page will also cover how to change each of the URL components programmatically to achieve the same effect.

The Accounting Portal - technological choices

The Accounting Portal is an AJAX-based we application, but in contrast with many of them offers deep linking by changing the URL dynamically on user selection.

This functionality requires a reasonably recent browser, but since it already requires CORS for basic operation, this functionality is supported by all browsers with CORS already. [1][2]

The non-conforming browsers only represent 5% of the current user base (mostly Opera Mini for mobile phones). Any relevant browser from the last 5 years supports these functionalities.

Basic format of the Accounting Portal URLs

So, for example, to see the Total number of jobs by Operations Centre and Month for EGI Official VOs, we would use a simple URL with the portal WWW domain, a function, and a API-enabling data-selector that enables the API and selects

https://accounting.egi.eu/egi/JSON/ 

https://<-- Domain --->/<function>/<DS>/''

https://accounting.egi.eu/egi/CSV/ 

Using a URL with only the function and data selector selects default values for each of the selectable parameters in the interface, clicking the “Update” button will update the URL with all selected parameters.

The CPU Efficiency (%) by Resource Centre and Year for EGI Official VOs between June and July 2016 would be:

https://accounting.egi.eu/egi/cpueff/SITE/Year/2016/6/2016/7/egi/onlyinfrajobs/CSV/ 

https://<--- Domain --->/<function>/<query>/<RV>/<CV>/<Date>/<VO>/<Local>/<DS>/

https://accounting.egi.eu/egi/cpueff/SITE/Year/2016/6/2016/7/egi/onlyinfrajobs/JSON/ 

These URLs were obtained after selecting the relevant options in the web site, and then appended with '/CSV/' or '/JSON/' as required.

Each of the URL segments encodes one aspect, each of which will be covered in a section.

URL fragment Function
/egi/ Function selector, for some functions it would consist on several segments, encodig for example a certain Resource Centre, Country or Discipline.
/cpueff/ would be the selected metric.
/SITE/ ROW variable, in this case resource centre.
/Year/ COLUMN variable, in this case Year.
/2016/6/ Year and Month of the start date.
/2016/7/ Year and month of the ending date.
/egi/ for official VOs.
/onlyinfrajobs/ to filter out local jobs.
/CSV/ or /JSON/ to select the ouput format.

Functions

These URL fragments define the selected function and with it the data shown. Most of the functions work hierarchically, so from a function of the infrastructure we can navigate to a particular country and inside this a concrete site. The following table shows a list of valid path selectors:

Function Data shown
/report/resource_centres/ Resource Centre report
/report/disciplines/ Discipline report
/wlcg/report/tier2/ WLCG Tier2 Report
/wlcg/report/countries/ WLCG Countries Report
/wlcg/report/tier1/ WLCG Tier1 Report
/report/interngi/ InterNGI Report
/report/vomet/ VO activity report
/disciplines/htc/ HTC disciplines overview
/disciplines/cloud/ Cloud disciplines overview
/tier1/htc/ WLCG HTC Tier1 overview
/tier1/cloud/ WLCG Cloud Tier1 overview
/tier2/htc/ WLCG HTC Tier2 overview
/tier2/cloud/ WLCG Cloud Tier2 overview
/egi/htc/ EGI HTC
/egi/cloud/ Cloud Operations Centres (NGIs) Overview
/osg/htc/ OSG HTC overview
/osg/cloud/ OSG Cloud overview
/resource_centre_admin/htc/ Resource Centre Admin HTC
/resource_centre_admin/cloud/ Resource Centre Admin Cloud
/vo_admin/htc/ VO Admin HTC
/vo_admin/cloud/ VO Admin Cloud
/user/htc/ User Function HTC
/user/cloud/ User Function Cloud