github.com/pachyderm/pachyderm@v1.13.4/src/client/admin/v1_11/pfs/pfs.proto (about)

     1  syntax = "proto3";
     2  
     3  package pfs_1_11;
     4  option go_package = "github.com/pachyderm/pachyderm/src/client/admin/v1_11/pfs";
     5  
     6  import "google/protobuf/empty.proto";
     7  import "google/protobuf/timestamp.proto";
     8  import "google/protobuf/wrappers.proto";
     9  
    10  import "gogoproto/gogo.proto";
    11  
    12  import "client/admin/v1_11/auth/auth.proto";
    13  
    14  ////  PFS Data structures (stored in etcd)
    15  
    16  message Repo {
    17    string name = 1;
    18  }
    19  
    20  message Branch {
    21    Repo repo = 1;
    22    string name = 2;
    23  }
    24  
    25  message BranchInfo {
    26    Branch branch = 4;
    27    Commit head = 2;
    28    repeated Branch provenance = 3;
    29    repeated Branch subvenance = 5;
    30    repeated Branch direct_provenance = 6;
    31  
    32    // Deprecated field left for backward compatibility.
    33    string name = 1;
    34  }
    35  
    36  message BranchInfos {
    37    repeated BranchInfo branch_info = 1;
    38  }
    39  
    40  message File {
    41    Commit commit = 1;
    42    string path = 2;
    43  }
    44  
    45  message Block {
    46    string hash = 1;
    47  }
    48  
    49  message Object {
    50    string hash = 1;
    51  }
    52  
    53  message Tag {
    54    string name = 1;
    55  }
    56  
    57  // RepoInfo is the main data structure representing a Repo in etcd
    58  message RepoInfo {
    59    reserved 4;
    60    Repo repo = 1;
    61    google.protobuf.Timestamp created = 2;
    62    uint64 size_bytes = 3;
    63    string description = 5;
    64    repeated Branch branches = 7;
    65  
    66    // Set by ListRepo and InspectRepo if Pachyderm's auth system is active, but
    67    // not stored in etcd. To set a user's auth scope for a repo, use the
    68    // Pachyderm Auth API (in src/client/auth/auth_1_11.proto)
    69    RepoAuthInfo auth_info = 6;
    70  }
    71  
    72  // RepoAuthInfo includes the caller's access scope for a repo, and is returned
    73  // by ListRepo and InspectRepo but not persisted in etcd. It's used by the
    74  // Pachyderm dashboard to render repo access appropriately. To set a user's auth
    75  // scope for a repo, use the Pachyderm Auth API (in src/client/auth/auth_1_11.proto)
    76  message RepoAuthInfo {
    77    // The callers access level to the relevant repo (e.g. may be OWNER even if
    78    // the user isn't an OWNER of the repo, if they're an admin for the cluster)
    79    auth_1_11.Scope access_level = 1;
    80  }
    81  
    82  // These are the different places where a commit may be originated from
    83  enum OriginKind {
    84    USER = 0;
    85    AUTO = 1;
    86    FSCK = 2;
    87  }
    88  
    89  message CommitOrigin {
    90    OriginKind kind = 1;
    91  }
    92  // Commit is a reference to a commit (e.g. the collection of branches and the
    93  // collection of currently-open commits in etcd are collections of Commit
    94  // protos)
    95  message Commit {
    96    Repo repo = 1;
    97    string id = 2 [(gogoproto.customname) = "ID"];
    98  }
    99  
   100  // CommitRange represents chain of commits with Lower being an ancestor of
   101  // Upper or, in the case of a range of size 1, the same commit.
   102  message CommitRange {
   103    Commit lower = 1;
   104    Commit upper = 2;
   105  }
   106  
   107  // CommitProvenance keeps track of where (i.e. which branch) a certain commit
   108  // originated from. A commit's provenance consists of the commits of
   109  // the commits which are in its causal history.
   110  message CommitProvenance {
   111    Commit commit = 1;
   112    Branch branch = 2;
   113  }
   114  
   115  // CommitInfo is the main data structure representing a commit in etcd
   116  message CommitInfo {
   117    reserved 6, 10;
   118    Commit commit = 1;
   119    Branch branch = 15;
   120    CommitOrigin origin = 17;
   121    // description is a user-provided script describing this commit
   122    string description = 8;
   123    Commit parent_commit = 2;
   124    repeated Commit child_commits = 11;
   125    google.protobuf.Timestamp started = 3;
   126    google.protobuf.Timestamp finished = 4;
   127    uint64 size_bytes = 5;
   128  
   129    // the commits and their original branches on which this commit is provenant
   130    repeated CommitProvenance provenance = 16;
   131  
   132    // ReadyProvenance is the number of provenant commits which have been
   133    // finished, if ReadyProvenance == len(Provenance) then the commit is ready
   134    // to be processed by pps.
   135    int64 ready_provenance = 12;
   136  
   137    repeated CommitRange subvenance = 9;
   138    // this is the block that stores the serialized form of a tree that
   139    // represents the entire file system hierarchy of the repo at this commit
   140    // If this is nil, then the commit is either open (in which case 'finished'
   141    // will also be nil) or is the output commit of a failed job (in which case
   142    // 'finished' will have a value -- the end time of the job)
   143    Object tree = 7;
   144    repeated Object trees = 13;
   145    Object datums = 14;
   146  
   147    int64 subvenant_commits_success = 18;
   148    int64 subvenant_commits_failure = 19;
   149    int64 subvenant_commits_total = 20;
   150  }
   151  
   152  enum FileType {
   153    RESERVED = 0;
   154    FILE = 1;
   155    DIR = 2;
   156  }
   157  
   158  message FileInfo {
   159    File file = 1;
   160    FileType file_type = 2;
   161    uint64 size_bytes = 3;
   162    google.protobuf.Timestamp committed = 10;
   163    // the base names (i.e. just the filenames, not the full paths) of
   164    // the children
   165    repeated string children = 6;
   166    repeated Object objects = 8;
   167    repeated BlockRef blockRefs = 9;
   168    bytes hash = 7;
   169  }
   170  
   171  message ByteRange {
   172    uint64 lower = 1;
   173    uint64 upper = 2;
   174  }
   175  
   176  message BlockRef {
   177    Block block = 1;
   178    ByteRange range = 2;
   179  }
   180  
   181  message ObjectInfo {
   182    Object object = 1;
   183    BlockRef block_ref = 2;
   184  }
   185  
   186  message Compaction {
   187    repeated string input_prefixes = 2;
   188  }
   189  
   190  message Shard {
   191    Compaction compaction = 1;
   192    PathRange range = 2;
   193    string output_path = 3;
   194  }
   195  
   196  message PathRange {
   197    string lower = 1;
   198    string upper = 2;
   199  }
   200  
   201  // PFS API
   202  
   203  message CreateRepoRequest {
   204    reserved 2;
   205    Repo repo = 1;
   206    string description = 3;
   207    bool update = 4;
   208  }
   209  
   210  message InspectRepoRequest {
   211    Repo repo = 1;
   212  }
   213  
   214  message ListRepoRequest {
   215    reserved 1;
   216  }
   217  
   218  message ListRepoResponse {
   219    repeated RepoInfo repo_info = 1;
   220  }
   221  
   222  message DeleteRepoRequest {
   223    Repo repo = 1;
   224    bool force = 2;
   225    bool all = 3;
   226  }
   227  
   228  // CommitState describes the states a commit can be in.
   229  // The states are increasingly specific, i.e. a commit that is FINISHED also counts as STARTED.
   230  enum CommitState {
   231    STARTED = 0; // The commit has been started, all commits satisfy this state.
   232    READY = 1; // The commit has been started, and all of its provenant commits have been finished.
   233    FINISHED = 2; // The commit has been finished.
   234  }
   235  
   236  message StartCommitRequest {
   237    reserved 2;
   238    // Parent.ID may be empty in which case the commit that Branch points to will be used as the parent.
   239    // If branch is empty, or if branch does not exist, the commit will have no parent.
   240    Commit parent = 1;
   241    // description is a user-provided string describing this commit
   242    string description = 4;
   243    string branch = 3;
   244    repeated CommitProvenance provenance = 5;
   245  }
   246  
   247  message BuildCommitRequest {
   248    reserved 2;
   249    Commit parent = 1;
   250    string branch = 4;
   251    CommitOrigin origin = 12;
   252    repeated CommitProvenance provenance = 6;
   253    Object tree = 3;
   254    repeated Object trees = 7;
   255    Object datums = 8;
   256    // ID sets the ID of the created commit.
   257    string ID = 5;
   258    uint64 size_bytes = 9;
   259    // 'started' and 'finished' are set by Restore() when repopulating old
   260    // commits. If 'finished' is set, the commit being built is always marked
   261    // finished.
   262    google.protobuf.Timestamp started = 10;
   263    google.protobuf.Timestamp finished = 11;
   264  }
   265  
   266  message FinishCommitRequest {
   267    Commit commit = 1;
   268    // description is a user-provided string describing this commit. Setting this
   269    // will overwrite the description set in StartCommit
   270    string description = 2;
   271  
   272    Object tree = 3;
   273    repeated Object trees = 5;
   274    Object datums = 7;
   275    uint64 size_bytes = 6;
   276    // If set, 'commit' will be closed (its 'finished' field will be set to the
   277    // current time) but its 'tree' will be left nil.
   278    bool empty = 4;
   279  }
   280  
   281  message InspectCommitRequest {
   282    Commit commit = 1;
   283    // BlockState causes inspect commit to block until the commit is in the desired state.
   284    CommitState block_state = 2;
   285  }
   286  
   287  message ListCommitRequest {
   288    Repo repo = 1;
   289    Commit from = 2;
   290    Commit to = 3;
   291    uint64 number = 4;
   292    bool reverse = 5;  // Return commits oldest to newest
   293  }
   294  
   295  message CommitInfos {
   296    repeated CommitInfo commit_info = 1;
   297  }
   298  
   299  message CreateBranchRequest {
   300    Commit head = 1;
   301    // s_branch matches the field number and type of SetBranchRequest.Branch in
   302    // Pachyderm 1.6--so that operations (generated by pachyderm 1.6's
   303    // Admin.Export) can be deserialized by pachyderm 1.7 correctly
   304    string s_branch = 2;
   305    Branch branch = 3;
   306    repeated Branch provenance = 4;
   307  }
   308  
   309  message InspectBranchRequest {
   310    Branch branch = 1;
   311  }
   312  
   313  message ListBranchRequest {
   314    Repo repo = 1;
   315    bool reverse = 2; // Returns branches oldest to newest
   316  }
   317  
   318  message DeleteBranchRequest {
   319    Branch branch = 1;
   320    bool force = 2;
   321  }
   322  
   323  message DeleteCommitRequest {
   324    Commit commit = 1;
   325  }
   326  
   327  message FlushCommitRequest {
   328    repeated Commit commits = 1;
   329    repeated Repo to_repos = 2;
   330  }
   331  
   332  message SubscribeCommitRequest {
   333    Repo repo = 1;
   334    string branch = 2;
   335    CommitProvenance prov = 5;
   336    // only commits created since this commit are returned
   337    Commit from = 3;
   338    // Don't return commits until they're in (at least) the desired state.
   339    CommitState state = 4;
   340  }
   341  
   342  message GetFileRequest {
   343    File file = 1;
   344    int64 offset_bytes = 2;
   345    int64 size_bytes = 3;
   346  }
   347  
   348  enum Delimiter {
   349    NONE = 0;
   350    JSON = 1;
   351    LINE = 2;
   352    SQL = 3;
   353    CSV = 4;
   354  }
   355  
   356  // An OverwriteIndex specifies the index of objects from which new writes
   357  // are applied to.  Existing objects starting from the index are deleted.
   358  // We want a separate message for ObjectIndex because we want to be able to
   359  // distinguish between a zero index and a non-existent index.
   360  message OverwriteIndex {
   361    int64 index = 1;
   362  }
   363  
   364  message PutFileRequest {
   365    reserved 2, 4;
   366    File file = 1;
   367    bytes value = 3;
   368    string url = 5;
   369    // applies only to URLs that can be recursively walked, for example s3:// URLs
   370    bool recursive = 6;
   371    // Delimiter causes data to be broken up into separate files with File.Path
   372    // as a prefix.
   373    Delimiter delimiter = 7;
   374    // TargetFileDatums specifies the target number of datums in each written
   375    // file it may be lower if data does not split evenly, but will never be
   376    // higher, unless the value is 0.
   377    int64 target_file_datums = 8;
   378    // TargetFileBytes specifies the target number of bytes in each written
   379    // file, files may have more or fewer bytes than the target.
   380    int64 target_file_bytes = 9;
   381    // header_records is an option for splitting data when 'delimiter' is not NONE
   382    // (or SQL). It specifies the number of records that are converted to a
   383    // header and applied to all file shards.
   384    //
   385    // This is particularly useful for CSV files, where the first row often
   386    // contains column titles; if 'header_records' is set to one in that case,
   387    // the first row will be associated with the directory that contains the rest
   388    // of the split-up csv rows as files, and if any data is retrieved from that
   389    // directory by GetFile, it will appear to begin with that first row of
   390    // column labels (including in pipeline workers).
   391    //
   392    // Note that SQL files have their own logic for determining headers (their
   393    // header is not a number of records, but a collection of SQL commands that
   394    // create the relevant tables and such). This way, SQL files retrieved by
   395    // GetFile can be passed to psql, and they will set up the appropriate tables
   396    // before inserting the records in the files that were retrieved.
   397    int64 header_records = 11;
   398    // overwrite_index is the object index where the write starts from.  All
   399    // existing objects starting from the index are deleted.
   400    OverwriteIndex overwrite_index = 10;
   401    // delete indicates that the file should be deleted, this is redundant with
   402    // DeleteFile, but is necessary because it allows you to send file deletes
   403    // atomically with other PutFile operations.
   404    bool delete = 12;
   405  }
   406  
   407  // PutFileRecord is used to record PutFile requests in etcd temporarily.
   408  message PutFileRecord {
   409    int64 size_bytes = 1;
   410    string object_hash = 2;
   411    OverwriteIndex overwrite_index = 3;
   412    BlockRef block_ref = 4;
   413  }
   414  
   415  message PutFileRecords {
   416    bool split = 1;
   417    repeated PutFileRecord records = 2;
   418    bool tombstone = 3;
   419    PutFileRecord header = 4;
   420    PutFileRecord footer = 5;
   421  }
   422  
   423  message CopyFileRequest {
   424    File src = 1;
   425    File dst = 2;
   426    bool overwrite = 3;
   427  }
   428  
   429  message InspectFileRequest {
   430    File file = 1;
   431  }
   432  
   433  message ListFileRequest {
   434    // File is the parent directory of the files we want to list. This sets the
   435    // repo, the commit/branch, and path prefix of files we're interested in
   436    // If the "path" field is omitted, a list of files at the top level of the repo
   437    // is returned
   438    File file = 1;
   439  
   440    // Full indicates whether the result should include file contents, which may
   441    // be large (i.e. the list of children for directories, and the list of object
   442    // references for regular files)
   443    bool full = 2;
   444  
   445    // History indicates how many historical versions you want returned. Its
   446    // semantics are:
   447    // 0: Return the files as they are at the commit in `file`. FileInfo.File
   448    //    will equal File in this request.
   449    // 1: Return the files as they are in the last commit they were modified in.
   450    //    (This will have the same hash as if you'd passed 0, but
   451    //    FileInfo.File.Commit will be different.
   452    // 2: Return the above and the files as they are in the next-last commit they
   453    //    were modified in.
   454    // 3: etc.
   455    //-1: Return all historical versions.
   456    int64 history = 3;
   457  }
   458  
   459  message WalkFileRequest {
   460      File file = 1;
   461  }
   462  
   463  message GlobFileRequest {
   464    Commit commit = 1;
   465    string pattern = 2;
   466  }
   467  
   468  // FileInfos is the result of both ListFile and GlobFile
   469  message FileInfos {
   470    repeated FileInfo file_info = 1;
   471  }
   472  
   473  message DiffFileRequest {
   474    File new_file = 1;
   475    // OldFile may be left nil in which case the same path in the parent of
   476    // NewFile's commit will be used.
   477    File old_file = 2;
   478    bool shallow = 3;
   479  }
   480  
   481  message DiffFileResponse {
   482    repeated FileInfo new_files = 1;
   483    repeated FileInfo old_files = 2;
   484  }
   485  
   486  message DeleteFileRequest {
   487    File file = 1;
   488  }
   489  
   490  message FsckRequest {
   491    bool fix = 1;
   492  }
   493  
   494  message FsckResponse {
   495    string fix = 1;
   496    string error = 2;
   497  }
   498  
   499  // Messages specific to Pachyderm 2.
   500  
   501  message FileInfoV2 {
   502    File file = 1;
   503    string hash = 2;
   504  }
   505  
   506  // PutTar Protocol:
   507  //   Client sends an initial request with only the commit field set.
   508  //   For each tar stream to put:
   509  //     If the client wants to tag the tar stream:
   510  //       Client sends a request with the tag field set (the first batch
   511  //       of data can be optionally sent with this request).
   512  //     For bytes in the tar stream:
   513  //       Client sends a request with the bytes stored in the data field.
   514  //     Client sends a request with the EOF field set to true.
   515  //   Client connection is closed.
   516  
   517  message FileOperationRequestV2 {
   518    Commit commit = 1;
   519    oneof operation {
   520      PutTarRequestV2 put_tar = 2;
   521      DeleteFilesRequestV2 delete_files = 3;
   522    }
   523  }
   524  
   525  message PutTarRequestV2 {
   526    string tag = 1;
   527    bytes data = 2;
   528    bool EOF = 3;
   529  }
   530  
   531  message DeleteFilesRequestV2 {
   532    repeated string files = 1; 
   533    string tag = 2;
   534  }
   535  
   536  message GetTarRequestV2 {
   537    File file = 1;
   538  }
   539  
   540  // GetTarConditional Protocol:
   541  //   Client sends an initial request that is similar to a GetTar request.
   542  //   For files that match the request:
   543  //     Server sends a response with the file info for the file.
   544  //     If the client wants to skip the file content:
   545  //       Client sends a request with the skip field set to true.
   546  //     Else
   547  //       Client sends a request with the skip field set to false.
   548  //       For file content:
   549  //         Server sends a response with file content in the data field.
   550  //       Server sends a response with the EOF field set to true.
   551  //   Server connection is closed by returning from handler.
   552  
   553  message GetTarConditionalRequestV2 {
   554    File file = 1;
   555    bool skip = 2;
   556  }
   557  
   558  message GetTarConditionalResponseV2 {
   559    FileInfoV2 file_info = 1;
   560    bytes data = 2;
   561    bool EOF = 3;
   562  }
   563  
   564  service API {
   565    // Repo rpcs
   566    // CreateRepo creates a new repo.
   567    // An error is returned if the repo already exists.
   568    rpc CreateRepo(CreateRepoRequest) returns (google.protobuf.Empty) {}
   569    // InspectRepo returns info about a repo.
   570    rpc InspectRepo(InspectRepoRequest) returns (RepoInfo) {}
   571    // ListRepo returns info about all repos.
   572    rpc ListRepo(ListRepoRequest) returns (ListRepoResponse) {}
   573    // DeleteRepo deletes a repo.
   574    rpc DeleteRepo(DeleteRepoRequest) returns (google.protobuf.Empty) {}
   575  
   576    // Commit rpcs
   577    // StartCommit creates a new write commit from a parent commit.
   578    rpc StartCommit(StartCommitRequest) returns (Commit) {}
   579    // FinishCommit turns a write commit into a read commit.
   580    rpc FinishCommit(FinishCommitRequest) returns (google.protobuf.Empty) {}
   581    // InspectCommit returns the info about a commit.
   582    rpc InspectCommit(InspectCommitRequest) returns (CommitInfo) {}
   583    // ListCommit returns info about all commits. This is deprecated in favor of
   584    // ListCommitStream.
   585    rpc ListCommit(ListCommitRequest) returns (CommitInfos) {}
   586    // ListCommitStream is like ListCommit, but returns its results in a GRPC stream
   587    rpc ListCommitStream(ListCommitRequest) returns (stream CommitInfo) {}
   588    // DeleteCommit deletes a commit.
   589    rpc DeleteCommit(DeleteCommitRequest) returns (google.protobuf.Empty) {}
   590    // FlushCommit waits for downstream commits to finish
   591    rpc FlushCommit(FlushCommitRequest) returns (stream CommitInfo) {}
   592    // SubscribeCommit subscribes for new commits on a given branch
   593    rpc SubscribeCommit(SubscribeCommitRequest) returns (stream CommitInfo) {}
   594    // BuildCommit builds a commit that's backed by the given tree
   595    rpc BuildCommit(BuildCommitRequest) returns (Commit) {}
   596  
   597    // CreateBranch creates a new branch
   598    rpc CreateBranch(CreateBranchRequest) returns (google.protobuf.Empty) {}
   599    // InspectBranch returns info about a branch.
   600    rpc InspectBranch(InspectBranchRequest) returns (BranchInfo) {}
   601    // ListBranch returns info about the heads of branches.
   602    rpc ListBranch(ListBranchRequest) returns (BranchInfos) {}
   603    // DeleteBranch deletes a branch; note that the commits still exist.
   604    rpc DeleteBranch(DeleteBranchRequest) returns (google.protobuf.Empty) {}
   605  
   606    // File rpcs
   607    // PutFile writes the specified file to pfs.
   608    rpc PutFile(stream PutFileRequest) returns (google.protobuf.Empty) {}
   609    // CopyFile copies the contents of one file to another.
   610    rpc CopyFile(CopyFileRequest) returns (google.protobuf.Empty) {}
   611    // GetFile returns a byte stream of the contents of the file.
   612    rpc GetFile(GetFileRequest) returns (stream google.protobuf.BytesValue) {}
   613    // InspectFile returns info about a file.
   614    rpc InspectFile(InspectFileRequest) returns (FileInfo) {}
   615    // ListFile returns info about all files. This is deprecated in favor of
   616    // ListFileStream
   617    rpc ListFile(ListFileRequest) returns (FileInfos) {}
   618    // ListFileStream is a streaming version of ListFile
   619    // TODO(msteffen): When the dash has been updated to use ListFileStream,
   620    // replace ListFile with this RPC (https://github.com/pachyderm/dash/issues/201)
   621    rpc ListFileStream(ListFileRequest) returns (stream FileInfo) {}
   622    // WalkFile walks over all the files under a directory, including children of children.
   623    rpc WalkFile(WalkFileRequest) returns (stream FileInfo) {}
   624    // GlobFile returns info about all files. This is deprecated in favor of
   625    // GlobFileStream
   626    rpc GlobFile(GlobFileRequest) returns (FileInfos) {}
   627    // GlobFileStream is a streaming version of GlobFile
   628    // TODO(msteffen): When the dash has been updated to use GlobFileStream,
   629    // replace GlobFile with this RPC (https://github.com/pachyderm/dash/issues/201)
   630    rpc GlobFileStream(GlobFileRequest) returns (stream FileInfo) {}
   631    // DiffFile returns the differences between 2 paths at 2 commits.
   632    rpc DiffFile(DiffFileRequest) returns (DiffFileResponse) {}
   633    // DeleteFile deletes a file.
   634    rpc DeleteFile(DeleteFileRequest) returns (google.protobuf.Empty) {}
   635  
   636    // DeleteAll deletes everything
   637    rpc DeleteAll(google.protobuf.Empty) returns (google.protobuf.Empty) {}
   638    // Fsck does a file system consistency check for pfs
   639    rpc Fsck(FsckRequest) returns (stream FsckResponse) {}
   640  
   641    // RPCs specific to Pachyderm 2.
   642    rpc FileOperationV2(stream FileOperationRequestV2) returns (google.protobuf.Empty) {}
   643    rpc GetTarV2(GetTarRequestV2) returns (stream google.protobuf.BytesValue) {}
   644    // Refer to the GetTarConditionalRequest / GetTarConditionalResponse message definitions for the protocol.
   645    rpc GetTarConditionalV2(stream GetTarConditionalRequestV2) returns (stream GetTarConditionalResponseV2) {}
   646    rpc ListFileV2(ListFileRequest) returns (stream FileInfoV2) {}
   647    rpc GlobFileV2(GlobFileRequest) returns (stream FileInfoV2) {}
   648  }
   649  
   650  message PutObjectRequest {
   651    bytes value = 1;
   652    repeated Tag tags = 2;
   653    Block block = 3;
   654  }
   655  
   656  message CreateObjectRequest {
   657    Object object = 1;
   658    BlockRef block_ref = 2;
   659  }
   660  
   661  message GetObjectsRequest {
   662    repeated Object objects = 1;
   663    uint64 offset_bytes = 2;
   664    // The number of bytes requested.
   665    uint64 size_bytes = 3;
   666    // The total amount of bytes in these objects.  It's OK if it's not
   667    // entirely accurate or if it's unknown (in which case it'd be set to 0).
   668    // It's used primarily as a hint for cache eviction.
   669    uint64 total_size = 4;
   670  }
   671  
   672  message PutBlockRequest {
   673    Block block = 1;
   674    bytes value = 2;
   675  }
   676  
   677  message GetBlockRequest {
   678    Block block = 1;
   679  }
   680  
   681  message GetBlocksRequest {
   682    repeated BlockRef blockRefs = 1;
   683    uint64 offset_bytes = 2;
   684    // The number of bytes requested.
   685    uint64 size_bytes = 3;
   686    // The total amount of bytes in these blocks.  It's OK if it's not
   687    // entirely accurate or if it's unknown (in which case it'd be set to 0).
   688    // It's used primarily as a hint for cache eviction.
   689    uint64 total_size = 4;
   690  }
   691  
   692  message ListBlockRequest {}
   693  
   694  message TagObjectRequest {
   695    Object object = 1;
   696    repeated Tag tags = 2;
   697  }
   698  
   699  message ListObjectsRequest {}
   700  
   701  message ListTagsRequest {
   702    string prefix = 1;
   703    bool include_object = 2;
   704  }
   705  
   706  message ListTagsResponse {
   707    Tag tag = 1;
   708    Object object = 2;
   709  }
   710  
   711  message DeleteObjectsRequest {
   712    repeated Object objects = 1;
   713  }
   714  
   715  message DeleteObjectsResponse {}
   716  
   717  message DeleteTagsRequest {
   718    repeated Tag tags = 1;
   719  }
   720  
   721  message DeleteTagsResponse {}
   722  
   723  message CheckObjectRequest {
   724    Object object = 1;
   725  }
   726  
   727  message CheckObjectResponse {
   728    bool exists = 1;
   729  }
   730  
   731  message Objects {
   732    repeated Object objects = 1;
   733  }
   734  
   735  message PutObjDirectRequest {
   736      string obj = 1;
   737      bytes value = 2;
   738  }
   739  
   740  message GetObjDirectRequest {
   741      string obj = 1;
   742  }
   743  
   744  service ObjectAPI {
   745    rpc PutObject(stream PutObjectRequest) returns (Object) {}
   746    rpc PutObjectSplit(stream PutObjectRequest) returns (Objects) {}
   747    rpc PutObjects(stream PutObjectRequest) returns (google.protobuf.Empty) {}
   748    rpc CreateObject(CreateObjectRequest) returns (google.protobuf.Empty) {}
   749    rpc GetObject(Object) returns (stream google.protobuf.BytesValue) {}
   750    rpc GetObjects(GetObjectsRequest) returns (stream google.protobuf.BytesValue) {}
   751    rpc PutBlock(stream PutBlockRequest) returns (google.protobuf.Empty) {}
   752    rpc GetBlock(GetBlockRequest) returns (stream google.protobuf.BytesValue) {}
   753    rpc GetBlocks(GetBlocksRequest) returns (stream google.protobuf.BytesValue) {}
   754    rpc ListBlock(ListBlockRequest) returns (stream Block) {}
   755    rpc TagObject(TagObjectRequest) returns (google.protobuf.Empty) {}
   756    rpc InspectObject(Object) returns (ObjectInfo) {}
   757    // CheckObject checks if an object exists in the blob store without
   758    // actually reading the object.
   759    rpc CheckObject(CheckObjectRequest) returns (CheckObjectResponse) {}
   760    rpc ListObjects(ListObjectsRequest) returns (stream ObjectInfo) {}
   761    rpc DeleteObjects(DeleteObjectsRequest) returns (DeleteObjectsResponse) {}
   762    rpc GetTag(Tag) returns (stream google.protobuf.BytesValue) {}
   763    rpc InspectTag(Tag) returns (ObjectInfo) {}
   764    rpc ListTags(ListTagsRequest) returns (stream ListTagsResponse) {}
   765    rpc DeleteTags(DeleteTagsRequest) returns (DeleteTagsResponse) {}
   766    rpc Compact(google.protobuf.Empty) returns (google.protobuf.Empty) {}
   767    // PutObjDirect puts an obj directly into object store, bypassing the content
   768    // addressing layer.
   769    rpc PutObjDirect(stream PutObjDirectRequest) returns (google.protobuf.Empty) {}
   770    // GetObjDirect gets an obj directly out of object store, bypassing the
   771    // content addressing layer.
   772    rpc GetObjDirect(GetObjDirectRequest) returns (stream google.protobuf.BytesValue) {}
   773  }
   774  
   775  message ObjectIndex {
   776    map<string, BlockRef> objects = 1;
   777    map<string, Object> tags = 2;
   778  }
   779