I am designing a RESTful API that will be used by test execution software to keep metadata about the tests it executes. It needs to save some information about the test itself, as well as which hosts it runs the tests on. Besides that, before starting a new test, test execution software needs to check whether any of the hosts it intends to run this test on, are already in use by other tests. I came up with the following. I have 3 resources: Host, Test, TestRun. There is a many-to-one relation for Host-Test, one-to-one relation for Test-TestRun, many-to-many relation for Host-TestRun.
I create a Host to start with:
POST api/v1/host
Request:
{
"ip_address": "192.168.0.1",