syntax = "proto3"; package gitaly; option go_package = "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"; import "lint.proto"; import "shared.proto"; service RepositoryService { rpc RepositoryExists(RepositoryExistsRequest) returns (RepositoryExistsResponse) { option (op_type) = { op: ACCESSOR }; } rpc RepackIncremental(RepackIncrementalRequest) returns (RepackIncrementalResponse) { option (op_type) = { op: MUTATOR }; } rpc RepackFull(RepackFullRequest) returns (RepackFullResponse) { option (op_type) = { op: MUTATOR }; } rpc MidxRepack(MidxRepackRequest) returns (MidxRepackResponse) { option (op_type) = { op: MUTATOR }; } rpc GarbageCollect(GarbageCollectRequest) returns (GarbageCollectResponse) { option (op_type) = { op: MUTATOR }; } rpc WriteCommitGraph(WriteCommitGraphRequest) returns (WriteCommitGraphResponse) { option (op_type) = { op: MUTATOR }; } rpc RepositorySize(RepositorySizeRequest) returns (RepositorySizeResponse) { option (op_type) = { op: ACCESSOR }; } rpc ApplyGitattributes(ApplyGitattributesRequest) returns (ApplyGitattributesResponse) { option (op_type) = { op: MUTATOR }; } rpc FetchRemote(FetchRemoteRequest) returns (FetchRemoteResponse) { option (op_type) = { op: MUTATOR }; } rpc CreateRepository(CreateRepositoryRequest) returns (CreateRepositoryResponse) { option (op_type) = { op: MUTATOR }; } rpc GetArchive(GetArchiveRequest) returns (stream GetArchiveResponse) { option (op_type) = { op: MUTATOR }; } rpc HasLocalBranches(HasLocalBranchesRequest) returns (HasLocalBranchesResponse) { option (op_type) = { op: ACCESSOR }; } rpc FetchSourceBranch(FetchSourceBranchRequest) returns (FetchSourceBranchResponse) { option (op_type) = { op: MUTATOR }; } rpc Fsck(FsckRequest) returns (FsckResponse) { option (op_type) = { op: MUTATOR }; } rpc WriteRef(WriteRefRequest) returns (WriteRefResponse) { option (op_type) = { op: MUTATOR }; } rpc FindMergeBase(FindMergeBaseRequest) returns (FindMergeBaseResponse) { option (op_type) = { op: ACCESSOR }; } rpc CreateFork(CreateForkRequest) returns (CreateForkResponse) { option (op_type) = { op: MUTATOR }; } rpc IsRebaseInProgress(IsRebaseInProgressRequest) returns (IsRebaseInProgressResponse) { option (op_type) = { op: ACCESSOR }; } rpc IsSquashInProgress(IsSquashInProgressRequest) returns (IsSquashInProgressResponse) { option (op_type) = { op: ACCESSOR }; } rpc CreateRepositoryFromURL(CreateRepositoryFromURLRequest) returns (CreateRepositoryFromURLResponse) { option (op_type) = { op: MUTATOR }; } rpc CreateBundle(CreateBundleRequest) returns (stream CreateBundleResponse) { option (op_type) = { op: ACCESSOR }; } rpc CreateRepositoryFromBundle(stream CreateRepositoryFromBundleRequest) returns (CreateRepositoryFromBundleResponse) { option (op_type) = { op: MUTATOR }; } rpc SetConfig(SetConfigRequest) returns (SetConfigResponse) { option (op_type) = { op: MUTATOR }; } rpc DeleteConfig(DeleteConfigRequest) returns (DeleteConfigResponse) { option (op_type) = { op: MUTATOR }; } rpc FindLicense(FindLicenseRequest) returns (FindLicenseResponse) { option (op_type) = { op: ACCESSOR }; } rpc GetInfoAttributes(GetInfoAttributesRequest) returns (stream GetInfoAttributesResponse) { option (op_type) = { op: ACCESSOR }; } rpc CalculateChecksum(CalculateChecksumRequest) returns (CalculateChecksumResponse) { option (op_type) = { op: ACCESSOR }; } rpc Cleanup(CleanupRequest) returns (CleanupResponse) { option (op_type) = { op: MUTATOR }; } rpc GetSnapshot(GetSnapshotRequest) returns (stream GetSnapshotResponse) { option (op_type) = { op: ACCESSOR }; } rpc CreateRepositoryFromSnapshot(CreateRepositoryFromSnapshotRequest) returns (CreateRepositoryFromSnapshotResponse) { option (op_type) = { op: MUTATOR }; } rpc GetRawChanges(GetRawChangesRequest) returns (stream GetRawChangesResponse) { option (op_type) = { op: ACCESSOR }; } rpc SearchFilesByContent(SearchFilesByContentRequest) returns (stream SearchFilesByContentResponse) { option (op_type) = { op: ACCESSOR }; } rpc SearchFilesByName(SearchFilesByNameRequest) returns (stream SearchFilesByNameResponse) { option (op_type) = { op: ACCESSOR }; } rpc RestoreCustomHooks(stream RestoreCustomHooksRequest) returns (RestoreCustomHooksResponse) { option (op_type) = { op: MUTATOR }; } rpc BackupCustomHooks(BackupCustomHooksRequest) returns (stream BackupCustomHooksResponse) { option (op_type) = { op: ACCESSOR }; } rpc FetchHTTPRemote(FetchHTTPRemoteRequest) returns (FetchHTTPRemoteResponse) { option (op_type) = { op: MUTATOR }; } rpc GetObjectDirectorySize(GetObjectDirectorySizeRequest) returns (GetObjectDirectorySizeResponse) { option (op_type) = { op: ACCESSOR }; } rpc CloneFromPool(CloneFromPoolRequest) returns (CloneFromPoolResponse) { option (op_type) = { op: MUTATOR }; } rpc CloneFromPoolInternal(CloneFromPoolInternalRequest) returns (CloneFromPoolInternalResponse) { option (op_type) = { op: MUTATOR }; } rpc RemoveRepository(RemoveRepositoryRequest) returns (RemoveRepositoryResponse) { option (op_type) = { op: MUTATOR }; } rpc RenameRepository(RenameRepositoryRequest) returns (RenameRepositoryResponse) { option (op_type) = { op: MUTATOR }; } rpc ReplicateRepository(ReplicateRepositoryRequest) returns (ReplicateRepositoryResponse) { option (op_type) = { op: MUTATOR }; } rpc OptimizeRepository(OptimizeRepositoryRequest) returns (OptimizeRepositoryResponse) { option (op_type) = { op: MUTATOR }; } } message RepositoryExistsRequest { Repository repository = 1 [(target_repository)=true]; } message RepositoryExistsResponse { bool exists = 1; } message RepackIncrementalRequest { Repository repository = 1 [(target_repository)=true]; } message RepackIncrementalResponse {} message RepackFullRequest { Repository repository = 1 [(target_repository)=true]; bool create_bitmap = 2; } message RepackFullResponse {} message MidxRepackRequest { Repository repository = 1 [(target_repository)=true]; } message MidxRepackResponse {} message GarbageCollectRequest { Repository repository = 1 [(target_repository)=true]; bool create_bitmap = 2; // If set to 'true' the 'gc' will be triggered with '--prune=24.hours.ago' flag. // This will remove dangling objects from the object storage that were not modified in the last 24 hours. // If 'false' provided the 'gc' will rely on the default expiration period (2 weeks). // The window of 24 hours exists because of possible concurrent operations running on the same // storage and removal of the objects may cause races and fail concurrent operations. bool prune = 3; } message GarbageCollectResponse {} message WriteCommitGraphRequest { Repository repository = 1 [(target_repository)=true]; } message WriteCommitGraphResponse {} message CleanupRequest { Repository repository = 1 [(target_repository)=true]; } message CleanupResponse {} message RepositorySizeRequest { Repository repository = 1 [(target_repository)=true]; } message RepositorySizeResponse { // Repository size in kilobytes int64 size = 1; } message ApplyGitattributesRequest { Repository repository = 1 [(target_repository)=true]; bytes revision = 2; } message ApplyGitattributesResponse {} message FetchRemoteRequest { Repository repository = 1 [(target_repository)=true]; string remote = 2; bool force = 3; bool no_tags = 4; int32 timeout = 5; string ssh_key = 6; string known_hosts = 7; reserved 8; bool no_prune = 9; Remote remote_params = 10; } message FetchRemoteResponse {} message CreateRepositoryRequest { Repository repository = 1 [(target_repository)=true]; } message CreateRepositoryResponse {} message GetArchiveRequest { enum Format { ZIP = 0; TAR = 1; TAR_GZ = 2; TAR_BZ2 = 3; } Repository repository = 1 [(target_repository)=true]; string commit_id = 2; string prefix = 3; Format format = 4; bytes path = 5; repeated bytes exclude = 6; // If `elide_path` is true and `path` refers to a subdirectory, that // subdirectory will be elided from archive entries. For example, if `dir` // contains `README.md`, with `elide_path = false` the corresponding entry // will be `dir/README.md`; with `elide_path = true`, the entry will be // `README.md`. `elide_path` has no effect if `path` refers to the repository // root. `elide_path = true` is not supported if `path` refers to a file. bool elide_path = 7; bool include_lfs_blobs = 8; } message GetArchiveResponse { bytes data = 1; } message HasLocalBranchesRequest { Repository repository = 1 [(target_repository)=true]; } message HasLocalBranchesResponse { bool value = 1; } message FetchSourceBranchRequest { Repository repository = 1 [(target_repository)=true]; Repository source_repository = 2; bytes source_branch = 3; bytes target_ref = 4; } message FetchSourceBranchResponse { bool result = 1; } message FsckRequest { Repository repository = 1 [(target_repository)=true]; } message FsckResponse { bytes error = 1; } message WriteRefRequest { Repository repository = 1 [(target_repository)=true]; bytes ref = 2; bytes revision = 3; bytes old_revision = 4; bool force = 5; // This used to be a boolean indicating whether or not to shell out or use // the rugged implementation reserved 6; } message WriteRefResponse { // This used to contain an error message. Since we're shelling out // all exceptions are wrapped in GRPC errors. reserved 1; } message FindMergeBaseRequest { Repository repository = 1 [(target_repository)=true]; // We use a repeated field because rugged supports finding a base // for more than 2 revisions, so if we needed that in the future we don't // need to change the protocol. repeated bytes revisions = 2; } message FindMergeBaseResponse { string base = 1; } message CreateForkRequest { Repository repository = 1 [(target_repository)=true]; Repository source_repository = 2; } message CreateForkResponse {} message IsRebaseInProgressRequest { Repository repository = 1 [(target_repository)=true]; string rebase_id = 2; } message IsRebaseInProgressResponse { bool in_progress = 1; } message IsSquashInProgressRequest { Repository repository = 1 [(target_repository)=true]; string squash_id = 2; } message IsSquashInProgressResponse { bool in_progress = 1; } message CreateRepositoryFromURLRequest { Repository repository = 1 [(target_repository)=true]; string url = 2; } message CreateRepositoryFromURLResponse {} message CreateBundleRequest { Repository repository = 1 [(target_repository)=true]; } message CreateBundleResponse { bytes data = 1; } message SetConfigRequest { Repository repository = 1 [(target_repository)=true]; message Entry { string key = 1; oneof value { string value_str = 2; int32 value_int32 = 3; bool value_bool = 4; } } repeated Entry entries = 2; } message SetConfigResponse {} message DeleteConfigRequest { Repository repository = 1 [(target_repository)=true]; repeated string keys = 2; } message DeleteConfigResponse {} message RestoreCustomHooksRequest { Repository repository = 1 [(target_repository)=true]; bytes data = 2; } message RestoreCustomHooksResponse {} message BackupCustomHooksRequest { Repository repository = 1 [(target_repository)=true]; } message BackupCustomHooksResponse { bytes data = 1; } message CreateRepositoryFromBundleRequest { // Only available on the first message Repository repository = 1 [(target_repository)=true]; bytes data = 2; } message CreateRepositoryFromBundleResponse {} message FindLicenseRequest { Repository repository = 1 [(target_repository)=true]; } message FindLicenseResponse { string license_short_name = 1; } message GetInfoAttributesRequest { Repository repository = 1 [(target_repository)=true]; } message GetInfoAttributesResponse { bytes attributes = 1; } message CalculateChecksumRequest { Repository repository = 1 [(target_repository)=true]; } message CalculateChecksumResponse { string checksum = 1; } message GetSnapshotRequest { Repository repository = 1 [(target_repository)=true]; } message GetSnapshotResponse { bytes data = 1; } message CreateRepositoryFromSnapshotRequest { Repository repository = 1 [(target_repository)=true]; string http_url = 2; string http_auth = 3; } message CreateRepositoryFromSnapshotResponse {} message GetRawChangesRequest { Repository repository = 1 [(target_repository)=true]; string from_revision = 2; string to_revision = 3; } message GetRawChangesResponse { message RawChange { enum Operation { UNKNOWN = 0; ADDED = 1; COPIED = 2; DELETED = 3; MODIFIED = 4; RENAMED = 5; TYPE_CHANGED = 6; } string blob_id = 1; int64 size= 2; // use fields 9 and 10 in place of 3 and 4 (respectively) string new_path = 3 [deprecated=true]; string old_path = 4 [deprecated=true]; Operation operation= 5; string raw_operation = 6; int32 old_mode = 7; int32 new_mode = 8; // the following fields, 9 and 10, will eventually replace 3 and 4 bytes new_path_bytes = 9; bytes old_path_bytes = 10; } repeated RawChange raw_changes = 1; } message SearchFilesByNameRequest { Repository repository = 1 [(target_repository)=true]; string query = 2; bytes ref = 3; // If `filter` is specified and non-empty, it will be parsed as a regular // expression and used to filter the result set before it is transmitted. It is // parsed using Go's `regexp` package, which is closely related to PCRE, // excluding backreferences, atomic/possesive operators, and some other // features. It has a maximum length of 1000 bytes. string filter = 4; } message SearchFilesByNameResponse { repeated bytes files = 1; } message SearchFilesByContentRequest { Repository repository = 1 [(target_repository)=true]; string query = 2; bytes ref = 3; bool chunked_response = 4; } message SearchFilesByContentResponse { repeated bytes matches = 1; bytes match_data = 2; bool end_of_match = 3; } message Remote { string url = 1; string name = 2; string http_authorization_header = 3; repeated string mirror_refmaps = 4; } message FetchHTTPRemoteRequest { Repository repository = 1 [(target_repository)=true]; Remote remote = 2; int32 timeout = 3; } message FetchHTTPRemoteResponse {} message GetObjectDirectorySizeRequest { Repository repository = 1 [(target_repository)=true]; } message GetObjectDirectorySizeResponse { // Object directory size in kilobytes int64 size = 1; } message CloneFromPoolRequest { Repository repository = 1 [(target_repository)=true]; ObjectPool pool = 2; Remote remote = 3; } message CloneFromPoolResponse { } message CloneFromPoolInternalRequest { Repository repository = 1 [(target_repository)=true]; ObjectPool pool = 2; Repository source_repository = 3; } message CloneFromPoolInternalResponse { } message RemoveRepositoryRequest { Repository repository = 1 [(target_repository)=true]; } message RemoveRepositoryResponse { } message RenameRepositoryRequest { Repository repository = 1 [(target_repository)=true]; string relative_path = 2; } message RenameRepositoryResponse{ } message ReplicateRepositoryRequest { Repository repository = 1 [(target_repository)=true]; Repository source = 2; } message ReplicateRepositoryResponse{} message OptimizeRepositoryRequest { Repository repository = 1 [(target_repository)=true]; } message OptimizeRepositoryResponse{}