Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Items shown between curly braces are parameters that you would configure as part of the call. 

Interface Address

Function

Example-a "net.pipe://localhost/PipeReverse"

Result

/echo/{message}

A test location that will return the message:

You Typed: {message}
Address for server to create, or client to connect.--baseSIUnits

for whatever was pass in. This location is useful for checking the server is up and responsive.

You Typed: {message}

/projectDirectory/{*projectDirectory}

Ignore units set within project and output base SI units-c "c:\StateFiles\state.txt"
Directory in which to look for projects
true or false

/create

File to load state from when in client mode or file to save state in when in server mode.-d "c:\ProjectFiles"
Starts a new server and returns a {instance} string that should be passed to most other calls to communicate with this created server.
{instance} identifer

/load?instance={instance}&project={projectName}&scenario={scenarioName}

Directory in which to look for projects.-e 2000
Path to the project, or project name on server and optional scenario within that project.
true or false

/saveas?instance={instance}&project={projectNewName}&folderPath={folderPath}

Operation timeout for WCF service in seconds.-f "settings.txt"
Save the loaded project after the run is complete to the specified path and file. The string argument cannot be empty, and the path provided must be an existing directory and have saving permissions for the current user.
true or false

/units?instance={instance}&si={useSIUnits}

File to merge command-line settings from.
Ignore units set within project and output base SI units
true or false

/project?instance={instance}

This option allows a plugin (that the project has been saved with) to be loaded for this run only. The path specified is a relative path to the plugin from the command line. eg. "Plugins\ExampleRainfallRunoffModel.dll"
-l "plugin.dll"
-m Client or -m Server
Returns the project file an scenario name of the loaded project
{
"Project" : "projectName"
"Scenario" : "scenarioName"
}

/run?instance={instance}

Application mode Client/Server/InProcess.-o "output.res.csv" for CSV or -o "output.nc"
Executes the active scenario from its current location to the end
true or false

/step?instance={instance}

File to save output into. The extension selects the output format based on the standard TIME I/O formats. A directory of the name specified will be created if the format only supports a single time series.-p "projectName.rspr
Moves forward 1 time step in the active scenario
true or false

/getStep?instance={instance}

Path to the project, or project name on server and optional scenario within that project, DateTime values to override the default start and end times of the loaded scenario and data source input set to run.

-r "someResult" -r "someOtherResult"

Returns the current step and the total number of steps in the active scenario

{
"Current" : 0
"Total" : 100
}

/metaParameters?instance={instance}

Which results to return. This can appear multiple times.

Info
iconfalse
Note: By default, all recorded results are saved into the specified output file. When this options is used, it only allows you to reduce the number of results saved out. Requested results must be set to record in the project file. To specify the output file name, save the result to a file with a .res.csv extension. Use the column name for the time series.
--step 1

Get the active Functions (also calledmeta-parameter for calibration)

true or false

/metaParameter?instance={instance}&name={parameterName}&value={value}

Number of time-steps to run.--reset

Set the value of a Function (also calledmeta-parameter for calibration)

true or false

/allTimeSeries?instance={instance}

Reset the loaded project.--current

Returns all the result timeseries as an array

A Timeseries jSON object contains

Metadata - Key value array

Name - name of timeseries

Units - units string of timeseries

Readings - array of Time, Result objects

[
{
"Metadata": [
{
"Key" : "RunTime",
"Value" : "16/08/2016 2:22:22 PM"
},
{
"Key" : "ScenarioName",
"Value" : "Scenario 1"
}

], 

"Name": "Gauge\\Gauge 16\\Downstream Flow\\Flow",
"Readings": [
{
"Result": 0.2,
"Time": "/Date(631112400000+1100)/"
},
{
"Result": 0.2,
"Time": "/Date(631198800000+1100)/"
}
],

"Units": "ML/d"

},

{
"Metadata": [
{

"Key" : "RunTime",
"Value" : "16/08/2016 2:22:22 PM"
},
{
"Key" : "ScenarioName",
"Value" : "Scenario 1"
}

], 


"Name": "Gauge\\Gauge 16\\Rules Based Orders\\Rules Based Orders@Orders",
"Readings": [
{
"Result": 0,
"Time": "/Date(631112400000+1100)/"
},
{
"Result": 0,
"Time": "/Date(631198800000+1100)/"
}
],
"Units": "ML"
}
]

/timeSeries?instance={instance}&name={parameterName}

Return only the current time step's value for the specified results

Returns a specific timeseries

A Timeseries jSON object contains

Metadata - Key value array

Name - name of timeseries

Units - units string of timeseries

Readings - array of Time, Result objects

{
"Metadata": [
{
"Key" : "RunTime",
"Value" : "16/08/2016 2:22:22 PM"
},
{
"Key" : "ScenarioName",
"Value" : "Scenario 1"
}
], 
"Name": "Gauge\\Gauge 16\\Downstream Flow\\Flow", 
"Readings": [
{
"Result": 0.2,
"Time": "/Date(631112400000+1100)/"
},
{
"Result": 0.2,
"Time": "/Date(631198800000+1100)/"
}
],
"Units": "ML/d"
}

/timeStepValue?instance={instance}&name={parameterName}

Set

returns the last value of a

Function (also called meta-parameter for calibration)-v "$metaparam=25", or -v "$anotherMetaParam=2.3"

particular timeseries

double value eg. 1.2

/reset?instance={instance}

Save
Reset the loaded project
after the run is complete to the specified path and file. The string argument cannot be empty, and the path provided must be an existing directory and have saving permissions for the current user.
-y "C:\ProjectFiles\newProject.rsproj"
/finish?instance={instance}
.
true or false

/finish?instance={instance}

Destroys the service associated with the specified instance identifer
true or false

 

An example session of http requests and responses might look like this

RequestResponse
http://localhost:8001/Source/create
1
http://localhost:8001/Source/load?instance=1&project=AllNodes.rsproj
true
http://localhost:8001/Source/run?instance=1
true
http://localhost:8001/Source/allTimeSeries?instance=1
[
{
"Metadata": [
{
"Key" : "RunTime",
"Value" : "16/08/2016 2:22:22 PM"
},
{
"Key" : "ScenarioName",
"Value" : "Scenario 1"
}
], 
"Name": "Gauge\\Gauge 16\\Downstream Flow\\Flow", 
"Readings": [
{
"Result": 0.2,
"Time": "/Date(631112400000+1100)/"
},
{
"Result": 0.2,
"Time": "/Date(631198800000+1100)/"
}
],
"Units": "ML/d"
},
{
"Metadata": [
{
"Key" : "RunTime",
"Value" : "16/08/2016 2:22:22 PM"
},
{
"Key" : "ScenarioName",
"Value" : "Scenario 1"
}
], 

"Name": "Gauge\\Gauge 16\\Rules Based Orders\\Rules Based Orders@Orders",
"Readings": [
{
"Result": 0,
"Time": "/Date(631112400000+1100)/"
},
{
"Result": 0,
"Time": "/Date(631198800000+1100)/"
}
],
"Units": "ML"
}
]
http://localhost:8001/Source/finish?instance=1
true