Introduction

The IDS APIs provides easy access from Java and Python to a deployed ICAT Data Service (IDS) Files may be uploaded, downloaded and deleted from the IDS. When a file is uploaded or deleted the action is recorded in ICAT as a new or deleted Datafile. ICAT authorization rules are used to assign the same rights to access the data as those granted to the metadata.

Installation and accessing from maven is explained in Client Installation.

Setting Up

Create an IDSClient instance passing it the URL of the machine providing the service. Irrespective of language, <hostname> as used in the code snippets below should be the full name of the IDS server. For a secure installation, just specifying localhost will not work, the name must match what is on the host certificate.

From Java

URL url = new URL("https://<hostname>:8181")
client = new IdsClient(url);

From Python

import ids

url = "https://<hostname>:8181"
client = ids.IdsClient(url)

Using it

Most calls to the IDS require an ICAT sessionId so first log in to ICAT to get a sessionId.

Please consult the javadoc for a full explanation of what all the calls do for Java. The python documentation is available in the usual way. Just enter pydoc ids from the command line.

It should be noted that the Java and Python apis are different in style. The python has retained the Java style method names but getData has been split into two calls: getData and getPreparedData. The DataSelection object in the Java calls is replaced by optional named lists of ids.