docs: add documentation on excluding data from snapshots - #421
Merged
Conversation
Mohit-Chachada
left a comment
Contributor
There was a problem hiding this comment.
Thanks, some comments and suggestions
Contributor
Author
|
Thanks! |
Mohit-Chachada
approved these changes
Jul 13, 2026
Mohit-Chachada
left a comment
Contributor
There was a problem hiding this comment.
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. |
Contributor
There was a problem hiding this comment.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe how to exclude items from a snapshot.
SNAPDENG-5609