Skip to content

docs: add documentation on excluding data from snapshots - #421

Merged
natibek merged 3 commits into
mainfrom
snapshot-exlusion
Jul 14, 2026
Merged

docs: add documentation on excluding data from snapshots#421
natibek merged 3 commits into
mainfrom
snapshot-exlusion

Conversation

@natibek

@natibek natibek commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Describe how to exclude items from a snapshot.
SNAPDENG-5609

@natibek
natibek requested a review from Mohit-Chachada July 6, 2026 20:19

@Mohit-Chachada Mohit-Chachada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, some comments and suggestions

Comment thread docs/how-to-guides/manage-snaps/create-data-snapshots.md Outdated
Comment thread docs/how-to-guides/manage-snaps/create-data-snapshots.md
Comment thread docs/how-to-guides/manage-snaps/create-data-snapshots.md Outdated
Comment thread docs/how-to-guides/manage-snaps/create-data-snapshots.md Outdated
Comment thread docs/how-to-guides/manage-snaps/create-data-snapshots.md Outdated
@natibek

natibek commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks!

@Mohit-Chachada Mohit-Chachada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @natibek ! Just one more suggestion.

```

#### Dynamic exclusion via snapd REST API
The static exclusion from `meta/snapshots.yaml` can be extended via dynamic requests to the [`/v2/snaps`](https://snapcraft.io/docs/reference/development/snapd-rest-api/#/Asynchronous/manageSnaps) REST API endpoint. The POST request body includes a `snapshot-options` field that lists wildcard patterns of files or directories to exclude from snapshots for individual snaps. Because the patterns are specified per request, they can vary between snapshot operations. As a result, dynamic exclusion is only available for manual snapshots.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The static exclusion from `meta/snapshots.yaml` can be extended via dynamic requests to the [`/v2/snaps`](https://snapcraft.io/docs/reference/development/snapd-rest-api/#/Asynchronous/manageSnaps) REST API endpoint. The POST request body includes a `snapshot-options` field that lists wildcard patterns of files or directories to exclude from snapshots for individual snaps. Because the patterns are specified per request, they can vary between snapshot operations. As a result, dynamic exclusion is only available for manual snapshots.
A snapshot can also be created using a POST request to the [`/v2/snaps`](https://snapcraft.io/docs/reference/development/snapd-rest-api/#/Asynchronous/manageSnaps) REST API endpoint. The request body includes a `snapshot-options` field that can be used to list snap-specific paths of files or directories to exclude from the snapshot. These paths follow the same patterns as mentioned above for the `meta/snapshots.yaml` file. The exclusion path patterns are specified per request and can vary across snapshots. This dynamic path exclusion is only available for manual snapshots.

@natibek
natibek merged commit 4484a91 into main Jul 14, 2026
2 checks passed
@natibek
natibek deleted the snapshot-exlusion branch July 14, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants