Information Services Access Using WS/REST

From TeraGrid Wiki

Jump to: navigation, search

Introduction

TeraGrid REST Information Services interfaces provide simple HTTP GET access to information services content.

The REST interfaces can return information in HTML format suitable exploring with web browsers,
and in CSV, JSON, Perl, and XML formats suitable for applications needing live information access.

The REST interfaces are designed to be high-performance, scalable, and reliable so that application
can use them for dynamic information access and expect sub-second (typically ~0.5 second) response.

Access

To browse these interfaces go to the main information services page http://info.teragrid.org/
and click on the "View Content" section's "Web Applications (web-apps)" item.

You will be directed to http://info.teragrid.org/web-apps/html/index/.
This page is an index of all the REST interface applications, where each application provides access
to different subsets of information services content.

If you click on the CSV, JSON, PERL, and XML buttons along the top right of the page you will see the
information from the page you are browsing in an alternate format.

Note that the URL for alternate formats is built by replacing the "html" substring in the browsed URL
with one of the following alternate format substrings: "CSV", "JSON", "PERL", or "XML".

From this web-apps index page you can click on the "Usage" link to the right of each application
to browse information on all the URLs each web-app understands and supports.
By HTTP get'ing any of these URLs applications can retrieve selected subsets of information.

Example

For example, the kit-services-v1 web-apps usage information lists this URL

http://info.teragrid.org/web-apps/html/kit-services-v1/type/$Type/

so for example you can point your browser at

http://info.teragrid.org/web-apps/html/kit-services-v1/type/wg-gram/

to browse all the TeraGrid's ws-gram services as an HTML page,

You can code your application to HTTP get the same URL but replace the "html" with "json" and get the same (or more) information in JSON format.

http://info.teragrid.org/web-apps/json/kit-services-v1/type/wg-gram/

Note that the HTML rendering doesn't always include all of the data that is returned in CSV, JSON, PERL, and XML.
This is because the HTML rendering is designed for exploring with a browser and not for complete information access from an application.

Personal tools