Oms API GET service disk use - openmpp/openmpp.github.io GitHub Wiki

GET disk space usage info.

This method return disk use state: summary of disk use and list of model database files size.

Method:

GET /api/service/disk-use

Call examples:

http://localhost:4040/api/service/disk-use

JSON response body: Response body is JSON of following Go structure

{
  IsDiskUse bool         // if true then storage usage control enabled
  DiskUse {  // storage space use state
    IsOver        bool  // if true then storage use reach the limit
    DiskScanMs    int64 // timeout in msec, sleep interval between scanning storage
    Limit         int64 // bytes, this instance storage limit
    AllLimit      int64 // bytes, total storage limit for all oms instances
    AllSize       int64 // all oms instances size
    TotalSize     int64 // total size: models/bin size + download + upload
    BinSize       int64 // total models/bin size
    DbSize        int64 // total size of all db files
    DownSize      int64 // download total size
    UpSize        int64 // upload total size
    UpdateTs      int64 // info update time (unix milliseconds)
  }
  DbDiskUse [  // model db file disk usage
    {
      Digest string // model digest
      Size   int64  // bytes, if non zero then model database file size
      ModTs  int64  // db file mod time info update time (unix milliseconds)
    },
    {
      ....
    }
  ]
}

Example:

{
  "IsDiskUse": true,
  "DiskUse": {
    "IsOver": false,
    "DiskScanMs": 11000,
    "Limit": 12884901888,
    "AllLimit": 85899345920,
    "AllSize": 11401120043,
    "TotalSize": 11401120043,
    "BinSize": 11363374338,
    "DbSize": 11277418496,
    "DownSize": 13977232,
    "UpSize": 23768473,
    "UpdateTs": 1707275824187
  },
  "DbDiskUse": [{
      "Digest": "4114671ac687e8164f43e6f90ec14d65",
      "Size": 11150643200,
      "ModTs": 1701845412131
    }, {
      "Digest": "d90e1e9a49a06d972ecf1d50e684c62b",
      "Size": 872448,
      "ModTs": 1707196254975
    }, {
      "Digest": "_201208171604590148_",
      "Size": 125902848,
      "ModTs": 1707143875935
    }
  ]
}
⚠️ **GitHub.com Fallback** ⚠️