Rest API Suggestions


#1

During a recent discussion somebody mentioned tests and API’s so could we start to build up a list of API calls and some details of the test that would exercise them?

1/ Restart GUI
GET call
parameter test=False ( not set returns current instance id hash)

returns hash of instance id . . .

Test.
checks for running GUI and records instance id
calls API
checks for running GUI and different hash.


#2

2/ List Engines
Get Call
returns list of Engines Available

test compare with expected set.

3/ List Layers
GET Call
returns list of Layers Loaded

Test
Clean Machine ( No default snapshot’) returns 0 layers

4/ Add Layer
POST Call
parameter Engine

test
call List Layers (No default snapshot) assert 0 layers
call List Engines assert expected set
check test engine in set
call Add Layer
check test engine in list

5/ Delete Layer
POST Call
parameter Layer to delete

test
call {Add Layer test body (no TearDown) }
call Delete Layer layer 1
call List Layers
assert 0 layers

6/ Remove All Layers
GET Call

test
call {Add Layer test body (no TearDown) }
call Add Layer test2 Engine
assert Layer count
call Remove all Layers
call List Layers
assert 0 layers


#3

Other Resets.

a1/ List Running Engine instances
GET
returns list of active engines with instance ID’s

test
List Running engines on startup.

a2/ All Engine Reset
Get Call (Security :smiley: )
restart default settings

test.

List Running Engine Instances
Restart Engines
List Running Engine Instances
assert differences between instances.


#4

Snapshot

b1/ Load Snapshot
Post
parameter snapshot instance

test
Get layer list
Load Test Snapshot
Get Layer List
Assert change from first list
Assert test Snapshot initial matches Get Layer List

b2/ Save SnapShot
POST
parameter file name

test

Load test snapshot
Get Layer List
Save Snapshot testname

Remove All Layers
Get Layer List
assert difference

Load Snapshot testname
Get Layer List

assert equal