Examples of use

With a Web browser

  1. Access the URL https://tsmlabapi.in2p3.fr with your browser and check the SSL certificate presented by the website before entering your credentials.

  2. Enter the identifiers that you received from CC-IN2P3 backup service administrators.

The Web interface that is currently displayed is only the result of a basic rendering made by your Web browser of the XML document returned by the API.

With a command line interface

The tool that will be used as an example is cURL. The options that will be used in the following examples are:

  • -H "Accept: application/json" that allows to add the HTTP header Accept: application/json to the request,

  • -u "username:password" that allows to authenticate to the Web server with the login “username” and the password “password”,

  • -L that tells cURL to follow the HTTP redirections.

Example of data retrieval in JSON format

% curl -L -H 'Accept: application/json' -u 'username:password' https://tsmlabapi.in2p3.fr
output
{
    "details": {
        "generated_in": "0.66ms",
        "last_cache_update": 1406551433
    },
    "results": [
        {
            "laboratory": "CCIN2P3",
            "nodes": [
                {
                    "contacts": [
                        "no-reply@cc.in2p3.fr"
                    ],
                    "days_since_last_access": "<1",
                    "filespaces": [
                        {
                            "filespace_name": "/backup/volume1",
                            "num_files": 6,
                            "physical_b": 21
                        },
                        {
                            "filespace_name": "/backup/volume2",
                            "num_files": 6,
                            "physical_b": 21
                        }
                    ],
                    "last_access": 1406524790,
                    "node_name": "DEMO_NODE",
                    "total": {
                        "num_files": 12,
                        "physical_b": 42
                    }
                }
            ],
            "total": {
                "nodes": 1,
                "num_files": 12,
                "physical_b": 42
            }
        }
    ]
}

Note

The output of this command was formatted with curl | python -mjson.tool.