static async shrinkESIndex (req, res) {
    if (internals.multiES && req.query.cluster === undefined) {
      return res.serverError(401, 'Not supported in multies');
    }

    if (!req.body) {
      return res.serverError(403, 'Missing body');
    }

    if (!ArkimeUtil.isString(req.body.target)) {
      return res.serverError(403, 'Missing target');
    }

    const settingsParams = {
      body: {
        'index.routing.allocation.total_shards_per_node': null,
        'index.routing.allocation.require._name': req.body.target,
        'index.blocks.write': true
      },
      cluster: req.query.cluster
    };

    try {
      await Db.setIndexSettings(req.params.index, settingsParams);
      const shrinkParams = {
        body: {
          settings: {
            'index.routing.allocation.require._name': null,
            'index.blocks.write': null,
            'index.codec': 'best_compression',
            'index.number_of_shards': req.body.numShards || 1
          }
        },
        cluster: req.query.cluster
      };

      // wait for no more reloacting shards
      const shrinkCheckInterval = setInterval(() => {
        Db.healthCache(req.query.cluster).then(async (result) => {
          if (result.relocating_shards === 0) {
            clearInterval(shrinkCheckInterval);
            try {
              await Db.shrinkIndex(req.params.index, shrinkParams);

              const { body: indexResult } = await Db.indices(`${req.params.index}-shrink,${req.params.index}`, req.query.cluster);
              if (indexResult[0] && indexResult[1] &&
                indexResult[0]['docs.count'] === indexResult[1]['docs.count']) {
                await Db.deleteIndex([req.params.index], { cluster: req.query.cluster });
              }
            } catch (err) {
              console.log(`ERROR - ${req.method} /api/esindices/%s/shrink`, ArkimeUtil.sanitizeStr(req.params.index), util.inspect(err, false, 50));
            }
          }
        });
      }, 10000);

      // always return right away, shrinking might take a while
      return res.send(JSON.stringify({ success: true }));
    } catch (err) {
      return res.send(JSON.stringify({
        success: false,
        text: ArkimeUtil.safeStr(err.message)
      }));
    }
  }
POST - /api/esindices/:index/shrink

Shrinks an OpenSearch/Elasticsearch index (admin only).
@name /esindices/:index/shrink
@param {string} target - The index name to shrink the index to.
@param {number} numShards - The number of shards to shrink the index to.
@returns {boolean} success - Whether the close shrink operation was successful.
@returns {string} text - The success/error message to (optionally) display to the user.