feat: add listing endpoints, complete branches swagger-spec (4.0)
Description
- Add endpoints for listing snapshots, clones and branches
- Complete SwaggerUI Spec for branches
Related issue
Examples
GET /snapshots
[
{
"id": "oldest5@snapshot_20230515202911",
"createdAt": "2023-05-15T20:30:35Z",
"dataStateAt": "2023-05-15T20:29:11Z",
"physicalSize": 0,
"logicalSize": 74491392,
"pool": "oldest5",
"numClones": 1
}
]
GET /clones
[
{
"id": "chh9ed61q2ss73cgvbkg",
"snapshot": {
"id": "oldest5@snapshot_20230515202911",
"createdAt": "2023-05-15T20:30:35Z",
"dataStateAt": "2023-05-15T20:29:11Z",
"physicalSize": 0,
"logicalSize": 74491392,
"pool": "oldest5",
"numClones": 1
},
"branch": "",
"protected": false,
"deleteAt": null,
"createdAt": "2023-05-15T20:33:56Z",
"status": {
"code": "OK",
"message": "Clone is ready to accept Postgres connections."
},
"db": {
"connStr": "host=localhost port=6000 user=alice dbname=postgres",
"host": "localhost",
"port": "6000",
"username": "alice",
"password": "",
"dbName": ""
},
"metadata": {
"cloneDiffSize": 334336,
"logicalSize": 74292224,
"cloningTime": 0.449556853,
"maxIdleMinutes": 2
}
}
]
GET /branches
[
{
"name": "main",
"parent": "-",
"dataStateAt": "20230515202911",
"snapshotID": "oldest5@snapshot_20230515202911"
},
{
"name": "001-branch",
"parent": "main",
"dataStateAt": "20230515202911",
"snapshotID": "oldest5@snapshot_20230515202911"
}
]
Checklist
-
MR description has been reviewed -
MR changes are functionally tested -
MR does NOT have API/CLI changes OR there are API/CLI changes and they have been reviewed & DOCS ARE ADJUSTED (reference doc, etc) -
MR does NOT have UI changes OR there are UI changes and they have been reviewed & UX IS REVIEWED