Files
containerd/snapshot/storage/proto/record.proto
Stephen J Day 66c504d1bb snapshot: add Usage method to Snapshotter
To allow the querying of usage for snapshots, we define a new method on
the snapshotter to query the resources in use by a single snapshot.
Conversely, it can be said that if the snapshot was deleted, the
reported amount of usage would be recovered.

There are few problems with this model in the implementation of btrfs
that need to be worked out. In btrfs, it is hard to resolve the amount
of data usage with the use of quotas but these may report valuables that
are incompatible with the model.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-04-26 17:13:52 -07:00

38 lines
988 B
Protocol Buffer

syntax = "proto3";
package containerd.v1;
import "gogoproto/gogo.proto";
// Kind defines the kind of snapshot.
enum Kind {
option (gogoproto.goproto_enum_prefix) = false;
option (gogoproto.enum_customname) = "Kind";
// KindActive represents an active snapshot
ACTIVE = 0 [(gogoproto.enumvalue_customname) = "KindActive"];
// KindCommitted represents a committed immutable snapshot
COMMITTED = 1 [(gogoproto.enumvalue_customname) = "KindCommitted"];
}
// Snapshot defines the storage type for a snapshot in the
// metadata store.
message Snapshot {
uint64 id = 1 [(gogoproto.customname) = "ID"];
string parent = 2;
Kind kind = 4;
bool readonly = 5;
// inodes stores the number inodes in use for the snapshot.
//
// Only valid for committed snapshots.
int64 inodes = 6;
// Size reports the disk used by the snapshot, excluding the parents.
//
// Only valid for committed snapshots, active snapshots must read the
// current usage from the disk.
int64 size = 7;
}