Consuming EMIR Service Endpoint Records (SER)

Every previously published Service Endpoint Records (SER) can be queried from the EMIR databases if user is allowed. The queries can be:

  • customized by setting up filter parameters
  • paginated
  • result format can be selected (JSON or XML)

To access the query method of the services interface HTTP GET or POST method have to be used. The services interface can be addressed usually on the http[s]://host.domain:port/services URL.

All of the stored attributes can be used as a filter. The list of allowed values can be found on the EMIR Service Endpoint Record Description wiki page.

The filters has to sent as GET parameter key-value pairs or as POST where more complex query expression can be defined.

The result format is defined by the Accept HTTP header. If non of this headers is present, then JSON will be sent.

Example usage:

curl -v -H "Accept:application/xml" -X GET http://host.domain:port/services?Service_Endpoint_ID=<MyServiceID>
curl -v -H "Accept:application/json" -X GET http://host.domain:port/services?Service_Endpoint_ID=<MyServiceID>

EMIR uses pagination to iterate through the endpoints listing, in response to the query. The pagination is by default turned-on, this is mainly due to avoid the memory overflow errors on the server side or/and delays while rendering large number of endpoints on the client's browser. Hence if the endpoints listing (yield from the query) exceeds the maximum threshold - set to 100, the total number of results would be divided into a number of pages. They can be accessed while passing a reference which is being provided in the current result page. Following example shows such traversal from one result page to the other.

Query sent to the EMIR server

 GET http://emir-url/services 

Response from the server (XML)

<ns2:QueryResult xmlns="" xmlns:ns2="" count="100" ref="50d090b12033e6f03f3f1376">

Response from the server (JSON)

 {"ref": "50d090b12033e6f03f3f1376"}

Now accessing the next result page:

 GET http://emir-url/services?ref=50d090b12033e6f03f3f1376 (same as being provided in the above response - regardless of the format) 

NOTE: The reference will not be shown if the query result size is within the bounds of the threshold value.

In case if the client does not require auto-pagination, all the results can be viewed by adding the pageSize http parameter to the url.

 GET http://emir-url/services?pageSize=10000 

More examples:

Example usage:

curl -v -H "Accept:application/json" -X GET http://host.domain:port/services?Service_Type=<MyServiceType>&pageSize=10

Example usage in case of client-side authentication with curl:

curl -v -H "Accept:application/json" -X GET https://host.domain:port/services -k --cert /path/client.pem:pass --key /path/key.pem
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2013-01-23 - AhmedShirazMemonExCern
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    EMI All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback