syntax="proto3";
package eos.console;

message NsProto {
  message StatProto {
    bool Groupids   = 1;
    bool Monitor    = 2;
    bool NumericIds = 3;
    bool Reset      = 4;
    bool Summary    = 5;
  }

  message MutexProto {
    bool List = 1;
    bool Toggle_timing = 2;
    bool Toggle_order  = 3;
    bool Sample_rate1  = 4;
    bool Sample_rate10 = 5;
    bool Sample_rate100 = 6;
    bool Toggle_deadlock = 7;
    int64 Blockedtime = 8;
  }

  message CompactProto {
    enum CompactType {
      FILES        = 0;
      DIRS         = 1;
      ALL          = 2;
      FILES_REPAIR = 3;
      DIRS_REPAIR  = 4;
      ALL_REPAIR   = 5;
   }

   bool On = 1;
   CompactType type = 2;
   int64 Delay    = 3;
   int64 Interval = 4;
  }

  message MasterProto {
    enum OpType {
      NONE      = 0;
      LOG       = 1;
      LOG_CLEAR = 2;
      DISABLE   = 3;
      ENABLE    = 4;
    }

    OpType op = 1;
    string Host = 2;
  }

  message ContainerSpecificationProto {
    oneof container {
      string path = 1;
      string cid = 2;
      string cxid = 3;
    }
  }

  message TreeSizeProto {
    uint32 depth = 1;
    ContainerSpecificationProto container = 2;
  }

  message QuotaSizeProto {
    ContainerSpecificationProto container = 1;
    string uid = 2;
    string gid = 3;
    uint64 used_bytes = 4;
    uint64 physical_bytes = 5;
    uint64 used_inodes = 6;
  }

  message CacheProto {
    enum OpType {
      SET_FILE  = 0;
      SET_DIR   = 1;
      DROP_FILE = 2;
      DROP_DIR  = 3;
      DROP_ALL  = 4;
      DROP_SINGLE_FILE = 5;
      DROP_SINGLE_CONTAINER = 6;
    }

    OpType op = 1;
    uint64 max_num  = 2;
    uint64 max_size = 3;
    uint64 single_to_drop = 4;
  }

  message DrainSizeProto {
    uint64 max_num = 1;
  }

  message ReserveIdsProto {
    uint64 fileId = 1;
    uint64 containerId = 2;
  }

  message BenchmarkProto {
    uint64 threads = 1;
    uint64 subdirs = 2;
    uint64 subfiles = 3;
    string prefix =4;
  }
    
  oneof subcmd {
    StatProto stat          = 1;
    MutexProto mutex        = 2;
    CompactProto compact    = 3;
    MasterProto master      = 4;
    TreeSizeProto tree      = 5;
    CacheProto cache        = 6;
    QuotaSizeProto quota    = 7;
    DrainSizeProto drain    = 8;
    ReserveIdsProto reserve = 9;
    BenchmarkProto benchmark = 10;
  }
}
