diff.proto 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. Copyright The containerd Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. syntax = "proto3";
  14. package containerd.services.diff.v1;
  15. import "google/protobuf/any.proto";
  16. import "google/protobuf/timestamp.proto";
  17. import "github.com/containerd/containerd/api/types/mount.proto";
  18. import "github.com/containerd/containerd/api/types/descriptor.proto";
  19. option go_package = "github.com/containerd/containerd/api/services/diff/v1;diff";
  20. // Diff service creates and applies diffs
  21. service Diff {
  22. // Apply applies the content associated with the provided digests onto
  23. // the provided mounts. Archive content will be extracted and
  24. // decompressed if necessary.
  25. rpc Apply(ApplyRequest) returns (ApplyResponse);
  26. // Diff creates a diff between the given mounts and uploads the result
  27. // to the content store.
  28. rpc Diff(DiffRequest) returns (DiffResponse);
  29. }
  30. message ApplyRequest {
  31. // Diff is the descriptor of the diff to be extracted
  32. containerd.types.Descriptor diff = 1;
  33. repeated containerd.types.Mount mounts = 2;
  34. map<string, google.protobuf.Any> payloads = 3;
  35. // SyncFs is to synchronize the underlying filesystem containing files.
  36. bool sync_fs = 4;
  37. }
  38. message ApplyResponse {
  39. // Applied is the descriptor for the object which was applied.
  40. // If the input was a compressed blob then the result will be
  41. // the descriptor for the uncompressed blob.
  42. containerd.types.Descriptor applied = 1;
  43. }
  44. message DiffRequest {
  45. // Left are the mounts which represent the older copy
  46. // in which is the base of the computed changes.
  47. repeated containerd.types.Mount left = 1;
  48. // Right are the mounts which represents the newer copy
  49. // in which changes from the left were made into.
  50. repeated containerd.types.Mount right = 2;
  51. // MediaType is the media type descriptor for the created diff
  52. // object
  53. string media_type = 3;
  54. // Ref identifies the pre-commit content store object. This
  55. // reference can be used to get the status from the content store.
  56. string ref = 4;
  57. // Labels are the labels to apply to the generated content
  58. // on content store commit.
  59. map<string, string> labels = 5;
  60. // SourceDateEpoch specifies the timestamp used for whiteouts to provide control for reproducibility.
  61. // See also https://reproducible-builds.org/docs/source-date-epoch/ .
  62. google.protobuf.Timestamp source_date_epoch = 6;
  63. }
  64. message DiffResponse {
  65. // Diff is the descriptor of the diff which can be applied
  66. containerd.types.Descriptor diff = 3;
  67. }