Table of Contents

Back to JESS API

Get ESO Report Variable Index


Use GET /eso/<job_ID>/<file name> or GET /eso/<job_ID>/<case_name>/<file name> to retrieve the list of report variables in an ESO or a MTR file


Synopsis

Return object

A successful /eso transaction returns an object containing all the variables in the ESO/MTR file in a tree structure containing three different sorting orders. An abbreviated example is shown below.

{
    "inProgress": true,
    "varTrees": [
        {
            "state": null,
            "id": null,
            "li_attr": null,
            "a_attr": null,
            "type": "ESORoot",
            "text": "All output variables",
            "data": null,
            "children": [
                {
                    "state": null,
                    "id": null,
                    "li_attr": null,
                    "a_attr": null,
                    "type": "Frequency",
                    "text": "Monthly",
                    "data": null,
                    "children": [
                        {
                            "state": null,
                            "id": null,
                            "li_attr": null,
                            "a_attr": null,
                            "type": "Domain",
                            "text": "Meter",
                            "data": null,
                            "children": [
                                {
                                    "state": null,
                                    "id": null,
                                    "li_attr": null,
                                    "a_attr": null,
                                    "type": "Variable",
                                    "text": "Electricity:Facility",
                                    "data": {
                                        "varId": "12",
                                        "unit": "J",
                                        "freq": "Monthly"
                                    },
                                    "children": []
                                },
                                {
                                    "state": null,
                                    "id": null,
                                    "li_attr": null,
                                    "a_attr": null,
                                    "type": "Variable",
                                    "text": "Electricity:Building",
                                    "data": {
                                        "varId": "24",
                                        "unit": "J",
                                        "freq": "Monthly"
                                    },
                                    "children": []
                                },
                                ...
                            ]
                        }
                    ]
                },
                ...
            ]
        }
    ],
    "runPeriods": [
        {
            "timeZone": 0.0,
            "values": [
                "RUN PERIOD 1",
                "51.15",
                "-0.18",
                "0.00",
                "62.00"
            ],
            "title": "RUN PERIOD 1",
            "elevation": 62.0,
            "latitude": 51.15,
            "longitude": -0.18,
            "dictItemID": 1
        }
    ],
    "treeNames": [
        "Frequency->Domain->Variable",
        "Frequency->Variable->Domain",
        "Domain->Variable->Frequency"
    ],
    "annualData": null
}

Example using curl://

Send the /eso command using curl:

curl -b cookies https://api.ensims.com/jess_web/api/eso/12251/eplusout.mtr

or if it is a jEPlus project,

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

On success, the variable trees 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/eso/12251/eplusout.mtr', cookies=cookies)

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

# Show returned object  
r.json()