github.com/cs3org/reva/v2@v2.27.7/pkg/eosclient/eosgrpc/eos_grpc/Rpc.proto (about)

     1  // @project        The CERN Tape Archive (CTA)
     2  // @brief          CTA-EOS gRPC API for CASTOR-EOS migration
     3  // @copyright      Copyright 2019 CERN
     4  // @license        This program is free software: you can redistribute it and/or
     5  // modify
     6  //                 it under the terms of the GNU General Public License as
     7  //                 published by the Free Software Foundation, either version 3
     8  //                 of the License, or (at your option) any later version.
     9  //
    10  //                 This program is distributed in the hope that it will be
    11  //                 useful, but WITHOUT ANY WARRANTY; without even the implied
    12  //                 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    13  //                 PURPOSE.  See the GNU General Public License for more
    14  //                 details.
    15  //
    16  //                 You should have received a copy of the GNU General Public
    17  //                 License along with this program.  If not, see
    18  //                 <http://www.gnu.org/licenses/>.
    19  
    20  // NOTE: Compile for Go with:
    21  // protoc ./eos_grpc.proto --go_out=plugins=grpc:.
    22  
    23  syntax = "proto3";
    24  
    25  package eos.rpc;
    26  
    27  option java_multiple_files = true;
    28  option java_package = "io.grpc.eos.rpc";
    29  option java_outer_classname = "EosProto";
    30  option objc_class_prefix = "EOS";
    31  option go_package = "github.com/cern-eos/grpc-proto/protobuf;eos_grpc";
    32  
    33  service Eos {
    34    // Replies to a ping
    35    rpc Ping(PingRequest) returns (PingReply) {}
    36  
    37    // ---------------------------------------------------------------------
    38    // NAMESPACE
    39    // ---------------------------------------------------------------------
    40  
    41    // Replies to MD requests with a stream
    42    rpc MD(MDRequest) returns (stream MDResponse) {}
    43  
    44    // Replies to Find requests with a stream
    45    rpc Find(FindRequest) returns (stream MDResponse) {}
    46  
    47    // Replies to a NsStat operation
    48    rpc NsStat(NsStatRequest) returns (NsStatResponse) {}
    49  
    50    // Replies to an insert
    51    rpc ContainerInsert(ContainerInsertRequest) returns (InsertReply) {}
    52    rpc FileInsert(FileInsertRequest) returns (InsertReply) {}
    53  
    54    // Replies to a NsRequest operation
    55    rpc Exec(NSRequest) returns (NSResponse) {}
    56  
    57    // ---------------------------------------------------------------------
    58    // OPENSTACK
    59    // ---------------------------------------------------------------------
    60  
    61    // Manila Driver
    62    rpc ManilaServerRequest(ManilaRequest) returns (ManilaResponse) {}
    63  }
    64  
    65  message PingRequest {
    66    string authkey = 1;
    67    bytes message = 2;
    68  }
    69  
    70  message PingReply { bytes message = 1; }
    71  
    72  // ---------------------------------------------------------------------
    73  // NAMESPACE
    74  // ---------------------------------------------------------------------
    75  
    76  message ContainerInsertRequest {
    77    repeated ContainerMdProto container = 1;
    78    string authkey = 2;
    79    bool inherit_md = 3;
    80  }
    81  
    82  message FileInsertRequest {
    83    repeated FileMdProto files = 1;
    84    string authkey = 2;
    85  }
    86  
    87  message InsertReply {
    88    repeated string message = 1;
    89    repeated uint32 retc = 2;
    90  }
    91  
    92  message Time {
    93    uint64 sec = 1;
    94    uint64 n_sec = 2;
    95  }
    96  
    97  message Checksum {
    98    bytes value = 1;
    99    string type = 2;
   100  }
   101  
   102  message FileMdProto {
   103    uint64 id = 1;
   104    uint64 cont_id = 2;
   105    uint64 uid = 3;
   106    uint64 gid = 4;
   107    uint64 size = 5;
   108    uint32 layout_id = 6;
   109    uint32 flags = 7;
   110    bytes name = 8;
   111    bytes link_name = 9;
   112    Time ctime = 10; // change time
   113    Time mtime = 11; // modification time
   114    Checksum checksum = 12;
   115    repeated uint32 locations = 13;
   116    repeated uint32 unlink_locations = 14;
   117    map<string, bytes> xattrs = 15;
   118    bytes path = 16;
   119    string etag = 17;
   120    uint64 inode = 18;
   121  }
   122  
   123  message ContainerMdProto {
   124    uint64 id = 1;
   125    uint64 parent_id = 2;
   126    uint64 uid = 3;
   127    uint64 gid = 4;
   128    int64 tree_size = 6;
   129    uint32 mode = 5;
   130    uint32 flags = 7;
   131    bytes name = 8;
   132    Time ctime = 9;  // change time
   133    Time mtime = 10; // modification time
   134    Time stime = 11; // sync time
   135    map<string, bytes> xattrs = 12;
   136    bytes path = 13;
   137    string etag = 14;
   138    uint64 inode = 15;
   139  }
   140  
   141  enum TYPE {
   142    FILE = 0;
   143    CONTAINER = 1;
   144    LISTING = 2;
   145    STAT = 3;
   146  }
   147  
   148  enum QUOTATYPE {
   149    USER = 0;
   150    GROUP = 2;
   151    PROJECT = 3;
   152  }
   153  
   154  enum QUOTAOP {
   155    GET = 0;
   156    SET = 1;
   157    RM = 2;
   158    RMNODE = 3;
   159  }
   160  
   161  enum QUOTAENTRY {
   162    NONE = 0;
   163    VOLUME = 1;
   164    INODE = 2;
   165  }
   166  
   167  message QuotaProto {
   168    bytes path = 1;              // quota node path
   169    string name = 2;             // associated name for the given type
   170    QUOTATYPE type = 3;          // user,group,project or all quota
   171    uint64 usedbytes = 4;        // bytes used physical
   172    uint64 usedlogicalbytes = 5; // bytes used logical
   173    uint64 usedfiles = 6;        // number of files used
   174    uint64 maxbytes = 7;         // maximum number of bytes (volume quota)
   175    uint64 maxlogicalbytes =
   176        8;               // maximum number of logical bytes (logical volume quota)
   177    uint64 maxfiles = 9; // maximum number of files (inode quota)
   178    float percentageusedbytes =
   179        10; // percentage of volume quota used from 0 to 100
   180    float percentageusedfiles = 11; // percentag of inode quota used from 0 to 100
   181    string statusbytes = 12; // status string for volume quota ok,warning,exceeded
   182    string statusfiles = 13; // status string for inode quota ok,warning,exceeded
   183  }
   184  
   185  message RoleId {
   186    uint64 uid = 1;
   187    uint64 gid = 2;
   188    string username = 3;
   189    string groupname = 4;
   190  }
   191  
   192  message MDId {
   193    bytes path = 1;
   194    fixed64 id = 2;
   195    fixed64 ino = 3;
   196    TYPE type = 4;
   197  }
   198  
   199  message Limit {
   200    bool zero = 1;
   201    uint64 min = 2;
   202    uint64 max = 3;
   203  }
   204  
   205  message MDSelection {
   206    bool select = 1;
   207    Limit ctime = 2;
   208    Limit mtime = 3;
   209    Limit stime = 4;
   210    Limit size = 5;
   211    Limit treesize = 6;
   212    Limit children = 7;
   213    Limit locations = 8;
   214    Limit unlinked_locations = 9;
   215    uint64 layoutid = 10;
   216    uint64 flags = 11;
   217    bool symlink = 12;
   218    Checksum checksum = 13;
   219    uint32 owner = 14;
   220    uint32 group = 15;
   221    bool owner_root = 16;
   222    bool group_root = 17;
   223    bytes regexp_filename = 18;
   224    bytes regexp_dirname = 19;
   225    map<string, bytes> xattr = 20;
   226  }
   227  
   228  message MDRequest {
   229    TYPE type = 1;
   230    MDId id = 2;
   231    string authkey = 3;
   232    RoleId role = 4;
   233    MDSelection selection = 5;
   234  }
   235  
   236  message MDResponse {
   237    TYPE type = 1;
   238    FileMdProto fmd = 2;
   239    ContainerMdProto cmd = 3;
   240  }
   241  
   242  message FindRequest {
   243    TYPE type = 1;
   244    MDId id = 2;
   245    RoleId role = 3;
   246    string authkey = 4;
   247    uint64 maxdepth = 5;
   248    MDSelection selection = 6;
   249  }
   250  
   251  message ShareAuth {
   252    string prot = 1;
   253    string name = 2;
   254    string host = 3;
   255  }
   256  
   257  message ShareProto {
   258    string permission = 1;
   259    uint64 expires = 2;
   260    string owner = 3;
   261    string group = 4;
   262    uint64 generation = 5;
   263    string path = 6;
   264    bool allowtree = 7;
   265    string vtoken = 8;
   266    repeated ShareAuth origins = 9;
   267  }
   268  
   269  message ShareToken {
   270    ShareProto token = 1;
   271    bytes signature = 2;
   272    bytes serialized = 3;
   273    int32 seed = 4;
   274  }
   275  
   276  message NSRequest {
   277    message MkdirRequest {
   278      MDId id = 1;
   279      bool recursive = 2;
   280      int64 mode = 3;
   281    }
   282  
   283    message RmdirRequest { MDId id = 1; }
   284  
   285    message TouchRequest { MDId id = 1; }
   286  
   287    message UnlinkRequest {
   288      MDId id = 1;
   289      bool norecycle = 3;
   290    }
   291  
   292    message RmRequest {
   293      MDId id = 1;
   294      bool recursive = 2;
   295      bool norecycle = 3;
   296    }
   297  
   298    message RenameRequest {
   299      MDId id = 1;
   300      bytes target = 2;
   301    }
   302  
   303    message SymlinkRequest {
   304      MDId id = 1;
   305      bytes target = 2;
   306    }
   307  
   308    message VersionRequest {
   309      enum VERSION_CMD {
   310        CREATE = 0;
   311        PURGE = 1;
   312        LIST = 2;
   313        GRAB = 3;
   314      }
   315      MDId id = 1;
   316      VERSION_CMD cmd = 2;
   317      int32 maxversion = 3;
   318      string grabversion = 4;
   319    }
   320  
   321    message RecycleRequest {
   322      string key = 1;
   323      enum RECYCLE_CMD {
   324        RESTORE = 0;
   325        PURGE = 1;
   326        LIST = 2;
   327      }
   328      RECYCLE_CMD cmd = 2;
   329  
   330      message RestoreFlags {
   331        bool force = 1;
   332        bool mkpath = 2;
   333        bool versions = 3;
   334      }
   335  
   336      message PurgeDate {
   337        int32 year = 1;
   338        int32 month = 2;
   339        int32 day = 3;
   340      }
   341  
   342      RestoreFlags restoreflag = 3;
   343      PurgeDate purgedate = 4;
   344    }
   345  
   346    message SetXAttrRequest {
   347      MDId id = 1;
   348      map<string, bytes> xattrs = 2;
   349      bool recursive = 3;
   350      repeated string keystodelete = 4;
   351      bool create = 5;
   352    }
   353  
   354    message ChownRequest {
   355      MDId id = 1;
   356      RoleId owner = 2;
   357    }
   358  
   359    message ChmodRequest {
   360      MDId id = 1;
   361      int64 mode = 2;
   362    }
   363  
   364    message AclRequest {
   365      enum ACL_COMMAND {
   366        NONE = 0;
   367        MODIFY = 1;
   368        LIST = 2;
   369      }
   370  
   371      enum ACL_TYPE {
   372        USER_ACL = 0;
   373        SYS_ACL = 1;
   374      }
   375  
   376      MDId id = 1;
   377      ACL_COMMAND cmd = 2;
   378      bool recursive = 3;
   379      ACL_TYPE type = 4;
   380      string rule = 5;
   381      uint32 position = 6;
   382    }
   383  
   384    message TokenRequest { ShareToken token = 1; }
   385  
   386    message QuotaRequest {
   387      bytes path = 1;
   388      RoleId id = 2;
   389      QUOTAOP op = 3;       // get or set, rm or rmnode
   390      uint64 maxfiles = 4;  // maximum number of bytes (volume quota) for setting
   391      uint64 maxbytes = 5;  // maximum number of bytes (volume quota) for setting
   392      QUOTAENTRY entry = 6; // select volume or inode entry for deletion
   393    }
   394  
   395    message ShareRequest {
   396      message LsShare {
   397        enum OutFormat {
   398          NONE = 0;       //
   399          MONITORING = 1; // [-m]
   400          LISTING = 2;    // [-l]
   401          JSON = 3;       // [grpc]
   402        }
   403        OutFormat outformat = 1; //
   404        string selection = 2;    //
   405      }
   406  
   407      message OperateShare {
   408        enum Op {
   409          CREATE = 0;
   410          REMOVE = 1;
   411          SHARE = 2;
   412          UNSHARE = 3;
   413          ACCESS = 4;
   414          MODIFY = 5;
   415        }
   416        Op op = 1;
   417        string share = 2;
   418        string acl = 3;
   419        string path = 4;
   420        string user = 5;
   421        string group = 6;
   422      }
   423  
   424      oneof subcmd {
   425        LsShare ls = 1;
   426        OperateShare op = 2;
   427      }
   428    }
   429  
   430    string authkey = 1;
   431    RoleId role = 2;
   432  
   433    // Actual request data object
   434    oneof command {
   435      MkdirRequest mkdir = 21;
   436      RmdirRequest rmdir = 22;
   437      TouchRequest touch = 23;
   438      UnlinkRequest unlink = 24;
   439      RmRequest rm = 25;
   440      RenameRequest rename = 26;
   441      SymlinkRequest symlink = 27;
   442      VersionRequest version = 28;
   443      RecycleRequest recycle = 29;
   444      SetXAttrRequest xattr = 30;
   445      ChownRequest chown = 31;
   446      ChmodRequest chmod = 32;
   447      AclRequest acl = 33;
   448      TokenRequest token = 34;
   449      QuotaRequest quota = 35;
   450      ShareRequest share = 36;
   451    }
   452  }
   453  
   454  message NSResponse {
   455    message ErrorResponse {
   456      int64 code = 1;
   457      string msg = 2;
   458    }
   459  
   460    message VersionResponse {
   461      message VersionInfo {
   462        MDId id = 1;
   463        Time mtime = 2;
   464      }
   465      int64 code = 1;
   466      string msg = 2;
   467      repeated VersionInfo versions = 3;
   468    }
   469  
   470    message RecycleResponse {
   471      int64 code = 1;
   472      string msg = 2;
   473  
   474      message RecycleInfo {
   475        enum DELETIONTYPE {
   476          FILE = 0;
   477          TREE = 1;
   478        }
   479        MDId id = 1;
   480        RoleId owner = 2;
   481        Time dtime = 3;
   482        uint64 size = 4;
   483        DELETIONTYPE type = 5;
   484        string key = 6;
   485      }
   486  
   487      repeated RecycleInfo recycles = 3;
   488    }
   489  
   490    message AclResponse {
   491      int64 code = 1;
   492      string msg = 2;
   493      string rule = 3;
   494    }
   495  
   496    message QuotaResponse {
   497      int64 code = 1;
   498      string msg = 2;
   499      repeated QuotaProto quotanode = 3;
   500    }
   501  
   502    message ShareInfo {
   503      string name = 1;
   504      string root = 2;
   505      string rule = 3;
   506      uint64 uid = 4;
   507      uint64 nshared = 5;
   508    }
   509  
   510    message ShareAccess {
   511      string name = 1;
   512      bool granted = 2;
   513    }
   514  
   515    message ShareResponse {
   516      int64 code = 1;
   517      string msg = 2;
   518      repeated ShareInfo shares = 3;
   519      repeated ShareAccess access = 4;
   520    }
   521  
   522    ErrorResponse error = 1;
   523    VersionResponse version = 2;
   524    RecycleResponse recycle = 3;
   525    AclResponse acl = 4;
   526    QuotaResponse quota = 5;
   527    ShareResponse share = 6;
   528  }
   529  
   530  message NsStatRequest { string authkey = 1; }
   531  
   532  message NsStatResponse {
   533    int64 code = 1;
   534    string emsg = 2;
   535    string state = 3;
   536    uint64 nfiles = 4;
   537    uint64 ncontainers = 5;
   538    uint64 boot_time = 6;
   539    uint64 current_fid = 7;
   540    uint64 current_cid = 8;
   541    uint64 mem_virtual = 9;
   542    uint64 mem_resident = 10;
   543    uint64 mem_share = 11;
   544    uint64 mem_growth = 12;
   545    uint64 threads = 13;
   546    uint64 fds = 14;
   547    uint64 uptime = 15;
   548  }
   549  
   550  // ---------------------------------------------------------------------
   551  // OPENSTACK
   552  // ---------------------------------------------------------------------
   553  
   554  enum MANILA_REQUEST_TYPE {
   555    CREATE_SHARE = 0;
   556    DELETE_SHARE = 1;
   557    EXTEND_SHARE = 2;
   558    SHRINK_SHARE = 3;
   559    MANAGE_EXISTING = 4;
   560    UNMANAGE = 5;
   561    GET_CAPACITIES = 6;
   562    /* EXTRA FUNCTIONS NOT IMPLEMENTED */
   563    /*
   564    CREATE_SNAPSHOT = 7;
   565    DELETE_SNAPSHOT = 8;
   566    CREATE_SHARE_FROM_SNAPSHOT = 9;
   567    ENSURE_SHARE = 10;
   568    ALLOW_ACCESS = 11;
   569    DENY_ACCESS = 12;
   570    GET_SHARE_STATS = 13;
   571    DO_SETUP = 14;
   572    SETUP_SERVER = 15;
   573    TEARDOWN_SERVER = 16;
   574    GET_NETWORK_ALLOCATIONS_NUMBER = 17;
   575    VERIFY_SHARE_SERVER_HANDLING = 18;
   576    CREATE_SHARE_GROUP = 19;
   577    DELETE_SHARE_GROUP = 20;
   578    */
   579  }
   580  
   581  message ManilaRequest {
   582    MANILA_REQUEST_TYPE request_type = 1;
   583    string auth_key = 2;
   584    string protocol = 3;
   585    string share_name = 4;
   586    string description = 5;
   587    string share_id = 6;
   588    string share_group_id = 7;
   589    int32 quota = 8;
   590    string creator = 9;
   591    string egroup = 10;
   592    string admin_egroup = 11;
   593    string share_host = 12;
   594    string share_location = 13;
   595  }
   596  
   597  message ManilaResponse {
   598    string msg = 1; // for generic messages
   599    int32 code = 2; // < 1 is an error -- > 1 is OK
   600    int64 total_used = 3;
   601    int64 total_capacity = 4;
   602    int64 new_share_quota = 5;
   603    string new_share_path = 6;
   604  }