gateways_config.proto 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  1. package NYql;
  2. option java_package = "ru.yandex.yql.proto";
  3. import "yql/essentials/protos/clickhouse.proto";
  4. /////////////////////////////// common ///////////////////////////////
  5. message TActivationByHour {
  6. required uint32 Hour = 1;
  7. required uint32 Percentage = 2;
  8. }
  9. message TActivationPercentage {
  10. optional uint32 Percentage = 1 [default = 0];
  11. repeated TActivationByHour ByHour = 2;
  12. repeated string IncludeUsers = 3;
  13. repeated string ExcludeUsers = 4;
  14. optional bool ExcludeRobots = 5 [default = true];
  15. repeated string Tags = 6;
  16. repeated string IncludeGroups = 7;
  17. repeated string ExcludeGroups = 8;
  18. repeated string IncludeRevisions = 9;
  19. repeated string ExcludeRevisions = 10;
  20. }
  21. message TAttr {
  22. required string Name = 1;
  23. required string Value = 2;
  24. optional TActivationPercentage Activation = 3;
  25. }
  26. message TRemoteFilePattern {
  27. required string Pattern = 1; // regexp to match
  28. required string Cluster = 2; // replacement string for YT server
  29. required string Path = 3; // replacement string for remote file path
  30. }
  31. enum EYtLogLevel {
  32. YL_NONE = -1;
  33. YL_FATAL = 0;
  34. YL_ERROR = 1;
  35. YL_INFO = 2;
  36. YL_DEBUG = 3;
  37. };
  38. enum EHostScheme {
  39. HS_HTTP = 0;
  40. HS_HTTPS = 1;
  41. };
  42. enum ETokenType {
  43. IAM = 0;
  44. OAUTH = 1;
  45. BLACKBOX = 2;
  46. CREDENTIALS = 3;
  47. };
  48. /////////////////////////////// HTTP GATEWAY //////////////////////
  49. message TExplicitDNSRecord {
  50. enum ProtocolVersion {
  51. ANY = 0;
  52. IPV4 = 1;
  53. IPV6 = 2;
  54. };
  55. optional string Address = 1 [default = ""];
  56. optional uint32 Port = 2 [default = 443];
  57. optional string ExpectedIP = 3 [default = ""];
  58. optional ProtocolVersion Protocol = 4 [default = ANY];
  59. }
  60. message TDnsResolverConfig {
  61. optional uint32 RefreshMs = 1 [default = 60000];
  62. repeated TExplicitDNSRecord ExplicitDNSRecord = 100;
  63. }
  64. message THttpGatewayConfig {
  65. optional uint32 MaxInFlightCount = 1;
  66. optional uint64 MaxSimulatenousDownloadsSize = 2;
  67. optional uint32 BuffersSizePerStream = 3;
  68. optional uint64 ConnectionTimeoutSeconds = 4;
  69. optional uint64 BytesPerSecondLimit = 5;
  70. optional uint64 DownloadBufferBytesLimit = 6;
  71. optional uint64 RequestTimeoutSeconds = 7;
  72. optional uint64 LowSpeedTimeSeconds = 8;
  73. optional uint64 LowSpeedBytesLimit = 9;
  74. optional TDnsResolverConfig DnsResolverConfig = 10;
  75. optional uint64 MaxRetries = 11;
  76. }
  77. /////////////////////////////// YT ///////////////////////////////
  78. message TYtClusterConfig {
  79. optional string Name = 1; // Short cluster name
  80. optional string Cluster = 2; // Real cluster server name with port
  81. optional bool Default = 3 [default = false]; // Default cluster
  82. optional string YTToken = 4; // token to use at YT servers
  83. optional string YTName = 5; // YT cluster name
  84. optional bool EnabledYtQlQueries = 6 [default = true]; // Allow to handle YtQl queries
  85. repeated TAttr Settings = 100;
  86. }
  87. message TFileWithMd5 {
  88. optional string File = 1;
  89. optional string Md5 = 2;
  90. }
  91. message TYtGatewayConfig {
  92. optional uint32 GatewayThreads = 1 [default = 0]; // Number of gateway MtpQueue threads. The adaptive MtpQueue will be used for 0 value
  93. optional EYtLogLevel YtLogLevel = 2 [default = YL_ERROR]; // The verbosity level of YT log
  94. optional string PerfToolsPath = 4; // Path to perftools libraries
  95. optional bool PerfToolsFromPackage = 5; // Use perftools from package
  96. optional string MrJobBin = 6; // Path to mrjob executable. If not set then main executable will be used
  97. optional string MrJobBinMd5 = 13; // MD5 checksum of mrjob executable. Should not be specified directly
  98. optional string MrJobUdfsDir = 7; // Path to linux udfs. If not set then loaded into main executable will be used
  99. optional bool ExecuteUdfLocallyIfPossible = 8; // Turns on local execution mode for calc job with UDF.
  100. optional bool LocalChainTest = 9 [default = false]; // Chain local execution jobs for test purpose.
  101. optional string YtDebugLogFile = 10; // File for full YT debug log
  102. optional uint64 YtDebugLogSize = 11 [default = 0]; // Max YT debug log size
  103. optional bool YtDebugLogAlwaysWrite = 12 [default = false]; // Write YT debug log always or on error only
  104. optional string LocalChainFile = 14; // File to dump table contet in test mode
  105. repeated TFileWithMd5 MrJobSystemLibsWithMd5 = 15; // Paths to linux dynamic libraries required for running mrjob.
  106. repeated TRemoteFilePattern RemoteFilePatterns = 100;
  107. repeated TYtClusterConfig ClusterMapping = 101; // Accepted cluster shortcuts. All names not from this list will be rejected
  108. repeated TAttr DefaultSettings = 102;
  109. }
  110. /////////////////////////////// Grut ///////////////////////////////
  111. message TYtOrmClusterConfig {
  112. optional string Name = 1; // Examples: grut_testing, grut_stable, grut_dev
  113. optional string Cluster = 2; // Examples: sas, vla, etc
  114. optional bool Enabled = 3 [default = true]; // Allow to handle YTORM queries
  115. optional string EndpointSetId = 4; // Examples: grut-stable.object_api, grut-testing.object_api, etc
  116. }
  117. message TYtOrmGatewayConfig {
  118. repeated TYtOrmClusterConfig ClusterMapping = 1;
  119. }
  120. /////////////////////////////// Kikimr ///////////////////////////////
  121. message THostPort {
  122. required string Host = 1;
  123. required uint32 Port = 2;
  124. optional uint64 TotalTimeoutMs = 3;
  125. }
  126. message TKikimrGrpcData {
  127. repeated string Locators = 1;
  128. optional uint64 TimeoutMs = 2;
  129. optional uint64 MaxMessageSizeBytes = 3;
  130. optional uint32 MaxInFlight = 4;
  131. optional bool EnableEndpointDiscovery = 5;
  132. optional bool UseLegacyApi = 6;
  133. }
  134. message TKikimrClusterConfig {
  135. optional string Name = 1;
  136. optional bool Default = 2 [default = false];
  137. repeated THostPort MessageBus = 3;
  138. optional TKikimrGrpcData Grpc = 4;
  139. optional string Database = 5;
  140. optional uint32 TvmId = 6 [default = 0];
  141. optional string Token = 7;
  142. optional string ProxyUrl = 8;
  143. optional string Location = 9;
  144. optional bool IsFromMvp = 10;
  145. optional ETokenType TokenType = 11;
  146. repeated TAttr Settings = 101;
  147. }
  148. message TKikimrGatewayConfig {
  149. repeated TKikimrClusterConfig ClusterMapping = 1;
  150. repeated TAttr DefaultSettings = 2;
  151. }
  152. /////////////////////////////// Kikimr MVP ///////////////////////////////
  153. message TKikimrMvpProxyConfig {
  154. optional string Host = 1;
  155. optional uint32 Port = 2;
  156. optional string BasePath = 3;
  157. optional uint32 TvmId = 4 [default = 0];
  158. }
  159. message TKikimrMvpGatewayConfig {
  160. repeated TKikimrMvpProxyConfig ProxyMapping = 1;
  161. }
  162. ///////////////////////////// Ydb /////////////////////////////
  163. message TYdbClusterConfig {
  164. optional string Name = 1;
  165. optional string Endpoint = 2;
  166. optional string Token = 3;
  167. optional TKikimrGrpcData Grpc = 4;
  168. optional uint32 TvmId = 5 [default = 0];
  169. optional string Database = 6;
  170. optional string Id = 7;
  171. optional bool Secure = 8;
  172. optional string ServiceAccountId = 9;
  173. optional string ServiceAccountIdSignature = 10;
  174. optional bool AddBearerToToken = 11; // whether to use prefix "Bearer " in token
  175. repeated TAttr Settings = 100;
  176. }
  177. message TYdbGatewayConfig {
  178. repeated TYdbClusterConfig ClusterMapping = 1;
  179. optional string DefaultEndpoint = 2;
  180. optional string DefaultToken = 3;
  181. repeated TAttr DefaultSettings = 4;
  182. }
  183. ///////////////////////////// ClickHouse /////////////////////////////
  184. message TClickHouseClusterConfig {
  185. optional string Name = 1;
  186. optional bool Default = 2 [default = false];
  187. optional string Cluster = 3;
  188. optional string CHToken = 4;
  189. repeated TAttr Settings = 101;
  190. optional EHostScheme HostScheme = 5;
  191. optional uint32 HostPort = 6;
  192. optional string CHTokenYavSecretId = 7;
  193. optional string CHTokenYavVersionId = 8;
  194. optional string CHTokenYavKey = 9;
  195. optional NYql.NProto.TClickHouseRunnerConfig Runner = 10;
  196. optional uint32 NativeHostPort = 11 [default = 9000];
  197. optional bool NativeSecure = 12 [default = false];
  198. optional string Id = 13;
  199. repeated string GroupAllowed = 14;
  200. }
  201. message TClickHouseGatewayConfig {
  202. repeated TClickHouseClusterConfig ClusterMapping = 1;
  203. repeated TAttr DefaultSettings = 2;
  204. }
  205. ///////////////////////////// RTMR /////////////////////////////
  206. enum EYfArtifactType {
  207. AT_NONE = 0;
  208. AT_FILE = 1;
  209. AT_LAYER = 2;
  210. };
  211. enum ERtmrOperationType {
  212. OT_NONE = 0;
  213. OT_LF_PARSE = 1;
  214. OT_YDB_OUT = 2;
  215. OT_SOLOMON_OUT = 3;
  216. OT_PQ_OUT = 4;
  217. };
  218. message TYfArtifactLink {
  219. optional EYfArtifactType Type = 1;
  220. optional string Url = 2; // in any format suitable for file storage
  221. optional string TargetFilePath = 3; // ignored for Type=AT_LAYER
  222. };
  223. message TRtmrOperationArtifactsInfo {
  224. optional ERtmrOperationType Type = 1;
  225. repeated TYfArtifactLink Links = 2;
  226. };
  227. message TRtmrPqConsumerInfo {
  228. optional string Cluster = 1;
  229. optional string Consumer = 2;
  230. }
  231. message TRtmrClusterConfig {
  232. optional string Name = 1;
  233. optional bool Default = 2 [default = false];
  234. optional string Cluster = 3;
  235. optional string RemoteName = 4;
  236. optional string YfCluster = 5;
  237. optional string S3TokenPath = 6;
  238. optional string S3FileCachePath = 7;
  239. optional uint32 TvmId = 8 [default = 0];
  240. optional string TvmSecretPath = 9;
  241. repeated string Users = 10;
  242. optional bool UploadViaYfClient = 11 [default = false];
  243. optional string MdsTorrentUrl = 12;
  244. repeated TRtmrOperationArtifactsInfo ArtifactOverrides = 13; // override CommonArtifacts by ERtmrOperationType
  245. optional string PqConsumer = 14;
  246. repeated TRtmrPqConsumerInfo PqConsumerMapping = 15;
  247. optional uint32 MaxPqPartitions = 16;
  248. optional uint32 PreviewCollectTimeoutMs = 17;
  249. optional string SbdTvmSecretFile = 18;
  250. optional uint64 SbdTvmClientId = 19;
  251. optional uint64 SbdTvmServerId = 20 [default = 2021848];
  252. repeated TAttr Settings = 101;
  253. }
  254. message TRtmrGatewayConfig {
  255. repeated TRtmrClusterConfig ClusterMapping = 1;
  256. repeated TAttr DefaultSettings = 2;
  257. optional string YqlRtmrDynLib = 3; // path to libyql-dynlib.so
  258. optional bool UseFakeYfUpload = 4 [default = false]; // use in tests only to speedup upload
  259. repeated string Artifacts = 5; /// default artifacts to put into every function
  260. repeated TRtmrOperationArtifactsInfo CommonArtifacts = 6; // common artifacts for all clusters
  261. optional uint32 MaxPqPartitions = 7 [default = 10];
  262. optional uint32 PreviewCollectTimeoutMs = 8 [default = 2000];
  263. optional bool KeepActiveProcess = 9 [default = false];
  264. }
  265. ///////////////////////////// Pq //////////////////////////////
  266. message TPqClusterConfig {
  267. enum EClusterType {
  268. CT_UNSPECIFIED = 0;
  269. CT_PERS_QUEUE = 1;
  270. CT_DATA_STREAMS = 2;
  271. }
  272. optional string Name = 1;
  273. optional EClusterType ClusterType = 2 [default = CT_PERS_QUEUE];
  274. optional string Endpoint = 3;
  275. optional string ConfigManagerEndpoint = 4;
  276. optional string Token = 5;
  277. optional string Database = 6 [default = "/Root"];
  278. optional uint32 TvmId = 7 [default = 0];
  279. optional bool UseSsl = 8; // grpcs
  280. optional string ServiceAccountId = 9;
  281. optional string ServiceAccountIdSignature = 10;
  282. optional bool AddBearerToToken = 11; // whether to use prefix "Bearer " in token
  283. optional string DatabaseId = 12;
  284. repeated TAttr Settings = 100;
  285. optional bool SharedReading = 101;
  286. optional string ReconnectPeriod = 102; // disabled by default, example of a parameter: 5m
  287. optional string ReadGroup = 103;
  288. }
  289. message TPqGatewayConfig {
  290. repeated TPqClusterConfig ClusterMapping = 1;
  291. optional string DefaultToken = 2;
  292. repeated TAttr DefaultSettings = 100;
  293. }
  294. ///////////////////////////// Stat /////////////////////////////
  295. message TStatClusterConfig {
  296. optional string Name = 1; // Short cluster name
  297. optional string Cluster = 2; // Real cluster server name with port
  298. optional bool Default = 3 [default = false]; // Default cluster
  299. optional string StatToken = 4; // token to use in communication with Statface
  300. optional string StatName = 5; // Stat cluster name
  301. repeated TAttr Settings = 100;
  302. }
  303. message TStatGatewayConfig {
  304. optional uint32 GatewayThreads = 1 [default = 0]; // Number of gateway MtpQueue threads. The adaptive MtpQueue will be used for 0 value
  305. repeated TStatClusterConfig ClusterMapping = 101; // Accepted cluster shortcuts. All names not from this list will be rejected
  306. repeated TAttr DefaultSettings = 102;
  307. }
  308. ///////////////////////////// CHYT /////////////////////////////
  309. message TChytClusterConfig {
  310. optional string Name = 1; // Short cluster name
  311. optional string YtCluster = 2; // Name of the corresponding YT cluster.
  312. }
  313. message TChytGatewayConfig {
  314. repeated TChytClusterConfig ClusterMapping = 1;
  315. }
  316. ///////////////////////////// S3 /////////////////////////////
  317. message TS3ClusterConfig {
  318. optional string Name = 1; // Short cluster name
  319. optional string Url = 2;
  320. optional string Token = 3;
  321. optional string ServiceAccountId = 4;
  322. optional string ServiceAccountIdSignature = 5;
  323. repeated TAttr Settings = 100;
  324. }
  325. message TS3FormatSizeLimit {
  326. optional string Name = 1; // Format name i.e. csv_with_names
  327. optional uint64 FileSizeLimit = 2; // Max allowed size for this format
  328. }
  329. message TS3GatewayConfig {
  330. repeated TS3ClusterConfig ClusterMapping = 1;
  331. optional uint64 FileSizeLimit = 2; // Global limit
  332. repeated TS3FormatSizeLimit FormatSizeLimit = 6; // Format limits (override FileSizeLimit)
  333. optional uint64 BlockFileSizeLimit = 10; // Global limit for block readers (overrides FormatSizeLimit)
  334. optional uint64 MaxFilesPerQuery = 3;
  335. optional uint64 MaxReadSizePerQuery = 4;
  336. optional uint64 MaxDiscoveryFilesPerQuery = 5;
  337. optional uint64 MaxInflightListsPerQuery = 7;
  338. optional uint64 MaxDirectoriesAndFilesPerQuery = 8;
  339. optional uint64 MinDesiredDirectoriesOfFilesPerQuery = 9;
  340. optional bool AllowConcurrentListings = 11 [default = false];
  341. optional uint64 ListingCallbackThreadCount = 12;
  342. optional uint64 ListingCallbackPerThreadQueueSize = 13;
  343. optional uint64 RegexpCacheSize = 14;
  344. optional uint64 GeneratorPathsLimit = 15;
  345. optional uint64 MaxListingResultSizePerPartition = 16;
  346. optional uint64 RowsInBatch = 17; // Default = 1000
  347. optional uint64 MaxInflight = 18; // Default = 20
  348. optional uint64 DataInflight = 19; // Default = 200 MB
  349. optional bool AllowLocalFiles = 20;
  350. repeated TAttr DefaultSettings = 100;
  351. }
  352. ///////////////////////////// Solomon /////////////////////////////
  353. message TSolomonClusterConfig {
  354. enum ESolomonClusterType {
  355. SCT_UNSPECIFIED = 0;
  356. SCT_SOLOMON = 1;
  357. SCT_MONITORING = 2;
  358. }
  359. message TShardPath {
  360. required string Project = 1; // CloudId for YC
  361. required string Cluster = 2; // FolderId for YC
  362. }
  363. optional string Name = 1;
  364. optional string Cluster = 2;
  365. optional bool UseSsl = 3;
  366. optional ESolomonClusterType ClusterType = 4 [default = SCT_SOLOMON];
  367. optional string Token = 5;
  368. optional string ServiceAccountId = 6;
  369. optional string ServiceAccountIdSignature = 7;
  370. optional TShardPath Path = 8;
  371. repeated TAttr Settings = 100;
  372. }
  373. message TSolomonGatewayConfig {
  374. repeated TSolomonClusterConfig ClusterMapping = 1;
  375. repeated TAttr DefaultSettings = 2;
  376. }
  377. message TFileStorageAdditionalConfig {
  378. message TUrlPattern {
  379. required string Pattern = 1;
  380. optional string Alias = 2;
  381. }
  382. message TSchemeTranslate {
  383. required string Pattern = 1; // regexp to match
  384. required string TargetUrl = 2; // replacement string for target URL
  385. }
  386. repeated TUrlPattern AllowedUrls = 2; // Whitelist of url regexps; disabled if empty
  387. repeated TUrlPattern ExternalAllowedUrls = 3; // Whitelist of url regexps for external users; disabled if empty
  388. repeated TSchemeTranslate CustomSchemes = 4;
  389. }
  390. /////////////////////////////// Postgresql /////////////////////////////
  391. message TPostgresqlClusterConfig {
  392. optional string Name = 1;
  393. optional string Cluster = 2;
  394. optional string PGtoken = 3;
  395. optional string TargetServerType = 4;
  396. optional uint64 MaxResultBufferSize = 5 [default = 1000000]; // Zero value disables adaptiveFetch
  397. }
  398. message TPostgresqlGatewayConfig {
  399. repeated TPostgresqlClusterConfig ClusterMapping = 1;
  400. optional uint64 MaxResultBufferSize = 2 [default = 1000000]; // Zero value disables adaptiveFetch by default
  401. }
  402. /////////////////////////////// Mysql /////////////////////////////
  403. message TMysqlClusterConfig {
  404. optional string Name = 1;
  405. optional string Cluster = 2;
  406. optional string MysqlToken = 3;
  407. }
  408. message TMysqlGatewayConfig {
  409. repeated TMysqlClusterConfig ClusterMapping = 1;
  410. }
  411. /////////////////////////////// Dq /////////////////////////////////////
  412. message TDqGatewayConfig {
  413. message TDefaultAutoByHourPercentage {
  414. required uint32 Hour = 1;
  415. required uint32 Percentage = 2;
  416. }
  417. optional uint32 DefaultAutoPercentage = 1 [default = 0]; // Probability of 'DqEngine="auto"'
  418. repeated TDefaultAutoByHourPercentage DefaultAutoByHour = 2;
  419. repeated string NoDefaultAutoForUsers = 3;
  420. repeated string DefaultAnalyzeQueryForUsers = 4;
  421. repeated TAttr DefaultSettings = 102;
  422. optional uint32 WithHiddenPercentage = 5 [default = 0]; // Depricated. TODO: remove
  423. repeated TDefaultAutoByHourPercentage WithHiddenByHour = 6; // Depricated. TODO: remove
  424. repeated string NoWithHiddenForUsers = 7; // Depricated. TODO: remove
  425. repeated string WithHiddenForUsers = 8; // Depricated. TODO: remove
  426. optional TActivationPercentage HiddenActivation = 9;
  427. }
  428. /////////////////////////////// Yql Core ///////////////////////////////
  429. message TCoreAttr {
  430. required string Name = 1;
  431. repeated string Args = 2;
  432. optional TActivationPercentage Activation = 3;
  433. }
  434. message TYqlCoreConfig {
  435. repeated TCoreAttr Flags = 1;
  436. optional TActivationPercentage QPlayerActivation = 2;
  437. }
  438. /////////////////////////////// Sql Core ///////////////////////////////
  439. message TWarnAsErrorByHourPercentage {
  440. required uint32 Hour = 1;
  441. required uint32 Percentage = 2;
  442. }
  443. message TSqlCoreConfig {
  444. optional uint32 V0SyntaxWarnAsErrorPercentage = 1 [default = 0]; // Probability of 'deprecated syntax'
  445. // warning to become an error
  446. repeated TWarnAsErrorByHourPercentage V0SyntaxWarnAsErrorByHour = 2;
  447. repeated string NoV0SyntaxErrorForUsers = 3;
  448. repeated string TranslationFlags = 4;
  449. }
  450. /////////////////////////////// Db Tool ///////////////////////////////
  451. message TUserException {
  452. required string Login = 1;
  453. optional uint32 ExpireDays = 2 [default = 0]; // 0 - don't delete history at all
  454. }
  455. message TDbToolConfig {
  456. optional uint32 DefaultExpireDays = 1;
  457. optional string RobotPattern = 2;
  458. repeated string DeleteQueryRunner = 3;
  459. repeated TUserException UserException = 4;
  460. }
  461. /////////// Generic gateway for the external data sources ////////////
  462. // TGenericEndpoint represents the network address of a generic data source instance
  463. message TGenericEndpoint {
  464. optional string host = 1;
  465. optional uint32 port = 2;
  466. }
  467. // TGenericCredentials represents various ways of user authentication in the data source instance
  468. message TGenericCredentials {
  469. message TBasic {
  470. optional string username = 1;
  471. optional string password = 2;
  472. }
  473. message TToken {
  474. optional string type = 1;
  475. optional string value = 2;
  476. }
  477. oneof payload {
  478. TBasic basic = 1;
  479. TToken token = 2;
  480. }
  481. }
  482. // EGenericDataSourceKind enumerates the external data sources
  483. // supported by the federated query system
  484. enum EGenericDataSourceKind {
  485. DATA_SOURCE_KIND_UNSPECIFIED = 0;
  486. CLICKHOUSE = 1;
  487. POSTGRESQL = 2;
  488. S3 = 3;
  489. YDB = 4;
  490. MYSQL = 5;
  491. MS_SQL_SERVER = 6;
  492. GREENPLUM = 7;
  493. ORACLE = 8;
  494. LOGGING = 9;
  495. MONGO_DB = 10;
  496. }
  497. // EGenericProtocol generalizes various kinds of network protocols supported by different databases.
  498. enum EGenericProtocol {
  499. PROTOCOL_UNSPECIFIED = 0;
  500. NATIVE = 1; // CLICKHOUSE, POSTGRESQL
  501. HTTP = 2; // CLICKHOUSE, S3
  502. }
  503. // TPostgreSQLDataSourceOptions represents settings specific to PostgreSQL
  504. message TPostgreSQLDataSourceOptions {
  505. // PostgreSQL schema
  506. optional string schema = 1;
  507. }
  508. // TClickhouseDataSourceOptions represents settings specific to Clickhouse
  509. message TClickhouseDataSourceOptions {
  510. }
  511. // TS3DataSourceOptions represents settings specific to S3 (Simple Storage Service)
  512. message TS3DataSourceOptions {
  513. // the region where data is stored
  514. optional string region = 1;
  515. // the bucket the object belongs to
  516. optional string bucket = 2;
  517. }
  518. // TGreenplumDataSourceOptions represents settings specific to Greenplum
  519. message TGreenplumDataSourceOptions {
  520. // Greenplum schema
  521. optional string schema = 1;
  522. }
  523. // TOracleDataSourceOptions represents settings specific to Oracle
  524. message TOracleDataSourceOptions {
  525. // Oracle service_name - alias to SID of oracle INSTANCE, or SID, or PDB.
  526. // More about connection options in Oracle docs:
  527. // https://docs.oracle.com/en/database/other-databases/essbase/21/essoa/connection-string-formats.html
  528. optional string service_name = 1;
  529. }
  530. // TLoggingDataSourceOptions represents settings specific to Logging
  531. message TLoggingDataSourceOptions {
  532. optional string folder_id = 1;
  533. }
  534. // TMongoDbDataSourceOptions represents settings specific to MongoDB
  535. message TMongoDbDataSourceOptions {
  536. enum EReadingMode {
  537. READING_MODE_UNSPECIFIED = 0;
  538. // Returns each top level field of the document deserialized into the corresponding YQL type; if the type of some field is ambiguous / inconsistent across several documents it is returned serialized as an YQL Utf8 value
  539. TABLE = 1;
  540. };
  541. // Ways of dealing with values read in ReadSplit whose types are inconsistent with types that were deduced in DescribeTable
  542. enum EUnexpectedTypeDisplayMode {
  543. UNEXPECTED_UNSPECIFIED = 0;
  544. UNEXPECTED_AS_NULL = 1;
  545. UNEXPECTED_AS_STRING = 2;
  546. };
  547. // Ways of dealing with unsupported data types
  548. enum EUnsupportedTypeDisplayMode {
  549. UNSUPPORTED_UNSPECIFIED = 0;
  550. UNSUPPORTED_OMIT = 1;
  551. UNSUPPORTED_AS_STRING = 2;
  552. };
  553. optional EReadingMode reading_mode = 1;
  554. optional EUnexpectedTypeDisplayMode unexpected_type_display_mode = 2;
  555. optional EUnsupportedTypeDisplayMode unsupported_type_display_mode = 3;
  556. }
  557. // TGenericDataSourceInstance helps to identify the instance of a data source to redirect request to.
  558. message TGenericDataSourceInstance {
  559. // Data source kind
  560. optional EGenericDataSourceKind kind = 1;
  561. // Network address
  562. optional TGenericEndpoint endpoint = 2;
  563. // Database name
  564. optional string database = 3;
  565. // Credentials to access database
  566. optional TGenericCredentials credentials = 4;
  567. // If true, Connector server will use secure connections to access remote data sources.
  568. // Certificates will be obtained from the standard system paths.
  569. optional bool use_tls = 5;
  570. // Allows to specify network protocol that should be used between
  571. // during the connection between Connector and the remote data source
  572. optional EGenericProtocol protocol = 6;
  573. // Options specific to various data sources
  574. oneof options {
  575. TPostgreSQLDataSourceOptions pg_options = 7;
  576. TClickhouseDataSourceOptions ch_options = 8;
  577. TS3DataSourceOptions s3_options = 9;
  578. TGreenplumDataSourceOptions gp_options = 10;
  579. TOracleDataSourceOptions oracle_options = 11;
  580. TLoggingDataSourceOptions logging_options = 12;
  581. TMongoDbDataSourceOptions mongodb_options = 13;
  582. }
  583. }
  584. message TGenericClusterConfig {
  585. // Cluster name
  586. optional string Name = 1;
  587. // Data source kind
  588. optional EGenericDataSourceKind Kind = 8;
  589. // Location represents the network address of a data source instance we want to connect
  590. oneof Location {
  591. // Endpoint must be used for on-premise deployments.
  592. TGenericEndpoint Endpoint = 9;
  593. // DatabaseId must be used when the data source is deployed in cloud.
  594. // Data source FQDN and port will be resolved by MDB service.
  595. string DatabaseId = 4;
  596. }
  597. // Credentials used to access data source instance
  598. optional TGenericCredentials Credentials = 10;
  599. // Credentials used to access managed databases APIs.
  600. // When working with external data source instances deployed in clouds,
  601. // one should either set (ServiceAccountId, ServiceAccountIdSignature) pair
  602. // that will be resolved into IAM Token via Token Accessor,
  603. // or provide IAM Token directly.
  604. optional string ServiceAccountId = 6;
  605. optional string ServiceAccountIdSignature = 7;
  606. optional string Token = 11;
  607. // If true, the generic provider will ask connector server to use secure connections
  608. // to access remote data sources.
  609. optional bool UseSsl = 12;
  610. // Name of a particular database within a database cluster
  611. optional string DatabaseName = 13;
  612. // Transport protocol used to establish a network connection with database
  613. optional EGenericProtocol Protocol = 14;
  614. // Data source options specific to various data sources
  615. map<string, string> DataSourceOptions = 15;
  616. reserved 2, 3, 5;
  617. }
  618. message TGenericConnectorConfig {
  619. // There are two options to configure Connector network address:
  620. // 1. Set address statically via `Endpoint.Host` and `Endpoint.Port`;
  621. // 2. Ask YDB to set `Endpoint.Port` to the value of expression `./ydbd --ic-port + OffsetFromIcPort`,
  622. // while Connector's hostname will still be taken from `Endpoint.Host` (with 'localhost' as a default value).
  623. optional TGenericEndpoint Endpoint = 3;
  624. optional uint32 OffsetFromIcPort = 6;
  625. // If true, Connector GRPC Client will use TLS encryption.
  626. optional bool UseSsl = 4;
  627. // Path to the custom CA certificate to verify Connector's certs.
  628. // If empty, the default system CA certificate pool will be used.
  629. optional string SslCaCrt = 5;
  630. reserved 1, 2;
  631. }
  632. message TGenericGatewayConfig {
  633. // Connector service network endpoint
  634. // TODO: replace with map<DataSourceKind, TGenericConnectorConfig>
  635. optional TGenericConnectorConfig Connector = 5;
  636. // Database clusters supported by this particular instance
  637. repeated TGenericClusterConfig ClusterMapping = 3;
  638. // MDB API endpoint (no need to fill in case of on-prem deployment).
  639. optional string MdbGateway = 4;
  640. // YDB MVP API endpoint (no need to fill in case of on-prem deployment).
  641. // Expected format:
  642. // [http|https]://host:port/ydbc/cloud-prod/
  643. optional string YdbMvpEndpoint = 7;
  644. repeated TAttr DefaultSettings = 6;
  645. reserved 1, 2;
  646. }
  647. /////////////////////////////// Db Resolver ///////////////////////////////////
  648. message TDbResolverConfig {
  649. // Ydb / Yds MVP endpoint.
  650. // Expected format:
  651. // [http|https]://host:port/ydbc/cloud-prod/
  652. optional string YdbMvpEndpoint = 2;
  653. }
  654. /////////////////////////////// Revision filter ///////////////////////////////
  655. message TRevisionException {
  656. repeated string Revisions = 1;
  657. repeated string IncludeUsers = 2;
  658. repeated string ExcludeUsers = 3;
  659. }
  660. message TRevisionFilterConfig {
  661. repeated TRevisionException RevisionException = 1;
  662. }
  663. ///////////////////////////// Ytflow /////////////////////////////
  664. message TYtflowGatewayConfig {
  665. optional uint32 GatewayThreads = 1 [default = 1]; // Number of gateway MtpQueue threads. The adaptive MtpQueue will be used for 0 value
  666. }
  667. /////////////////////////////// Root ///////////////////////////////
  668. message TGatewaysConfig {
  669. optional TYtGatewayConfig Yt = 1;
  670. optional TKikimrGatewayConfig Kikimr = 2;
  671. optional TClickHouseGatewayConfig ClickHouse = 3;
  672. optional TRtmrGatewayConfig Rtmr = 4;
  673. optional TKikimrMvpGatewayConfig KikimrMvp = 5;
  674. optional TStatGatewayConfig Stat = 6;
  675. optional TChytGatewayConfig Chyt = 7;
  676. optional TSolomonGatewayConfig Solomon = 8;
  677. optional TFileStorageAdditionalConfig Fs = 9;
  678. optional TYqlCoreConfig YqlCore = 10;
  679. optional TPostgresqlGatewayConfig Postgresql = 11;
  680. optional TSqlCoreConfig SqlCore = 12;
  681. optional TDqGatewayConfig Dq = 13;
  682. optional TMysqlGatewayConfig Mysql = 14;
  683. optional TYdbGatewayConfig Ydb = 15;
  684. optional TPqGatewayConfig Pq = 16;
  685. optional TS3GatewayConfig S3 = 17;
  686. optional THttpGatewayConfig HttpGateway = 18;
  687. optional TYtOrmGatewayConfig YtOrm = 19;
  688. optional TDbToolConfig DbTool = 20;
  689. optional TGenericGatewayConfig Generic = 21;
  690. optional TRevisionFilterConfig RevisionFilter = 22;
  691. optional TDbResolverConfig DbResolver = 23;
  692. optional TYtflowGatewayConfig Ytflow = 24;
  693. }