You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
864 B
Markdown

# Design
## Protocol
### Types | TYPE
0 => Request, a new request
1 => Result, the result
#### Request types | REQUEST
0 => New server client
1 => New desktop client
2 => Data
#### Response types | RESPONSE
0 => OK
1 => Created
2 => Not OK
#### Data types | DATA
CPU_USAGE => FLOAT => Percentage of CPU usage
### Server Client
1. When a client wants to connect to the server it sends an initial request detailing the type of it is, e.g. desktop client or server client.
```json
{
"TYPE": 0,
"REQUEST": 0,
"HOSTNAME": "ASGARD"
}
```
2. Server sends back the following response
```json
{
"TYPE": 1,
"RESULT": 0
}
```
3. Client starts
```json
{
"TYPE": 0,
"REQUEST": 2,
"HOSTNAME": "ASGARD",
"DATA": {
"TIMESTAMP": ,
"CPU_USAGE": 50,
"MEMORY_USAGE": 50,
"MEMORY_USED_GB": 1
}
}
```