github.com/pachyderm/pachyderm@v1.13.4/src/client/admin/v1_7/pfs/pfs.proto (about) 1 syntax = "proto3"; 2 3 package pfs_1_7; 4 option go_package = "github.com/pachyderm/pachyderm/src/client/admin/v1_7/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_7/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/admin/v1_7/auth/auth.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/admin/v1_7/auth/auth.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_7.Scope access_level = 1; 80 } 81 82 // Commit is a reference to a commit (e.g. the collection of branches and the 83 // collection of currently-open commits in etcd are collections of Commit 84 // protos) 85 message Commit { 86 Repo repo = 1; 87 string id = 2 [(gogoproto.customname) = "ID"]; 88 } 89 90 // CommitRange represents chain of commits with Lower being an ancestor of 91 // Upper or, in the case of a range of size 1, the same commit. 92 message CommitRange { 93 Commit lower = 1; 94 Commit upper = 2; 95 } 96 97 // CommitInfo is the main data structure representing a commit in etcd 98 message CommitInfo { 99 Commit commit = 1; 100 // description is a user-provided script describing this commit 101 string description = 8; 102 Commit parent_commit = 2; 103 repeated Commit child_commits = 11; 104 google.protobuf.Timestamp started = 3; 105 google.protobuf.Timestamp finished = 4; 106 uint64 size_bytes = 5; 107 108 // Commits on which this commit is provenant. provenance[i] is a commit in 109 // branch_provenance[i] (a branch name, and one of the branches on which this 110 // commit's branch is provenant) 111 repeated Commit provenance = 6; 112 repeated Branch branch_provenance = 10; 113 114 // ReadyProvenance is the number of provenant commits which have been 115 // finished, if ReadyProvenance == len(Provenance) then the commit is ready 116 // to be processed by pps. 117 int64 ready_provenance = 12; 118 119 repeated CommitRange subvenance = 9; 120 // this is the block that stores the serialized form of a tree that 121 // represents the entire file system hierarchy of the repo at this commit 122 // If this is nil, then the commit is either open (in which case 'finished' 123 // will also be nil) or is the output commit of a failed job (in which case 124 // 'finished' will have a value -- the end time of the job) 125 Object tree = 7; 126 } 127 128 enum FileType { 129 RESERVED = 0; 130 FILE = 1; 131 DIR = 2; 132 } 133 134 message FileInfo { 135 File file = 1; 136 FileType file_type = 2; 137 uint64 size_bytes = 3; 138 // the base names (i.e. just the filenames, not the full paths) of 139 // the children 140 repeated string children = 6; 141 repeated Object objects = 8; 142 bytes hash = 7; 143 } 144 145 message ByteRange { 146 uint64 lower = 1; 147 uint64 upper = 2; 148 } 149 150 message BlockRef { 151 Block block = 1; 152 ByteRange range = 2; 153 } 154 155 message ObjectInfo { 156 Object object = 1; 157 BlockRef block_ref = 2; 158 } 159 160 // PFS API 161 162 message CreateRepoRequest { 163 reserved 2; 164 Repo repo = 1; 165 string description = 3; 166 bool update = 4; 167 } 168 169 message InspectRepoRequest { 170 Repo repo = 1; 171 } 172 173 message ListRepoRequest { 174 reserved 1; 175 } 176 177 message ListRepoResponse { 178 repeated RepoInfo repo_info = 1; 179 } 180 181 message DeleteRepoRequest { 182 Repo repo = 1; 183 bool force = 2; 184 bool all = 3; 185 } 186 187 // CommitState describes the states a commit can be in. 188 // The states are increasingly specific, i.e. a commit that is FINISHED also counts as STARTED. 189 enum CommitState { 190 STARTED = 0; // The commit has been started, all commits satisfy this state. 191 READY = 1; // The commit has been started, and all of its provenant commits have been finished. 192 FINISHED = 2; // The commit has been finished. 193 } 194 195 message StartCommitRequest { 196 // Parent.ID may be empty in which case the commit that Branch points to will be used as the parent. 197 // If branch is empty, or if branch does not exist, the commit will have no parent. 198 Commit parent = 1; 199 // description is a user-provided string describing this commit 200 string description = 4; 201 string branch = 3; 202 repeated Commit provenance = 2; 203 } 204 205 message BuildCommitRequest { 206 Commit parent = 1; 207 string branch = 4; 208 repeated Commit provenance = 2; 209 Object tree = 3; 210 // ID sets the ID of the created commit. 211 string ID = 5; 212 } 213 214 message FinishCommitRequest { 215 Commit commit = 1; 216 // description is a user-provided string describing this commit. Setting this 217 // will overwrite the description set in StartCommit 218 string description = 2; 219 220 Object tree = 3; 221 // If set, 'commit' will be closed (its 'finished' field will be set to the 222 // current time) but its 'tree' will be left nil. 223 bool empty = 4; 224 } 225 226 message InspectCommitRequest { 227 Commit commit = 1; 228 // BlockState causes inspect commit to block until the commit is in the desired state. 229 CommitState block_state = 2; 230 } 231 232 message ListCommitRequest { 233 Repo repo = 1; 234 Commit from = 2; 235 Commit to = 3; 236 uint64 number = 4; 237 } 238 239 message CommitInfos { 240 repeated CommitInfo commit_info = 1; 241 } 242 243 message CreateBranchRequest { 244 Commit head = 1; 245 // s_branch matches the field number and type of SetBranchRequest.Branch in 246 // Pachyderm 1.6--so that operations (generated by pachyderm 1.6's 247 // Admin.Export) can be deserialized by pachyderm 1.7 correctly 248 string s_branch = 2; 249 Branch branch = 3; 250 repeated Branch provenance = 4; 251 } 252 253 message InspectBranchRequest { 254 Branch branch = 1; 255 } 256 257 message ListBranchRequest { 258 Repo repo = 1; 259 } 260 261 message DeleteBranchRequest { 262 Branch branch = 1; 263 bool force = 2; 264 } 265 266 message DeleteCommitRequest { 267 Commit commit = 1; 268 } 269 270 message FlushCommitRequest { 271 repeated Commit commits = 1; 272 repeated Repo to_repos = 2; 273 } 274 275 message SubscribeCommitRequest { 276 Repo repo = 1; 277 string branch = 2; 278 // only commits created since this commit are returned 279 Commit from = 3; 280 // Don't return commits until they're in (at least) the desired state. 281 CommitState state = 4; 282 } 283 284 message GetFileRequest { 285 File file = 1; 286 int64 offset_bytes = 2; 287 int64 size_bytes = 3; 288 } 289 290 enum Delimiter { 291 NONE = 0; 292 JSON = 1; 293 LINE = 2; 294 SQL = 3; 295 } 296 297 // An OverwriteIndex specifies the index of objects from which new writes 298 // are applied to. Existing objects starting from the index are deleted. 299 // We want a separate message for ObjectIndex because we want to be able to 300 // distinguish between a zero index and a non-existent index. 301 message OverwriteIndex { 302 int64 index = 1; 303 } 304 305 // Metadata struct allows us to distinguish between cases where header/footer 306 // are not specified vs explicitly empty 307 message Metadata { 308 bytes value = 1; 309 } 310 311 message PutFileRequest { 312 reserved 2; 313 File file = 1; 314 bytes value = 3; 315 string url = 5; 316 // applies only to URLs that can be recursively walked, for example s3:// URLs 317 bool recursive = 6; 318 // Delimiter causes data to be broken up into separate files with File.Path 319 // as a prefix. 320 Delimiter delimiter = 7; 321 // TargetFileDatums specifies the target number of datums in each written 322 // file it may be lower if data does not split evenly, but will never be 323 // higher, unless the value is 0. 324 int64 target_file_datums = 8; 325 // TargetFileBytes specifies the target number of bytes in each written 326 // file, files may have more or fewer bytes than the target. 327 int64 target_file_bytes = 9; 328 // overwrite_index is the object index where the write starts from. All 329 // existing objects starting from the index are deleted. 330 OverwriteIndex overwrite_index = 10; 331 Metadata header = 11; 332 Metadata footer = 12; 333 } 334 335 // PutFileRecord is used to record PutFile requests in etcd temporarily. 336 message PutFileRecord { 337 int64 size_bytes = 1; 338 string object_hash = 2; 339 OverwriteIndex overwrite_index = 3; 340 } 341 342 message PutFileRecords { 343 bool split = 1; 344 repeated PutFileRecord records = 2; 345 bool tombstone = 3; 346 PutFileRecord header = 4; 347 PutFileRecord footer = 5; 348 } 349 350 message CopyFileRequest { 351 File src = 1; 352 File dst = 2; 353 bool overwrite = 3; 354 } 355 356 message InspectFileRequest { 357 File file = 1; 358 } 359 360 message ListFileRequest { 361 // File is the parent directory of the files we want to list. This fixes the 362 // repo, the commit/branch, and path prefix of files we're interested it 363 File file = 1; 364 365 // Full indicates whether the result should include file contents, which may 366 // be large (i.e. the list of children for directories, and the list of object 367 // references for regular files) 368 bool full = 2; 369 } 370 371 message GlobFileRequest { 372 Commit commit = 1; 373 string pattern = 2; 374 } 375 376 // FileInfos is the result of both ListFile and GlobFile 377 message FileInfos { 378 repeated FileInfo file_info = 1; 379 } 380 381 message DiffFileRequest { 382 File new_file = 1; 383 // OldFile may be left nil in which case the same path in the parent of 384 // NewFile's commit will be used. 385 File old_file = 2; 386 bool shallow = 3; 387 } 388 389 message DiffFileResponse { 390 repeated FileInfo new_files = 1; 391 repeated FileInfo old_files = 2; 392 } 393 394 message DeleteFileRequest { 395 File file = 1; 396 } 397 398 service API { 399 // Repo rpcs 400 // CreateRepo creates a new repo. 401 // An error is returned if the repo already exists. 402 rpc CreateRepo(CreateRepoRequest) returns (google.protobuf.Empty) {} 403 // InspectRepo returns info about a repo. 404 rpc InspectRepo(InspectRepoRequest) returns (RepoInfo) {} 405 // ListRepo returns info about all repos. 406 rpc ListRepo(ListRepoRequest) returns (ListRepoResponse) {} 407 // DeleteRepo deletes a repo. 408 rpc DeleteRepo(DeleteRepoRequest) returns (google.protobuf.Empty) {} 409 410 // Commit rpcs 411 // StartCommit creates a new write commit from a parent commit. 412 rpc StartCommit(StartCommitRequest) returns (Commit) {} 413 // FinishCommit turns a write commit into a read commit. 414 rpc FinishCommit(FinishCommitRequest) returns (google.protobuf.Empty) {} 415 // InspectCommit returns the info about a commit. 416 rpc InspectCommit(InspectCommitRequest) returns (CommitInfo) {} 417 // ListCommit returns info about all commits. This is deprecated in favor of 418 // ListCommitStream. 419 rpc ListCommit(ListCommitRequest) returns (CommitInfos) {} 420 // ListCommitStream is like ListCommit, but returns its results in a GRPC stream 421 rpc ListCommitStream(ListCommitRequest) returns (stream CommitInfo) {} 422 // DeleteCommit deletes a commit. 423 rpc DeleteCommit(DeleteCommitRequest) returns (google.protobuf.Empty) {} 424 // FlushCommit waits for downstream commits to finish 425 rpc FlushCommit(FlushCommitRequest) returns (stream CommitInfo) {} 426 // SubscribeCommit subscribes for new commits on a given branch 427 rpc SubscribeCommit(SubscribeCommitRequest) returns (stream CommitInfo) {} 428 // BuildCommit builds a commit that's backed by the given tree 429 rpc BuildCommit(BuildCommitRequest) returns (Commit) {} 430 431 // CreateBranch creates a new branch 432 rpc CreateBranch(CreateBranchRequest) returns (google.protobuf.Empty) {} 433 // InspectBranch returns info about a branch. 434 rpc InspectBranch(InspectBranchRequest) returns (BranchInfo) {} 435 // ListBranch returns info about the heads of branches. 436 rpc ListBranch(ListBranchRequest) returns (BranchInfos) {} 437 // DeleteBranch deletes a branch; note that the commits still exist. 438 rpc DeleteBranch(DeleteBranchRequest) returns (google.protobuf.Empty) {} 439 440 // File rpcs 441 // PutFile writes the specified file to pfs. 442 rpc PutFile(stream PutFileRequest) returns (google.protobuf.Empty) {} 443 // CopyFile copies the contents of one file to another. 444 rpc CopyFile(CopyFileRequest) returns (google.protobuf.Empty) {} 445 // GetFile returns a byte stream of the contents of the file. 446 rpc GetFile(GetFileRequest) returns (stream google.protobuf.BytesValue) {} 447 // InspectFile returns info about a file. 448 rpc InspectFile(InspectFileRequest) returns (FileInfo) {} 449 // ListFile returns info about all files. This is deprecated in favor of 450 // ListFileStream 451 rpc ListFile(ListFileRequest) returns (FileInfos) {} 452 // ListFileStream is a streaming version of ListFile 453 // TODO(msteffen): When the dash has been updated to use ListFileStream, 454 // replace ListFile with this RPC (https://github.com/pachyderm/dash/issues/201) 455 rpc ListFileStream(ListFileRequest) returns (stream FileInfo) {} 456 // GlobFile returns info about all files. This is deprecated in favor of 457 // GlobFileStream 458 rpc GlobFile(GlobFileRequest) returns (FileInfos) {} 459 // GlobFileStream is a streaming version of GlobFile 460 // TODO(msteffen): When the dash has been updated to use GlobFileStream, 461 // replace GlobFile with this RPC (https://github.com/pachyderm/dash/issues/201) 462 rpc GlobFileStream(GlobFileRequest) returns (stream FileInfo) {} 463 // DiffFile returns the differences between 2 paths at 2 commits. 464 rpc DiffFile(DiffFileRequest) returns (DiffFileResponse) {} 465 // DeleteFile deletes a file. 466 rpc DeleteFile(DeleteFileRequest) returns (google.protobuf.Empty) {} 467 468 // DeleteAll deletes everything 469 rpc DeleteAll(google.protobuf.Empty) returns (google.protobuf.Empty) {} 470 } 471 472 message PutObjectRequest { 473 bytes value = 1; 474 repeated Tag tags = 2; 475 } 476 477 message GetObjectsRequest { 478 repeated Object objects = 1; 479 uint64 offset_bytes = 2; 480 // The number of bytes we intend to read. 481 uint64 size_bytes = 3; 482 // The total amount of bytes in these objects. It's OK if it's not 483 // entirely accurate or if it's unknown (in which case it'd be set to 0). 484 // It's used primarily as a hint for cache eviction. 485 uint64 total_size = 4; 486 } 487 488 message TagObjectRequest { 489 Object object = 1; 490 repeated Tag tags = 2; 491 } 492 493 message ListObjectsRequest {} 494 495 message ListTagsRequest { 496 string prefix = 1; 497 bool include_object = 2; 498 } 499 500 message ListTagsResponse { 501 Tag tag = 1; 502 Object object = 2; 503 } 504 505 message DeleteObjectsRequest { 506 repeated Object objects = 1; 507 } 508 509 message DeleteObjectsResponse {} 510 511 message DeleteTagsRequest { 512 repeated Tag tags = 1; 513 } 514 515 message DeleteTagsResponse {} 516 517 message CheckObjectRequest { 518 Object object = 1; 519 } 520 521 message CheckObjectResponse { 522 bool exists = 1; 523 } 524 525 message Objects { 526 repeated Object objects = 1; 527 } 528 529 service ObjectAPI { 530 rpc PutObject(stream PutObjectRequest) returns (Object) {} 531 rpc PutObjectSplit(stream PutObjectRequest) returns (Objects) {} 532 rpc GetObject(Object) returns (stream google.protobuf.BytesValue) {} 533 rpc GetObjects(GetObjectsRequest) returns (stream google.protobuf.BytesValue) {} 534 rpc TagObject(TagObjectRequest) returns (google.protobuf.Empty) {} 535 rpc InspectObject(Object) returns (ObjectInfo) {} 536 // CheckObject checks if an object exists in the blob store without 537 // actually reading the object. 538 rpc CheckObject(CheckObjectRequest) returns (CheckObjectResponse) {} 539 rpc ListObjects(ListObjectsRequest) returns (stream Object) {} 540 rpc DeleteObjects(DeleteObjectsRequest) returns (DeleteObjectsResponse) {} 541 rpc GetTag(Tag) returns (stream google.protobuf.BytesValue) {} 542 rpc InspectTag(Tag) returns (ObjectInfo) {} 543 rpc ListTags(ListTagsRequest) returns (stream ListTagsResponse) {} 544 rpc DeleteTags(DeleteTagsRequest) returns (DeleteTagsResponse) {} 545 rpc Compact(google.protobuf.Empty) returns (google.protobuf.Empty) {} 546 } 547 548 message ObjectIndex { 549 map<string, BlockRef> objects = 1; 550 map<string, Object> tags = 2; 551 } 552