Skip to content

Conversation

@heldergomes
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the API Changes to the REST API label Dec 23, 2025
@stgraber stgraber changed the title [DRAFT] Add description on snapshot creation Add description on snapshot creation Dec 23, 2025
@stgraber stgraber marked this pull request as draft December 23, 2025 20:08
@heldergomes
Copy link
Contributor Author

because this MR is quite long, I will try to explain a little bit about some change decisions and few concerns!

storage_volume_snapshot
Despite the requirement is quite simple, the change is painful because I had to change many piece of code, therefore I decided to change only instance snapshot on this PR, but I could open a new pull request changing volume snapshot afterward.

shared/api/instance_snapshot.go
I'd expected to refactor a little bit the InstanceSnapshot struct, snapshot data such as (expiry_at and description) should be on root struct and source instance data like (instance description) should be on nested object like InstanceProperties IMHO, this would design better the model to handle better with more instance properties in the future, however this change would break API, threfore I just add SnapshotDescription field on the model.

instance_args
Handle this struct was quite challenge mostly because incus handle snapshots and instance in the same way with instance_args, so although qemu/lxc driver and shared/api/instance_snapshot I ended up handle snapshot fields such as description and expiry on root struct, I took decision to create snapshot_args as nested object of instance_args, in order to make easier add new fields on this highly used struct.

I'd rather use snapshot as a nested struct of instance on every place like driver, api, db, etc, but this change is painful, so it's what it is!

instance_snapshot_property
I tried do use the term instance_snapshot_properties, however generate_database script only knew how to create mapper like list if tables name was singular, tables with suffix ies is considered plural on the script.

I think that's all, let me know if have any question or improvements.

@heldergomes
Copy link
Contributor Author

I will check the pipeline errors and fix it!

@heldergomes
Copy link
Contributor Author

This PR implements #2254

@heldergomes heldergomes force-pushed the add-description-on-snapshot-creation branch 7 times, most recently from 8990ceb to 3ded45e Compare December 25, 2025 00:24
Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
…pshot parser

Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
… refactoring

Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
…apshot description

Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
…shot description

Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
…ot properties

Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
Signed-off-by: Helder Ardachnikoff Gomes <[email protected]>
@heldergomes heldergomes force-pushed the add-description-on-snapshot-creation branch from 3ded45e to dcadbc7 Compare December 25, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Changes to the REST API

Development

Successfully merging this pull request may close these issues.

1 participant