Skip to content

Commit 7b60ce4

Browse files
Alice Ferrazzilu-zero
authored andcommitted
Init documentation of the REST API
1 parent 41f9e71 commit 7b60ce4

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ $ python elivepatch-server
2323
```
2424

2525
Will run the server using [werkzeug](https://palletsprojects.com/p/werkzeug/)
26+
27+
## API
28+
29+
- Endpoint root: /elivepatch/api/
30+
- agent: /elivepatch/api/v1.0/agent
31+
- send_livepatch: /elivepatch/api/v1.0/send_livepatch
32+
- GetFiles: /elivepatch/api/v1.0/get_files
33+
34+
More information on the REST API is [here](docs/API.md)

docs/API.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
### send_livepatch _POST_
2+
Get the livepatch object by sending the UUID
3+
#### url: /elivepatch/api/v1.0/send_livepatch
4+
- KernelVersion type=string required=False
5+
- UUID type=string required=False
6+
7+
### GetFiles _POST_
8+
Send the information for building the livepatch object
9+
#### url: /elivepatch/api/v1.0/get_files
10+
- KernelVersion type=string required=False
11+
Kernel verson needed for know which kernel we are working
12+
- UUID type=string required=False
13+
Assigning a Universally Unique Identifier
14+
- patch type=werkzeug.datastructures.FileStorage required=True
15+
Previous applied patch to kernel
16+
- main_patch type=werkzeug.datastructures.FileStorage required=True
17+
Patch that will be converted in the live patch object
18+
- config type=werkzeug.datastructures.FileStorage required=True
19+
Configuraton file of the kernel
20+
21+
#### example
22+
Success
23+
```
24+
{
25+
"KernelVersion": "5.1.9",
26+
"UUID': '57773c4c-65e2-4ed1-9daa-345737a9b05f"
27+
}
28+
```
29+
30+
Fail
31+
```
32+
{
33+
"message": "These are not the patches you are looking for"
34+
}
35+
```
36+
37+
### Root _GET_
38+
Root of the endpoint
39+
#### url: /elivepatch/api/
40+
#### example
41+
curl -H "Accept: application/ld+json" -X GET http://localhost:5000/elivepatch/api/ | jd
42+
success
43+
```
44+
{
45+
"agent": [
46+
{
47+
"module": "elivepatch",
48+
"version": "0.01"
49+
}
50+
]
51+
}
52+
```
53+
54+
### Agent _GET_
55+
Retrive agent informations
56+
#### url: /elivepatch/api/v1.0/agent
57+
#### example
58+
curl -H "Accept: application/ld+json" -X GET http://localhost:5000/elivepatch/api/v1.0/agent | jd
59+
success
60+
```
61+
{
62+
"agent": [
63+
{
64+
"module": "elivepatch",
65+
"version": "0.01"
66+
}
67+
]
68+
}
69+
```

0 commit comments

Comments
 (0)