Skip to content

feat(engine): create snapshot API handlers (#65)

Artyom Kartasov requested to merge 65-create-snapshot into dle-4.0

Description

Create snapshot API handlers:

  • create a new snapshot
  • delete the existing snapshot
  • add new commands to CLI,
  • add tests

Related issue

#65 (closed)

Examples

POST /snapshot/create

Response

{
    "id": "oldest5@snapshot_20221012114006",
    "createdAt": "2022-10-12T11:41:47Z",
    "dataStateAt": "2022-10-12T11:40:06Z",
    "used": 210944,
    "logicalReferenced": 71899648,
    "pool": "oldest5"
}

POST /snapshot/delete

Request

{
    "snapshotID": "oldest5@snapshot_20221012114006"
}

CLI

$ dblab snapshot list
[
    {
        "id": "oldest5@snapshot_20221013063514",
        "createdAt": "2022-10-13T06:36:40Z",
        "dataStateAt": "2022-10-13T06:35:14Z",
        "pool": "oldest5",
        "numClones": 0,
        "physicalSize": "0 B",
        "logicalSize": "69 MiB"
    }
]

$ dblab snapshot delete oldest5@snapshot_20221013063514
The snapshot has been successfully deleted: oldest5@snapshot_20221013063514

$ dblab snapshot list
[]

$ dblab snapshot create
{
    "id": "oldest5@snapshot_20221013063514",
    "createdAt": "2022-10-13T06:37:29Z",
    "dataStateAt": "2022-10-13T06:35:14Z",
    "physicalSize": 0,
    "logicalSize": 0,
    "pool": "oldest5",
    "numClones": 0
}

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

Closes #65 (closed)

Edited by Artyom Kartasov

Merge request reports