Back to JESS API

Get IDF Tree


Use GET /idf/<job_ID>/<file name> or GET /idf/<job_ID>/<case_name>/<file name> to retrieve the IDF model object index in a tree form


Synopsis

Return object

A successful /idf transaction returns an object containing all objects' references in the ESO/MTR file in a tree structure. Please note that this JSON object is not the EPJSON format of the model. An abbreviated example is shown below.

{
    "state": {
        "disabled": false,
        "opened": true,
        "selected": false
    },
    "id": "root",
    "li_attr": null,
    "a_attr": {
        "rel": "",
        "data-toggle": "tooltip",
        "data-html": true,
        "data-title": "Loaded from <i>C:\\data\\jobs\\jess\\TestUser\\12251\\output\\stdjob\\.\\in.idf</i>"
    },
    "type": "IDFRoot",
    "text": "IDF model (v9.3.0)",
    "data": null,
    "children": [
        {
            "state": null,
            "id": "simulation_parameters",
            "li_attr": null,
            "a_attr": null,
            "type": "Group",
            "text": "Simulation Parameters[7]",
            "data": null,
            "children": [
                {
                    "state": null,
                    "id": "version",
                    "li_attr": null,
                    "a_attr": null,
                    "type": "ObjectType",
                    "text": "Version[1]",
                    "data": null,
                    "children": [
                        {
                            "state": null,
                            "id": "Version_0",
                            "li_attr": null,
                            "a_attr": null,
                            "type": "Object",
                            "text": "=>9.3",
                            "data": null,
                            "children": []
                        }
                    ]
                },
                ...
                ...
            ]
        }
    ]
}

Example using curl://

Send the /idf command using curl:

curl -b cookies https://api.ensims.com/jess_web/api/idf/12251/in.idf

or if it is a jEPlus project,

curl -b cookies https://api.ensims.com/jess_web/api/idf/12264/EP_0-T_0-W_0-P1_5-P2_0-P3_0-P4_0/in.idf

On success, the object tree will be returned in a JSON object. If the requested file does not exist, an HTTP 404 Not Found error will be returned. If the job is not accessible to the current user, or the existing JWT is invalid, an HTTP 401 Unauthorized code will be returned.

Example using Python Requests

Make sure Requests is correctly installed in your Python environment, and run the following lines:

import requests

# Existing cookies are expected to be stored in the variable 'cookies'
r = requests.get('https://api.ensims.com/jess_web/api/idf/12251/in.idf', cookies=cookies)

# Or if it is a jEPlus project
r = requests.get('https://api.ensims.com/jess_web/api/idf/12264/EP_0-T_0-W_0-P1_5-P2_0-P3_0-P4_0/in.idf', cookies=cookies)

# Show returned object  
r.json()