| 1 |
syntax = "proto3"; |
| 2 |
|
| 3 |
import "google/protobuf/empty.proto"; |
| 4 |
import "google/protobuf/timestamp.proto"; |
| 5 |
|
| 6 |
service CLI { |
| 7 |
rpc GetVersion (google.protobuf.Empty) returns (VersionReply) {} |
| 8 |
rpc Upgrade (google.protobuf.Empty) returns (google.protobuf.Empty) {} |
| 9 |
rpc Reload (google.protobuf.Empty) returns (google.protobuf.Empty) {} |
| 10 |
rpc ChangeStatus (ChangeStatusRequest) returns (google.protobuf.Empty) {} |
| 11 |
rpc List (google.protobuf.Empty) returns (MirrorListReply) {} |
| 12 |
rpc MirrorInfo (MirrorIDRequest) returns (Mirror) {} |
| 13 |
rpc AddMirror (Mirror) returns (AddMirrorReply) {} |
| 14 |
rpc UpdateMirror (Mirror) returns (UpdateMirrorReply) {} |
| 15 |
rpc RemoveMirror (MirrorIDRequest) returns (google.protobuf.Empty) {} |
| 16 |
rpc GeoUpdateMirror (MirrorIDRequest) returns (GeoUpdateMirrorReply) {} |
| 17 |
rpc RefreshRepository (RefreshRepositoryRequest) returns (google.protobuf.Empty) {} |
| 18 |
rpc ScanMirror (ScanMirrorRequest) returns (ScanMirrorReply) {} |
| 19 |
rpc StatsFile (StatsFileRequest) returns (StatsFileReply) {} |
| 20 |
rpc StatsMirror (StatsMirrorRequest) returns (StatsMirrorReply) {} |
| 21 |
rpc Ping (google.protobuf.Empty) returns (google.protobuf.Empty) {} |
| 22 |
rpc GetMirrorLogs (GetMirrorLogsRequest) returns (GetMirrorLogsReply) {} |
| 23 |
|
| 24 |
// Tools |
| 25 |
rpc MatchMirror (MatchRequest) returns (MatchReply) {} |
| 26 |
} |
| 27 |
|
| 28 |
message VersionReply { |
| 29 |
string Version = 1; |
| 30 |
string Build = 2; |
| 31 |
string GoVersion = 3; |
| 32 |
string OS = 4; |
| 33 |
string Arch = 5; |
| 34 |
int32 GoMaxProcs = 6; |
| 35 |
} |
| 36 |
|
| 37 |
message MatchRequest { |
| 38 |
string Pattern = 1; |
| 39 |
} |
| 40 |
|
| 41 |
message Mirror { |
| 42 |
int32 ID = 1; |
| 43 |
string Name = 2; |
| 44 |
string HttpURL = 3; |
| 45 |
string RsyncURL = 4; |
| 46 |
string FtpURL = 5; |
| 47 |
string SponsorName = 6; |
| 48 |
string SponsorURL = 7; |
| 49 |
string SponsorLogoURL = 8; |
| 50 |
string AdminName = 9; |
| 51 |
string AdminEmail = 10; |
| 52 |
string CustomData = 11; |
| 53 |
bool ContinentOnly = 12; |
| 54 |
bool CountryOnly = 13; |
| 55 |
bool ASOnly = 14; |
| 56 |
int32 Score = 15; |
| 57 |
float Latitude = 16; |
| 58 |
float Longitude = 17; |
| 59 |
string ContinentCode = 18; |
| 60 |
string CountryCodes = 19; |
| 61 |
string ExcludedCountryCodes = 20; |
| 62 |
uint32 Asnum = 21; |
| 63 |
string Comment = 22; |
| 64 |
bool Enabled = 23; |
| 65 |
bool HttpUp = 24; |
| 66 |
string HttpDownReason = 25; |
| 67 |
google.protobuf.Timestamp StateSince = 26; |
| 68 |
int32 AllowRedirects = 27; |
| 69 |
google.protobuf.Timestamp LastSync = 28; |
| 70 |
google.protobuf.Timestamp LastSuccessfulSync = 29; |
| 71 |
google.protobuf.Timestamp LastModTime = 30; |
| 72 |
bool HttpsUp = 31; |
| 73 |
string HttpsDownReason = 32; |
| 74 |
} |
| 75 |
|
| 76 |
message MirrorListReply { |
| 77 |
repeated Mirror Mirrors = 1; |
| 78 |
} |
| 79 |
|
| 80 |
message MirrorID { |
| 81 |
int32 ID = 1; |
| 82 |
string Name = 2; |
| 83 |
} |
| 84 |
|
| 85 |
message MatchReply { |
| 86 |
repeated MirrorID Mirrors = 1; |
| 87 |
} |
| 88 |
|
| 89 |
message ChangeStatusRequest { |
| 90 |
int32 ID = 1; |
| 91 |
bool Enabled = 2; |
| 92 |
} |
| 93 |
|
| 94 |
message MirrorIDRequest { |
| 95 |
int32 ID = 1; |
| 96 |
} |
| 97 |
|
| 98 |
message AddMirrorReply { |
| 99 |
float Latitude = 1; |
| 100 |
float Longitude = 2; |
| 101 |
string Country = 3; |
| 102 |
string Continent = 4; |
| 103 |
string ASN = 5; |
| 104 |
repeated string Warnings = 6; |
| 105 |
} |
| 106 |
|
| 107 |
message UpdateMirrorReply { |
| 108 |
string Diff = 1; |
| 109 |
} |
| 110 |
|
| 111 |
message GeoUpdateMirrorReply { |
| 112 |
Mirror Mirror = 1; |
| 113 |
string Diff = 2; |
| 114 |
repeated string Warnings = 3; |
| 115 |
} |
| 116 |
|
| 117 |
message RefreshRepositoryRequest { |
| 118 |
bool Rehash = 1; |
| 119 |
} |
| 120 |
|
| 121 |
message ScanMirrorRequest { |
| 122 |
int32 ID = 1; |
| 123 |
bool AutoEnable = 2; |
| 124 |
enum Method { |
| 125 |
ALL = 0; |
| 126 |
FTP = 1; |
| 127 |
RSYNC = 2; |
| 128 |
} |
| 129 |
Method Protocol = 3; |
| 130 |
} |
| 131 |
|
| 132 |
message ScanMirrorReply { |
| 133 |
bool Enabled = 1; |
| 134 |
int64 FilesIndexed = 2; |
| 135 |
int64 KnownIndexed = 3; |
| 136 |
int64 Removed = 4; |
| 137 |
int64 TZOffsetMs = 5; |
| 138 |
} |
| 139 |
|
| 140 |
message StatsFileRequest { |
| 141 |
string Pattern = 1; |
| 142 |
google.protobuf.Timestamp DateStart = 2; |
| 143 |
google.protobuf.Timestamp DateEnd = 3; |
| 144 |
} |
| 145 |
|
| 146 |
message StatsFileReply { |
| 147 |
map<string, int64> files = 1; |
| 148 |
} |
| 149 |
|
| 150 |
message StatsMirrorRequest { |
| 151 |
int32 ID = 1; |
| 152 |
google.protobuf.Timestamp DateStart = 2; |
| 153 |
google.protobuf.Timestamp DateEnd = 3; |
| 154 |
} |
| 155 |
|
| 156 |
message StatsMirrorReply { |
| 157 |
Mirror Mirror = 1; |
| 158 |
int64 Requests = 2; |
| 159 |
int64 Bytes = 3; |
| 160 |
} |
| 161 |
|
| 162 |
message GetMirrorLogsRequest { |
| 163 |
int32 ID = 1; |
| 164 |
int32 MaxResults = 2; |
| 165 |
} |
| 166 |
|
| 167 |
message GetMirrorLogsReply { |
| 168 |
repeated string line = 1; |
| 169 |
} |