OzoneManagerProtocol.proto 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. /**
  19. * These .proto interfaces are private and unstable.
  20. * Please see http://wiki.apache.org/hadoop/Compatibility
  21. * for what changes are allowed for a *unstable* .proto interface.
  22. */
  23. syntax = "proto2";
  24. option java_package = "org.apache.hadoop.ozone.protocol.proto";
  25. option java_outer_classname = "OzoneManagerProtocolProtos";
  26. option java_generic_services = true;
  27. option java_generate_equals_and_hash = true;
  28. package hadoop.ozone;
  29. /**
  30. This file contains the protocol to communicate with
  31. Ozone Manager. Ozone Manager manages the namespace for ozone.
  32. This is similar to Namenode for Ozone.
  33. */
  34. import "hdds.proto";
  35. import "Security.proto";
  36. import "FSProtos.proto";
  37. enum Type {
  38. CreateVolume = 11;
  39. SetVolumeProperty = 12;
  40. CheckVolumeAccess = 13;
  41. InfoVolume = 14;
  42. DeleteVolume = 15;
  43. ListVolume = 16;
  44. CreateBucket = 21;
  45. InfoBucket = 22;
  46. SetBucketProperty = 23;
  47. DeleteBucket = 24;
  48. ListBuckets = 25;
  49. CreateKey = 31;
  50. LookupKey = 32;
  51. RenameKey = 33;
  52. DeleteKey = 34;
  53. ListKeys = 35;
  54. CommitKey = 36;
  55. AllocateBlock = 37;
  56. CreateS3Bucket = 41;
  57. DeleteS3Bucket = 42;
  58. InfoS3Bucket = 43;
  59. ListS3Buckets = 44;
  60. InitiateMultiPartUpload = 45;
  61. CommitMultiPartUpload = 46;
  62. CompleteMultiPartUpload = 47;
  63. AbortMultiPartUpload = 48;
  64. GetS3Secret = 49;
  65. ListMultiPartUploadParts = 50;
  66. ServiceList = 51;
  67. GetDelegationToken = 61;
  68. RenewDelegationToken = 62;
  69. CancelDelegationToken = 63;
  70. GetFileStatus = 70;
  71. CreateDirectory = 71;
  72. CreateFile = 72;
  73. LookupFile = 73;
  74. ListStatus = 74;
  75. AddAcl = 75;
  76. RemoveAcl = 76;
  77. SetAcl = 77;
  78. GetAcl = 78;
  79. PurgeKeys = 81;
  80. }
  81. message OMRequest {
  82. required Type cmdType = 1; // Type of the command
  83. // A string that identifies this command, we generate Trace ID in Ozone
  84. // frontend and this allows us to trace that command all over ozone.
  85. optional string traceID = 2;
  86. required string clientId = 3;
  87. optional UserInfo userInfo = 4;
  88. optional CreateVolumeRequest createVolumeRequest = 11;
  89. optional SetVolumePropertyRequest setVolumePropertyRequest = 12;
  90. optional CheckVolumeAccessRequest checkVolumeAccessRequest = 13;
  91. optional InfoVolumeRequest infoVolumeRequest = 14;
  92. optional DeleteVolumeRequest deleteVolumeRequest = 15;
  93. optional ListVolumeRequest listVolumeRequest = 16;
  94. optional CreateBucketRequest createBucketRequest = 21;
  95. optional InfoBucketRequest infoBucketRequest = 22;
  96. optional SetBucketPropertyRequest setBucketPropertyRequest = 23;
  97. optional DeleteBucketRequest deleteBucketRequest = 24;
  98. optional ListBucketsRequest listBucketsRequest = 25;
  99. optional CreateKeyRequest createKeyRequest = 31;
  100. optional LookupKeyRequest lookupKeyRequest = 32;
  101. optional RenameKeyRequest renameKeyRequest = 33;
  102. optional DeleteKeyRequest deleteKeyRequest = 34;
  103. optional ListKeysRequest listKeysRequest = 35;
  104. optional CommitKeyRequest commitKeyRequest = 36;
  105. optional AllocateBlockRequest allocateBlockRequest = 37;
  106. optional S3CreateBucketRequest createS3BucketRequest = 41;
  107. optional S3DeleteBucketRequest deleteS3BucketRequest = 42;
  108. optional S3BucketInfoRequest infoS3BucketRequest = 43;
  109. optional S3ListBucketsRequest listS3BucketsRequest = 44;
  110. optional MultipartInfoInitiateRequest initiateMultiPartUploadRequest = 45;
  111. optional MultipartCommitUploadPartRequest commitMultiPartUploadRequest = 46;
  112. optional MultipartUploadCompleteRequest completeMultiPartUploadRequest = 47;
  113. optional MultipartUploadAbortRequest abortMultiPartUploadRequest = 48;
  114. optional GetS3SecretRequest getS3SecretRequest = 49;
  115. optional MultipartUploadListPartsRequest listMultipartUploadPartsRequest = 50;
  116. optional ServiceListRequest serviceListRequest = 51;
  117. optional hadoop.common.GetDelegationTokenRequestProto getDelegationTokenRequest = 61;
  118. optional hadoop.common.RenewDelegationTokenRequestProto renewDelegationTokenRequest= 62;
  119. optional hadoop.common.CancelDelegationTokenRequestProto cancelDelegationTokenRequest = 63;
  120. optional GetFileStatusRequest getFileStatusRequest = 70;
  121. optional CreateDirectoryRequest createDirectoryRequest = 71;
  122. optional CreateFileRequest createFileRequest = 72;
  123. optional LookupFileRequest lookupFileRequest = 73;
  124. optional ListStatusRequest listStatusRequest = 74;
  125. optional AddAclRequest addAclRequest = 75;
  126. optional RemoveAclRequest removeAclRequest = 76;
  127. optional SetAclRequest setAclRequest = 77;
  128. optional GetAclRequest getAclRequest = 78;
  129. optional PurgeKeysRequest purgeKeysRequest = 81;
  130. }
  131. message OMResponse {
  132. required Type cmdType = 1; // Type of the command
  133. // A string that identifies this command, we generate Trace ID in Ozone
  134. // frontend and this allows us to trace that command all over ozone.
  135. optional string traceID = 2;
  136. optional bool success = 3 [default=true];
  137. optional string message = 4;
  138. required Status status = 5;
  139. optional string leaderOMNodeId = 6;
  140. optional CreateVolumeResponse createVolumeResponse = 11;
  141. optional SetVolumePropertyResponse setVolumePropertyResponse = 12;
  142. optional CheckVolumeAccessResponse checkVolumeAccessResponse = 13;
  143. optional InfoVolumeResponse infoVolumeResponse = 14;
  144. optional DeleteVolumeResponse deleteVolumeResponse = 15;
  145. optional ListVolumeResponse listVolumeResponse = 16;
  146. optional CreateBucketResponse createBucketResponse = 21;
  147. optional InfoBucketResponse infoBucketResponse = 22;
  148. optional SetBucketPropertyResponse setBucketPropertyResponse = 23;
  149. optional DeleteBucketResponse deleteBucketResponse = 24;
  150. optional ListBucketsResponse listBucketsResponse = 25;
  151. optional CreateKeyResponse createKeyResponse = 31;
  152. optional LookupKeyResponse lookupKeyResponse = 32;
  153. optional RenameKeyResponse renameKeyResponse = 33;
  154. optional DeleteKeyResponse deleteKeyResponse = 34;
  155. optional ListKeysResponse listKeysResponse = 35;
  156. optional CommitKeyResponse commitKeyResponse = 36;
  157. optional AllocateBlockResponse allocateBlockResponse = 37;
  158. optional S3CreateBucketResponse createS3BucketResponse = 41;
  159. optional S3DeleteBucketResponse deleteS3BucketResponse = 42;
  160. optional S3BucketInfoResponse infoS3BucketResponse = 43;
  161. optional S3ListBucketsResponse listS3BucketsResponse = 44;
  162. optional MultipartInfoInitiateResponse initiateMultiPartUploadResponse = 45;
  163. optional MultipartCommitUploadPartResponse commitMultiPartUploadResponse = 46;
  164. optional MultipartUploadCompleteResponse completeMultiPartUploadResponse = 47;
  165. optional MultipartUploadAbortResponse abortMultiPartUploadResponse = 48;
  166. optional GetS3SecretResponse getS3SecretResponse = 49;
  167. optional MultipartUploadListPartsResponse listMultipartUploadPartsResponse = 50;
  168. optional ServiceListResponse ServiceListResponse = 51;
  169. optional GetDelegationTokenResponseProto getDelegationTokenResponse = 61;
  170. optional RenewDelegationTokenResponseProto renewDelegationTokenResponse = 62;
  171. optional CancelDelegationTokenResponseProto cancelDelegationTokenResponse = 63;
  172. optional GetFileStatusResponse getFileStatusResponse = 70;
  173. optional CreateDirectoryResponse createDirectoryResponse = 71;
  174. optional CreateFileResponse createFileResponse = 72;
  175. optional LookupFileResponse lookupFileResponse = 73;
  176. optional ListStatusResponse listStatusResponse = 74;
  177. optional AddAclResponse addAclResponse = 75;
  178. optional RemoveAclResponse removeAclResponse = 76;
  179. optional SetAclResponse setAclResponse = 77;
  180. optional GetAclResponse getAclResponse = 78;
  181. optional PurgeKeysResponse purgeKeysResponse = 81;
  182. }
  183. enum Status {
  184. OK = 1;
  185. VOLUME_NOT_UNIQUE = 2;
  186. VOLUME_NOT_FOUND = 3;
  187. VOLUME_NOT_EMPTY = 4;
  188. VOLUME_ALREADY_EXISTS = 5;
  189. USER_NOT_FOUND = 6;
  190. USER_TOO_MANY_VOLUMES = 7;
  191. BUCKET_NOT_FOUND = 8;
  192. BUCKET_NOT_EMPTY = 9;
  193. BUCKET_ALREADY_EXISTS = 10;
  194. KEY_ALREADY_EXISTS = 11;
  195. KEY_NOT_FOUND = 12;
  196. INVALID_KEY_NAME = 13;
  197. ACCESS_DENIED = 14;
  198. INTERNAL_ERROR = 15;
  199. KEY_ALLOCATION_ERROR = 16;
  200. KEY_DELETION_ERROR = 17;
  201. KEY_RENAME_ERROR = 18;
  202. METADATA_ERROR = 19;
  203. OM_NOT_INITIALIZED = 20;
  204. SCM_VERSION_MISMATCH_ERROR = 21;
  205. S3_BUCKET_NOT_FOUND = 22;
  206. S3_BUCKET_ALREADY_EXISTS = 23;
  207. INITIATE_MULTIPART_UPLOAD_ERROR = 24;
  208. MULTIPART_UPLOAD_PARTFILE_ERROR = 25;
  209. NO_SUCH_MULTIPART_UPLOAD_ERROR = 26;
  210. MISMATCH_MULTIPART_LIST = 27;
  211. MISSING_UPLOAD_PARTS = 28;
  212. COMPLETE_MULTIPART_UPLOAD_ERROR = 29;
  213. ENTITY_TOO_SMALL = 30;
  214. ABORT_MULTIPART_UPLOAD_FAILED = 31;
  215. S3_SECRET_NOT_FOUND = 32;
  216. INVALID_AUTH_METHOD = 33;
  217. INVALID_TOKEN = 34;
  218. TOKEN_EXPIRED = 35;
  219. TOKEN_ERROR_OTHER = 36;
  220. LIST_MULTIPART_UPLOAD_PARTS_FAILED = 37;
  221. SCM_IN_SAFE_MODE = 38;
  222. INVALID_REQUEST = 39;
  223. BUCKET_ENCRYPTION_KEY_NOT_FOUND = 40;
  224. UNKNOWN_CIPHER_SUITE = 41;
  225. INVALID_KMS_PROVIDER = 42;
  226. TOKEN_CREATION_ERROR = 43;
  227. FILE_NOT_FOUND = 44;
  228. DIRECTORY_NOT_FOUND = 45;
  229. FILE_ALREADY_EXISTS = 46;
  230. NOT_A_FILE = 47;
  231. PERMISSION_DENIED = 48;
  232. TIMEOUT = 49;
  233. PREFIX_NOT_FOUND=50;
  234. S3_BUCKET_INVALID_LENGTH = 51; // s3 bucket invalid length.
  235. RATIS_ERROR = 52;
  236. }
  237. message VolumeInfo {
  238. required string adminName = 1;
  239. required string ownerName = 2;
  240. required string volume = 3;
  241. optional uint64 quotaInBytes = 4;
  242. repeated hadoop.hdds.KeyValue metadata = 5;
  243. repeated OzoneAclInfo volumeAcls = 6;
  244. optional uint64 creationTime = 7;
  245. }
  246. /**
  247. User information which will be extracted during RPC context and used
  248. during validating Acl.
  249. */
  250. message UserInfo {
  251. optional string userName = 1;
  252. optional string remoteAddress = 3;
  253. }
  254. /**
  255. Creates a volume
  256. */
  257. message CreateVolumeRequest {
  258. required VolumeInfo volumeInfo = 1;
  259. }
  260. message CreateVolumeResponse {
  261. }
  262. message VolumeList {
  263. repeated string volumeNames = 1;
  264. }
  265. /**
  266. Changes the Volume Properties -- like ownership and quota for a volume.
  267. */
  268. message SetVolumePropertyRequest {
  269. required string volumeName = 1;
  270. optional string ownerName = 2;
  271. optional uint64 quotaInBytes = 3;
  272. }
  273. message SetVolumePropertyResponse {
  274. }
  275. /**
  276. * Checks if the user has specified permissions for the volume
  277. */
  278. message CheckVolumeAccessRequest {
  279. required string volumeName = 1;
  280. required OzoneAclInfo userAcl = 2;
  281. }
  282. message CheckVolumeAccessResponse {
  283. }
  284. /**
  285. Returns information about a volume.
  286. */
  287. message InfoVolumeRequest {
  288. required string volumeName = 1;
  289. }
  290. message InfoVolumeResponse {
  291. optional VolumeInfo volumeInfo = 2;
  292. }
  293. /**
  294. Deletes an existing volume.
  295. */
  296. message DeleteVolumeRequest {
  297. required string volumeName = 1;
  298. }
  299. message DeleteVolumeResponse {
  300. }
  301. /**
  302. List Volumes -- List all volumes in the cluster or by user.
  303. */
  304. message ListVolumeRequest {
  305. enum Scope {
  306. USER_VOLUMES = 1; // User volumes -- called by user
  307. VOLUMES_BY_USER = 2; // User volumes - called by Admin
  308. VOLUMES_BY_CLUSTER = 3; // All volumes in the cluster
  309. }
  310. required Scope scope = 1;
  311. optional string userName = 2;
  312. optional string prefix = 3;
  313. optional string prevKey = 4;
  314. optional uint32 maxKeys = 5;
  315. }
  316. message ListVolumeResponse {
  317. repeated VolumeInfo volumeInfo = 2;
  318. }
  319. message BucketInfo {
  320. required string volumeName = 1;
  321. required string bucketName = 2;
  322. repeated OzoneAclInfo acls = 3;
  323. required bool isVersionEnabled = 4 [default = false];
  324. required StorageTypeProto storageType = 5 [default = DISK];
  325. optional uint64 creationTime = 6;
  326. repeated hadoop.hdds.KeyValue metadata = 7;
  327. optional BucketEncryptionInfoProto beinfo = 8;
  328. }
  329. enum StorageTypeProto {
  330. DISK = 1;
  331. SSD = 2;
  332. ARCHIVE = 3;
  333. RAM_DISK = 4;
  334. }
  335. /**
  336. * Cipher suite.
  337. */
  338. enum CipherSuiteProto {
  339. UNKNOWN = 1;
  340. AES_CTR_NOPADDING = 2;
  341. }
  342. /**
  343. * Crypto protocol version used to access encrypted files.
  344. */
  345. enum CryptoProtocolVersionProto {
  346. UNKNOWN_PROTOCOL_VERSION = 1;
  347. ENCRYPTION_ZONES = 2;
  348. }
  349. /**
  350. * Encryption information for bucket (bucket key)
  351. */
  352. message BucketEncryptionInfoProto {
  353. required string keyName = 1;
  354. optional CipherSuiteProto suite = 2;
  355. optional CryptoProtocolVersionProto cryptoProtocolVersion = 3;
  356. }
  357. /**
  358. * Encryption information for a file.
  359. */
  360. message FileEncryptionInfoProto {
  361. required CipherSuiteProto suite = 1;
  362. required CryptoProtocolVersionProto cryptoProtocolVersion = 2;
  363. required bytes key = 3;
  364. required bytes iv = 4;
  365. required string keyName = 5;
  366. required string ezKeyVersionName = 6;
  367. }
  368. /**
  369. * Encryption information for an individual
  370. * file within an encryption zone
  371. */
  372. message PerFileEncryptionInfoProto {
  373. required bytes key = 1;
  374. required bytes iv = 2;
  375. required string ezKeyVersionName = 3;
  376. }
  377. message DataEncryptionKeyProto {
  378. required uint32 keyId = 1;
  379. required bytes nonce = 3;
  380. required bytes encryptionKey = 4;
  381. required uint64 expiryDate = 5;
  382. optional string encryptionAlgorithm = 6;
  383. }
  384. message BucketArgs {
  385. required string volumeName = 1;
  386. required string bucketName = 2;
  387. optional bool isVersionEnabled = 5;
  388. optional StorageTypeProto storageType = 6;
  389. repeated hadoop.hdds.KeyValue metadata = 7;
  390. }
  391. message PrefixInfo {
  392. required string name = 1;
  393. repeated OzoneAclInfo acls = 2;
  394. repeated hadoop.hdds.KeyValue metadata = 3;
  395. }
  396. message OzoneObj {
  397. enum ObjectType {
  398. VOLUME = 1;
  399. BUCKET = 2;
  400. KEY = 3;
  401. PREFIX = 4;
  402. }
  403. enum StoreType {
  404. OZONE = 1;
  405. S3 = 2;
  406. }
  407. required ObjectType resType = 1;
  408. required StoreType storeType = 2 [default = S3];
  409. required string path = 3;
  410. }
  411. message OzoneAclInfo {
  412. enum OzoneAclType {
  413. USER = 1;
  414. GROUP = 2;
  415. WORLD = 3;
  416. ANONYMOUS = 4;
  417. CLIENT_IP = 5;
  418. }
  419. enum OzoneAclScope {
  420. ACCESS = 0;
  421. DEFAULT = 1;
  422. }
  423. required OzoneAclType type = 1;
  424. required string name = 2;
  425. required bytes rights = 3;
  426. required OzoneAclScope aclScope = 4 [default = ACCESS];
  427. }
  428. message GetAclRequest {
  429. required OzoneObj obj = 1;
  430. }
  431. message GetAclResponse {
  432. repeated OzoneAclInfo acls = 1;
  433. }
  434. message AddAclRequest {
  435. required OzoneObj obj = 1;
  436. required OzoneAclInfo acl = 2;
  437. }
  438. message AddAclResponse {
  439. required bool response = 1;
  440. }
  441. message RemoveAclRequest {
  442. required OzoneObj obj = 1;
  443. required OzoneAclInfo acl = 2;
  444. }
  445. message RemoveAclResponse {
  446. required bool response = 1;
  447. }
  448. message SetAclRequest {
  449. required OzoneObj obj = 1;
  450. repeated OzoneAclInfo acl = 2;
  451. }
  452. message SetAclResponse {
  453. required bool response = 1;
  454. }
  455. message CreateBucketRequest {
  456. required BucketInfo bucketInfo = 1;
  457. }
  458. message CreateBucketResponse {
  459. }
  460. message InfoBucketRequest {
  461. required string volumeName = 1;
  462. required string bucketName = 2;
  463. }
  464. message InfoBucketResponse {
  465. optional BucketInfo bucketInfo = 2;
  466. }
  467. message SetBucketPropertyRequest {
  468. optional BucketArgs bucketArgs = 1;
  469. }
  470. message SetBucketPropertyResponse {
  471. }
  472. message DeleteBucketRequest {
  473. required string volumeName = 1;
  474. required string bucketName = 2;
  475. }
  476. message DeleteBucketResponse {
  477. }
  478. message ListBucketsRequest {
  479. required string volumeName = 1;
  480. optional string startKey = 2;
  481. optional string prefix = 3;
  482. optional int32 count = 4;
  483. }
  484. message ListBucketsResponse {
  485. repeated BucketInfo bucketInfo = 2;
  486. }
  487. message KeyArgs {
  488. required string volumeName = 1;
  489. required string bucketName = 2;
  490. required string keyName = 3;
  491. optional uint64 dataSize = 4;
  492. optional hadoop.hdds.ReplicationType type = 5;
  493. optional hadoop.hdds.ReplicationFactor factor = 6;
  494. repeated KeyLocation keyLocations = 7;
  495. optional bool isMultipartKey = 8;
  496. optional string multipartUploadID = 9;
  497. optional uint32 multipartNumber = 10;
  498. repeated hadoop.hdds.KeyValue metadata = 11;
  499. repeated OzoneAclInfo acls = 12;
  500. // This will be set when the request is received in pre-Execute. This
  501. // value is used in setting creation/modification time depending on the
  502. // request type.
  503. optional uint64 modificationTime = 13;
  504. }
  505. message KeyLocation {
  506. required hadoop.hdds.BlockID blockID = 1;
  507. required uint64 offset = 3;
  508. required uint64 length = 4;
  509. // indicated at which version this block gets created.
  510. optional uint64 createVersion = 5;
  511. optional hadoop.common.TokenProto token = 6;
  512. // Walk around to include pipeline info for client read/write
  513. // without talking to scm.
  514. // NOTE: the pipeline info may change after pipeline close.
  515. // So eventually, we will have to change back to call scm to
  516. // get the up to date pipeline information. This will need o3fs
  517. // provide not only a OM delegation token but also a SCM delegation token
  518. optional hadoop.hdds.Pipeline pipeline = 7;
  519. }
  520. message KeyLocationList {
  521. optional uint64 version = 1;
  522. repeated KeyLocation keyLocations = 2;
  523. optional FileEncryptionInfoProto fileEncryptionInfo = 3;
  524. }
  525. message KeyInfo {
  526. required string volumeName = 1;
  527. required string bucketName = 2;
  528. required string keyName = 3;
  529. required uint64 dataSize = 4;
  530. required hadoop.hdds.ReplicationType type = 5;
  531. required hadoop.hdds.ReplicationFactor factor = 6;
  532. repeated KeyLocationList keyLocationList = 7;
  533. required uint64 creationTime = 8;
  534. required uint64 modificationTime = 9;
  535. optional uint64 latestVersion = 10;
  536. repeated hadoop.hdds.KeyValue metadata = 11;
  537. optional FileEncryptionInfoProto fileEncryptionInfo = 12;
  538. repeated OzoneAclInfo acls = 13;
  539. }
  540. message OzoneFileStatusProto {
  541. required hadoop.fs.FileStatusProto status = 1;
  542. }
  543. message GetFileStatusRequest {
  544. required KeyArgs keyArgs = 1;
  545. }
  546. message GetFileStatusResponse {
  547. required OzoneFileStatusProto status = 1;
  548. }
  549. message CreateDirectoryRequest {
  550. required KeyArgs keyArgs = 1;
  551. }
  552. message CreateDirectoryResponse {
  553. }
  554. message CreateFileRequest {
  555. required KeyArgs keyArgs = 1;
  556. required bool isRecursive = 2;
  557. required bool isOverwrite = 3;
  558. // Set in OM HA during preExecute step. This way all OM's use same ID in
  559. // OM HA.
  560. optional uint64 clientID = 4;
  561. }
  562. message CreateFileResponse {
  563. optional KeyInfo keyInfo = 1;
  564. // clients' followup request may carry this ID for stateful operations
  565. // (similar to a cookie).
  566. optional uint64 ID = 2;
  567. optional uint64 openVersion = 3;
  568. }
  569. message LookupFileRequest {
  570. required KeyArgs keyArgs = 1;
  571. }
  572. message LookupFileResponse {
  573. optional KeyInfo keyInfo = 1;
  574. }
  575. message ListStatusRequest {
  576. required KeyArgs keyArgs = 1;
  577. required bool recursive = 2;
  578. required string startKey = 3;
  579. required uint64 numEntries = 4;
  580. }
  581. message ListStatusResponse {
  582. repeated OzoneFileStatusProto statuses = 1;
  583. }
  584. message CreateKeyRequest {
  585. required KeyArgs keyArgs = 1;
  586. // Set in OM HA during preExecute step. This way all OM's use same ID in
  587. // OM HA.
  588. optional uint64 clientID = 2;
  589. }
  590. message CreateKeyResponse {
  591. optional KeyInfo keyInfo = 2;
  592. // clients' followup request may carry this ID for stateful operations
  593. // (similar to a cookie).
  594. optional uint64 ID = 3;
  595. optional uint64 openVersion = 4;
  596. }
  597. message LookupKeyRequest {
  598. required KeyArgs keyArgs = 1;
  599. }
  600. message LookupKeyResponse {
  601. optional KeyInfo keyInfo = 2;
  602. // clients' followup request may carry this ID for stateful operations (similar
  603. // to a cookie).
  604. optional uint64 ID = 3;
  605. // TODO : allow specifiying a particular version to read.
  606. optional uint64 openVersion = 4;
  607. }
  608. message RenameKeyRequest{
  609. required KeyArgs keyArgs = 1;
  610. required string toKeyName = 2;
  611. }
  612. message RenameKeyResponse{
  613. }
  614. message DeleteKeyRequest {
  615. required KeyArgs keyArgs = 1;
  616. }
  617. message DeleteKeyResponse {
  618. optional KeyInfo keyInfo = 2;
  619. // clients' followup request may carry this ID for stateful operations
  620. // (similar to a cookie).
  621. optional uint64 ID = 3;
  622. optional uint64 openVersion = 4;
  623. }
  624. message PurgeKeysRequest {
  625. repeated string keys = 1;
  626. }
  627. message PurgeKeysResponse {
  628. }
  629. message OMTokenProto {
  630. enum Type {
  631. DELEGATION_TOKEN = 1;
  632. S3TOKEN = 2;
  633. };
  634. required Type type = 1;
  635. optional uint32 version = 2;
  636. optional string owner = 3;
  637. optional string renewer = 4;
  638. optional string realUser = 5;
  639. optional uint64 issueDate = 6;
  640. optional uint64 maxDate = 7;
  641. optional uint32 sequenceNumber = 8;
  642. optional uint32 masterKeyId = 9;
  643. optional uint64 expiryDate = 10;
  644. optional string omCertSerialId = 11;
  645. optional string accessKeyId = 12;
  646. optional string signature = 13;
  647. optional string strToSign = 14;
  648. }
  649. message SecretKeyProto {
  650. required uint32 keyId = 1;
  651. required uint64 expiryDate = 2;
  652. required bytes privateKeyBytes = 3;
  653. required bytes publicKeyBytes = 4;
  654. }
  655. message ListKeysRequest {
  656. required string volumeName = 1;
  657. required string bucketName = 2;
  658. optional string startKey = 3;
  659. optional string prefix = 4;
  660. optional int32 count = 5;
  661. }
  662. message ListKeysResponse {
  663. repeated KeyInfo keyInfo = 2;
  664. }
  665. message CommitKeyRequest {
  666. required KeyArgs keyArgs = 1;
  667. required uint64 clientID = 2;
  668. }
  669. message CommitKeyResponse {
  670. }
  671. message AllocateBlockRequest {
  672. required KeyArgs keyArgs = 1;
  673. required uint64 clientID = 2;
  674. optional hadoop.hdds.ExcludeListProto excludeList = 3;
  675. // During HA on one of the OM nodes, we allocate block and send the
  676. // AllocateBlockRequest with keyLocation set. If this is set, no need to
  677. // call scm again in OM Ratis applyTransaction just append it to DB.
  678. optional KeyLocation keyLocation = 4;
  679. }
  680. message AllocateBlockResponse {
  681. optional KeyLocation keyLocation = 2;
  682. }
  683. message ServiceListRequest {
  684. }
  685. message ServiceListResponse {
  686. repeated ServiceInfo serviceInfo = 2;
  687. }
  688. message ServicePort {
  689. enum Type {
  690. RPC = 1;
  691. HTTP = 2;
  692. HTTPS = 3;
  693. RATIS = 4;
  694. };
  695. required Type type = 1;
  696. required uint32 value = 2;
  697. }
  698. message ServiceInfo {
  699. required hadoop.hdds.NodeType nodeType = 1;
  700. required string hostname = 2;
  701. repeated ServicePort servicePorts = 3;
  702. }
  703. message S3CreateBucketRequest {
  704. required string userName = 1;
  705. required string s3bucketname = 2;
  706. // This will be set during OM HA by one of the OM node. In future if more
  707. // data fields are required to create volume/bucket we can add them to
  708. // this. This is the reason for creating a new message type for this.
  709. // S3CreateBucket means create volume from userName and create bucket
  710. // with s3BucketName.
  711. optional S3CreateVolumeInfo s3CreateVolumeInfo = 3;
  712. }
  713. message S3CreateVolumeInfo {
  714. // Creation time set in preExecute on one of the OM node.
  715. required uint64 creationTime = 1;
  716. }
  717. message S3CreateBucketResponse {
  718. }
  719. message S3DeleteBucketRequest {
  720. required string s3bucketName = 1;
  721. }
  722. message S3DeleteBucketResponse {
  723. }
  724. message S3BucketInfoRequest {
  725. required string s3bucketName = 1;
  726. }
  727. message S3BucketInfoResponse {
  728. optional string ozoneMapping = 2;
  729. }
  730. message S3ListBucketsRequest {
  731. required string userName = 1;
  732. optional string startKey = 2;
  733. optional string prefix = 3;
  734. optional int32 count = 4;
  735. }
  736. message S3ListBucketsResponse {
  737. repeated BucketInfo bucketInfo = 2;
  738. }
  739. message MultipartInfoInitiateRequest {
  740. required KeyArgs keyArgs = 1;
  741. }
  742. message MultipartInfoInitiateResponse {
  743. required string volumeName = 1;
  744. required string bucketName = 2;
  745. required string keyName = 3;
  746. required string multipartUploadID = 4;
  747. }
  748. message MultipartKeyInfo {
  749. required string uploadID = 4;
  750. repeated PartKeyInfo partKeyInfoList = 5;
  751. }
  752. message PartKeyInfo {
  753. required string partName = 1;
  754. required uint32 partNumber = 2;
  755. required KeyInfo partKeyInfo = 3;
  756. }
  757. message MultipartCommitUploadPartRequest {
  758. required KeyArgs keyArgs = 1;
  759. required uint64 clientID = 2;
  760. }
  761. message MultipartCommitUploadPartResponse {
  762. // This one is returned as Etag for S3.
  763. optional string partName = 1;
  764. }
  765. message MultipartUploadCompleteRequest {
  766. required KeyArgs keyArgs = 1;
  767. repeated Part partsList = 2;
  768. }
  769. message MultipartUploadCompleteResponse {
  770. optional string volume = 1;
  771. optional string bucket = 2;
  772. optional string key = 3;
  773. optional string hash = 4; // This will be used as etag for s3
  774. }
  775. message Part {
  776. required uint32 partNumber = 1;
  777. required string partName = 2;
  778. }
  779. message MultipartUploadAbortRequest {
  780. required KeyArgs keyArgs = 1;
  781. }
  782. message MultipartUploadAbortResponse {
  783. }
  784. message MultipartUploadListPartsRequest {
  785. required string volume = 1;
  786. required string bucket = 2;
  787. required string key = 3;
  788. required string uploadID = 4;
  789. optional uint32 partNumbermarker = 5;
  790. optional uint32 maxParts = 6;
  791. }
  792. message MultipartUploadListPartsResponse {
  793. optional hadoop.hdds.ReplicationType type = 2;
  794. optional uint32 nextPartNumberMarker = 3;
  795. optional bool isTruncated = 4;
  796. repeated PartInfo partsList = 5;
  797. }
  798. message PartInfo {
  799. required uint32 partNumber = 1;
  800. required string partName = 2;
  801. required uint64 modificationTime = 3;
  802. required uint64 size = 4;
  803. }
  804. message GetDelegationTokenResponseProto{
  805. optional hadoop.common.GetDelegationTokenResponseProto response = 2;
  806. }
  807. message RenewDelegationTokenResponseProto{
  808. optional hadoop.common.RenewDelegationTokenResponseProto response = 2;
  809. }
  810. message CancelDelegationTokenResponseProto {
  811. optional hadoop.common.CancelDelegationTokenResponseProto response = 2;
  812. }
  813. message S3Secret {
  814. required string kerberosID = 1;
  815. required string awsSecret = 2;
  816. }
  817. message GetS3SecretRequest {
  818. required string kerberosID = 1;
  819. }
  820. message GetS3SecretResponse {
  821. required S3Secret s3Secret = 2;
  822. }
  823. /**
  824. The OM service that takes care of Ozone namespace.
  825. */
  826. service OzoneManagerService {
  827. // A client-to-OM RPC to send client requests to OM Ratis server
  828. rpc submitRequest(OMRequest)
  829. returns(OMResponse);
  830. }