-
Notifications
You must be signed in to change notification settings - Fork 2
REST API
Register a node in the platform, based on the platforms definition.
To be configured in a GenericPOST
definition
POST
-
Content-Type
:application/json
-
Body: JSON object with the following fields:
Field Type Example id String "node_1"
ipAddress String "172.10.0.111:10800"
connected boolean true
- 200: Success
- 500: Server Error, possible mistake in body
curl -X POST http://localhost:4567/node/register -H 'content-type: application/json' -d '{
"id": "node1",
"ipAddress": 172.10.0.111,
"connected": true
}'
For a configuration with inputs:
{"type": "MatchMaker-Random","name": $NAME},
{"type": "GenericPOST","name": $NAME,"address": "/node/register","port": 4567,
"command" : "register_node $body",
"information": [],
"@IOType" : "CustomCommand"
}
And outputs:
{"type": "MatchMaker-Random","name": $NAME}
Register a client in the platform , based on the platforms definition.
To be configured in a GenericPOST
definition
POST
-
Content-Type
:application/json
-
Body: JSON object with the following fields:
Field Type Example id String "client_1"
- 200: Success
- 500: Server Error, possible mistake in body
curl -X POST http://localhost:4567/client/register -H 'content-type: application/json' -d '{
"id" : "client1"
}'
For a configuration with inputs:
{"type": "MatchMaker-Random","name": $NAME},
{"type": "GenericPOST","name": $NAME,"address": "/client/register","port": 4567,
"command" : "register_client $body",
"information": [],
"@IOType" : "CustomCommand"
}
And outputs:
{"type": "MatchMaker-Random","name": $NAME}
Perform match-making on a given client (should be registered first)
To be configured in a GenericPOST
definition
POST
-
Content-Type
:application/json
-
Body: JSON object with the following fields:
Field Type Example id String "client_1"
- 200: Request send successfully (Not necessarily client assigned)
curl -X POST http://localhost:4567/client/assign -H 'content-type: application/json' -d '{
"id" : "client1"
}'
For a configuration with inputs:
{"type": "MatchMaker-Random","name": $NAME},
{"type": "GenericPOST","name": $NAME,"address": "/client/assign","port": 4567,
"command" : "assign_client $id",
"information": ["id"],
"@IOType" : "CustomCommand"
}
And outputs:
{"type": "MatchMaker-Random","name": $NAME}
Fetch a resource containing connecting information about an assigned node for a given client
To be configured in a GenericGET
definition
GET
Required:
client_id=[String]
: ID of the client in which match-making was already performed (has an assigned node)
-
200: Success, the client had an assigned node
- Content: JSON containing the node information (Same schema as here)
- 404: Not found, there is not a registered client with the given ID or it has not been assigned a node yet
curl http://localhost:4567/client/get_node/client1
For a configuration with inputs:
{"type": "MatchMaker-Random","name": $NAME},
And outputs:
```json
{"type": "GenericGET","name": $NAME, "address": "/client/get_node/:client_id","port": 4567}