JSON

Last updated on 22nd April 2024

Enabling JSON Output

The Simudyne SDK will not export files to JSON by default. To enable, set the value of the config field core.json-export.enabled in the simudyneSDK.properties file to true. (More about Model Config.)

The path to create the JSON files in should be provided in the config field core.export-path. This can be an HDFS path, or a local file system path. If no value is specified for core.export-path, the JSON files will be dumped to a tmp directory, or the HDFS home if running with spark.

The resulting files will appear in the following format of an array with a series of JSON objects for each entry with id/tick/timestamp info appended:

[
	{"equity":1000000000,"_id":200,"tick":0,"time":"2018-01-01T00:00Z"},
	{"equity":1000057393,"_id":200,"tick":1,"time":"2018-02-01T00:00Z"},
	{"equity":1000115260,"_id":200,"tick":2,"time":"2018-03-01T00:00Z"},
	{"equity":1000173599,"_id":200,"tick":3,"time":"2018-04-01T00:00Z"},
	{"equity":1000231938,"_id":200,"tick":4,"time":"2018-05-01T00:00Z"},
	{"equity":1000290277,"_id":200,"tick":5,"time":"2018-06-01T00:00Z"},
	{"equity":1000348616,"_id":200,"tick":6,"time":"2018-07-01T00:00Z"},
	{"equity":1000406955,"_id":200,"tick":7,"time":"2018-08-01T00:00Z"},
	{"equity":1000464346,"_id":200,"tick":8,"time":"2018-09-01T00:00Z"},
	{"equity":1000520251,"_id":200,"tick":9,"time":"2018-10-01T00:00Z"},
	{"equity":1000576160,"_id":200,"tick":10,"time":"2018-11-01T00:00Z"}
]

JSON =/= JSON REST API

It should be noted that enabling the export will create files in a local file directory and will not be consumable by the REST API. Please refer to the REST API pages for information on how you can get JSON data output consumable by other processes.